Merge branch 'tmp_6.7.0_arrow' into 'dev_robotaxi-d_240912_6.7.0'
Tmp 6.7.0 arrow See merge request SCA/L4HA/AndroidApp/MoGoEagleEye!872
@@ -36,6 +36,7 @@ import com.mogo.och.common.module.biz.login.LoginStatusManager
|
||||
import com.mogo.och.common.module.biz.provider.CommonService
|
||||
import com.mogo.och.common.module.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
/**
|
||||
* 网约车小巴业务实现入口
|
||||
@@ -213,7 +214,7 @@ abstract class FacadeProvider : IMoGoFunctionProvider, ILoginCallback {
|
||||
CallerHmiManager.hideToolsView()
|
||||
ToggleDebugView.toggleDebugView.dismiss()
|
||||
SopView.sopView.dismiss()
|
||||
CallerHmiManager.dismissFSMStatusDetailWindow()
|
||||
CallerHmiManager.dismissFSMExceptionStatusWindow()
|
||||
CallerHmiManager.hideStatusSummaryDialog()
|
||||
commonService?.resetFragment()
|
||||
val fragment = LoginStatusManager.getFragment()
|
||||
@@ -262,7 +263,7 @@ abstract class FacadeProvider : IMoGoFunctionProvider, ILoginCallback {
|
||||
statusBarView.tag = "status_bar"
|
||||
val statusBarLP = FrameLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
AutoSizeUtils.dp2px(it, 72.0f),
|
||||
)
|
||||
statusBarLP.topMargin = 0
|
||||
statusBarLP.gravity = Gravity.TOP
|
||||
|
||||
@@ -52,8 +52,8 @@ buildscript {
|
||||
allprojects {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
maven { url 'http://nexus.zhidaoauto.com/repository/maven-releases/' }
|
||||
maven { url 'http://nexus.zhidaoauto.com/repository/maven-public/' }
|
||||
maven { url 'https://nexus.zhidaoauto.com/repository/maven-releases/' }
|
||||
maven { url 'https://nexus.zhidaoauto.com/repository/maven-public/' }
|
||||
maven { url 'https://storage.zego.im/maven' }
|
||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
|
||||
|
||||
@@ -8,6 +8,7 @@ import androidx.lifecycle.*
|
||||
import androidx.lifecycle.Lifecycle.Event
|
||||
import androidx.lifecycle.Lifecycle.Event.ON_CREATE
|
||||
import androidx.lifecycle.Lifecycle.Event.ON_DESTROY
|
||||
import chassis.Chassis
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager
|
||||
@@ -46,6 +47,7 @@ import java.lang.ref.*
|
||||
import java.util.concurrent.*
|
||||
import java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
import kotlin.random.Random
|
||||
|
||||
|
||||
object StatusManager {
|
||||
@@ -146,6 +148,89 @@ object StatusManager {
|
||||
last.set(current)
|
||||
}
|
||||
}
|
||||
|
||||
randomStatus(ctx)
|
||||
}
|
||||
|
||||
//TODO 删除 Mock代码
|
||||
var hasFSM = true
|
||||
var lastTimeMillis = System.currentTimeMillis()
|
||||
|
||||
private fun randomStatus(ctx: Context) {
|
||||
val current = System.currentTimeMillis()
|
||||
if (current - lastTimeMillis > 1 * 60 * 1000L) {
|
||||
hasFSM = !hasFSM
|
||||
randomNoFSMChange(ctx)
|
||||
lastTimeMillis = current
|
||||
}
|
||||
if (hasFSM) {
|
||||
randomFSMStatus(ctx)
|
||||
} else {
|
||||
randomWithoutFSMStatus(ctx)
|
||||
}
|
||||
UiThreadHandler.postDelayed({
|
||||
randomStatus(ctx)
|
||||
}, 500L)
|
||||
}
|
||||
private fun randomNoFSMChange(ctx: Context) {
|
||||
val fsmStatus = FSMStatus(FSMStateCode.ExistNormal, "正常")
|
||||
val noFsmStatus = FSMStatus(FSMStateCode.NotExist, "")
|
||||
|
||||
ctx.lifeCycleScope.launch(dispatcher) {
|
||||
model.update(if (hasFSM) fsmStatus else noFsmStatus)
|
||||
}
|
||||
}
|
||||
|
||||
private fun randomFSMStatus(ctx: Context) {
|
||||
val fsmNormalStatus = FSMStatus(FSMStateCode.ExistNormal, "正常")
|
||||
val fsmErrorStatus = FSMStatus(FSMStateCode.ExistError, "异常")
|
||||
|
||||
val fSMList = ArrayList<Status>()?.also {
|
||||
it += fsmNormalStatus
|
||||
it += fsmErrorStatus
|
||||
it += fsmNormalStatus
|
||||
it += fsmErrorStatus
|
||||
it += fsmNormalStatus
|
||||
it += fsmErrorStatus
|
||||
it += fsmNormalStatus
|
||||
it += fsmErrorStatus
|
||||
}
|
||||
val randomInt = Random.nextInt(0, fSMList.size - 1)
|
||||
val randomStatus = fSMList[randomInt]
|
||||
ctx.lifeCycleScope.launch(dispatcher) {
|
||||
model.update(randomStatus)
|
||||
}
|
||||
}
|
||||
|
||||
private fun randomWithoutFSMStatus(ctx: Context) {
|
||||
val gearNormal = GearStatus(Chassis.GearPosition.GEAR_P.number, false)
|
||||
val gearError = GearStatus(Chassis.GearPosition.GEAR_P.number, true)
|
||||
val acceleratorNormal = AcceleratorStatus(0, false)
|
||||
val acceleratorError = AcceleratorStatus(0, true)
|
||||
val brakeNormal = BrakeStatus(0, false)
|
||||
val brakeError = BrakeStatus(0, true)
|
||||
val doubleFlashNormal = DoubleFlashStatus(0, false)
|
||||
val doubleFlashError = DoubleFlashStatus(0, true)
|
||||
val steerNormal = SteerStatus(0.0f, false)
|
||||
val steerError = SteerStatus(0.0f, true)
|
||||
val withOutFSMList = ArrayList<Status>()?.also {
|
||||
it += gearNormal
|
||||
it += gearError
|
||||
it += acceleratorNormal
|
||||
it += acceleratorError
|
||||
it += brakeNormal
|
||||
it += brakeError
|
||||
it += doubleFlashNormal
|
||||
it += doubleFlashError
|
||||
it += steerNormal
|
||||
it += steerError
|
||||
}
|
||||
|
||||
val randomInt = Random.nextInt(0, withOutFSMList.size - 1)
|
||||
val randomStatus = withOutFSMList[randomInt]
|
||||
ctx.lifeCycleScope.launch(dispatcher) {
|
||||
model.update(randomStatus)
|
||||
}
|
||||
}
|
||||
|
||||
fun show(container: ViewGroup) {
|
||||
|
||||
@@ -167,7 +167,10 @@ class FSMStatus(var state: FSMStateCode, var desc: String = ""): Status(), IAuto
|
||||
|
||||
override fun isException(): Boolean = state == FSMStateCode.ExistError
|
||||
|
||||
fun hasFSMModule(): Boolean = (state == FSMStateCode.ExistNormal) || (state == FSMStateCode.ExistError)
|
||||
/**
|
||||
* 是否有 FSM 模块,Unknown展示 FSM 样式,算存在
|
||||
*/
|
||||
fun hasFSMModule(): Boolean = (state == FSMStateCode.UnKnown) || (state == FSMStateCode.ExistNormal) || (state == FSMStateCode.ExistError)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -71,12 +71,13 @@ internal class FSMImpl(ctx: Context) : IFlow<FSMStatus>(ctx), IMoGoAutopilotStat
|
||||
}
|
||||
|
||||
override fun onCreate() {
|
||||
send(FSMStatus(getStateCode(), getDesc()))
|
||||
//TODO 删除 Mock代码
|
||||
//send(FSMStatus(getStateCode(), getDesc()))
|
||||
CallerLogger.d("$M_DEVA$TAG", "-- onCreate --")
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerFsm2024ListenerManager.addListener(TAG, this)
|
||||
CallerNodeStateListenerManager.addNodeStateListener(TAG, setOf(AdasConstants.NodeName.FSM2024), this)
|
||||
CallerOrderListenerManager.addListener(TAG, this)
|
||||
//CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
//CallerFsm2024ListenerManager.addListener(TAG, this)
|
||||
// CallerNodeStateListenerManager.addNodeStateListener(TAG, setOf(AdasConstants.NodeName.FSM2024), this)
|
||||
//CallerOrderListenerManager.addListener(TAG, this)
|
||||
}
|
||||
override fun onAutopilotIpcConnectStatusChanged(
|
||||
status: AdasConstants.IpcConnectionStatus,
|
||||
@@ -131,7 +132,7 @@ internal class FSMImpl(ctx: Context) : IFlow<FSMStatus>(ctx), IMoGoAutopilotStat
|
||||
super.onLoginStatusUpdate(isLogin)
|
||||
if (!isLogin) {
|
||||
CallerLogger.d(TAG, "onLoginStatusUpdate isLogin=$isLogin")
|
||||
CallerHmiManager.dismissFSMStatusDetailWindow()
|
||||
CallerHmiManager.dismissFSMExceptionStatusWindow()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,10 +15,10 @@ internal class StatusModel : ViewModel() {
|
||||
val DEFAULTS = Pair(null, ArrayList<Status>().also {
|
||||
it += OverViewStatus()
|
||||
it += FSMStatus(FSMStateCode.UnKnown, "")
|
||||
it += RTKStatus("", -1)
|
||||
it += IpcStatus(CallerAutoPilotStatusListenerManager.isConnect())
|
||||
it += CanStatus(false)
|
||||
// it += TracingStatus(UNKNOWN)
|
||||
it += RTKStatus("", -1)
|
||||
// it += NetStatus(false)
|
||||
// it += GpsStatus(enabled = false, isGranted = false)
|
||||
it += SteerStatus(0f)
|
||||
|
||||
@@ -61,7 +61,7 @@ internal class StatusView(private val model: StatusModel, ctx: Context): Constra
|
||||
itx.addItemDecoration(
|
||||
CommonDividerItemDecoration.Builder()
|
||||
.spanCountTBCare(false)
|
||||
.horizontalInnerSpace(10.PX)
|
||||
.horizontalInnerSpace(30.PX)
|
||||
.build()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -9,8 +9,6 @@ import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.R.drawable
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.CanStatus
|
||||
@@ -21,58 +19,53 @@ import com.zhjt.mogo_core_function_devatools.status.entity.IpcStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.OverViewStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.RTKStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.Status
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing.MAP_DATA_EXIST
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing.MAP_DATA_NOT_EXIST
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing.MAP_TRA_TYPE
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing.ROUTE_FAILED
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing.ROUTE_LOADED
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing.TRACK_FINDED
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing.TRACK_LOADED
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing.TRACK_LOAD_FAIL
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing.TRACK_NOT_EXIST
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing.UNKNOWN
|
||||
import com.zhjt.mogo_core_function_devatools.status.ui.adapter.StatusAdapter.StatusViewHolder
|
||||
import me.jessyan.autosize.AutoSizeCompat
|
||||
|
||||
internal class StatusAdapter(val ctx: Context, var data: List<Status>): RecyclerView.Adapter<StatusViewHolder>() {
|
||||
internal class StatusAdapter(val ctx: Context, var data: List<Status>) : RecyclerView.Adapter<StatusViewHolder>() {
|
||||
|
||||
companion object {
|
||||
const val TAG = "StatusAdapter"
|
||||
private const val ITEM_TYPE_NORMAL = 1
|
||||
private const val ITEM_TYPE_OVER_VIEW = 2
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): StatusViewHolder =
|
||||
StatusViewHolder(LayoutInflater.from(ctx).inflate(R.layout.layout_status_bar_item, parent, false))
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): StatusViewHolder {
|
||||
if (viewType == ITEM_TYPE_NORMAL) {
|
||||
return NormalViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.layout_status_bar_item, parent, false))
|
||||
}
|
||||
return OverViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.layout_status_bar_over_item, parent, false))
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: StatusViewHolder, position: Int) {
|
||||
AutoSizeCompat.autoConvertDensityOfGlobal(holder.itemView.resources)
|
||||
holder.bind(data[position])
|
||||
}
|
||||
|
||||
override fun getItemViewType(position: Int): Int {
|
||||
if (position < 0 || position >= data.size) {
|
||||
return super.getItemViewType(position)
|
||||
}
|
||||
val status = data[position]
|
||||
if (status is OverViewStatus) {
|
||||
return ITEM_TYPE_OVER_VIEW
|
||||
}
|
||||
return ITEM_TYPE_NORMAL
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = data.size
|
||||
|
||||
internal class StatusViewHolder(item: View) : RecyclerView.ViewHolder(item) {
|
||||
internal abstract class StatusViewHolder(item: View) : RecyclerView.ViewHolder(item) {
|
||||
abstract fun bind(status: Status)
|
||||
}
|
||||
|
||||
internal class NormalViewHolder(item: View) : StatusViewHolder(item) {
|
||||
|
||||
private val iv: ImageView by lazy {
|
||||
itemView.findViewById(R.id.iv)
|
||||
}
|
||||
|
||||
fun bind(status: Status) {
|
||||
if (status !is OverViewStatus) {
|
||||
itemView.setOnClickListener(null)
|
||||
itemView.isClickable = false
|
||||
if (iv.drawable != null) {
|
||||
iv.setImageDrawable(null)
|
||||
}
|
||||
} else {
|
||||
if (iv.background != null) {
|
||||
iv.background = null
|
||||
}
|
||||
itemView.onClick {
|
||||
CallerHmiManager.showStatusSummaryDialog()
|
||||
}
|
||||
}
|
||||
when(status) {
|
||||
override fun bind(status: Status) {
|
||||
when (status) {
|
||||
is IpcStatus -> {
|
||||
if (status.enabled) {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_ipc_enable)
|
||||
@@ -80,6 +73,7 @@ internal class StatusAdapter(val ctx: Context, var data: List<Status>): Recycler
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_ipc_disable)
|
||||
}
|
||||
}
|
||||
|
||||
is CanStatus -> {
|
||||
if (status.enabled) {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_can_enable)
|
||||
@@ -87,152 +81,96 @@ internal class StatusAdapter(val ctx: Context, var data: List<Status>): Recycler
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_can_disable)
|
||||
}
|
||||
}
|
||||
// is NetStatus -> {
|
||||
// if (status.enabled) {
|
||||
// iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_net_enable)
|
||||
|
||||
// is GpsStatus -> {
|
||||
// if (status.enabled && status.isGranted) {
|
||||
// iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_gps_enable)
|
||||
// } else {
|
||||
// iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_net_disable)
|
||||
// iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_gps_disable)
|
||||
// }
|
||||
// }
|
||||
is GpsStatus -> {
|
||||
if (status.enabled && status.isGranted) {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_gps_enable)
|
||||
} else {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_gps_disable)
|
||||
}
|
||||
}
|
||||
is TracingStatus -> {
|
||||
when(status.state) {
|
||||
MAP_DATA_NOT_EXIST, MAP_DATA_EXIST, MAP_TRA_TYPE, ROUTE_FAILED, TRACK_LOAD_FAIL, TRACK_NOT_EXIST, TRACK_FINDED, UNKNOWN -> {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_trace_unkown)
|
||||
}
|
||||
TRACK_LOADED -> {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_track_enable)
|
||||
}
|
||||
ROUTE_LOADED -> {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_route_enable)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// is TracingStatus -> {
|
||||
// when (status.state) {
|
||||
// MAP_DATA_NOT_EXIST, MAP_DATA_EXIST, MAP_TRA_TYPE, ROUTE_FAILED, TRACK_LOAD_FAIL, TRACK_NOT_EXIST, TRACK_FINDED, UNKNOWN -> {
|
||||
// iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_trace_unkown)
|
||||
// }
|
||||
//
|
||||
// TRACK_LOADED -> {
|
||||
// iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_track_enable)
|
||||
// }
|
||||
//
|
||||
// ROUTE_LOADED -> {
|
||||
// iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_route_enable)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
is RTKStatus -> {
|
||||
when(status.desc) {
|
||||
"RTK" ->
|
||||
when(status.state) {
|
||||
0 -> iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_rtk_good)
|
||||
1 -> iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_rtk_not_credible)
|
||||
2 -> iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_rtk_inaccurate)
|
||||
else -> iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_rtk_error)
|
||||
}
|
||||
"SLAM" ->
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_slam_good)
|
||||
"VSLAM" ->
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_vslam_good)
|
||||
"VAL" ->
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_val_good)
|
||||
else ->
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_rtk_unknow)
|
||||
when (status.desc) {
|
||||
"RTK" -> when (status.state) {
|
||||
0 -> iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_rtk_good)
|
||||
1 -> iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_rtk_not_credible)
|
||||
2 -> iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_rtk_inaccurate)
|
||||
else -> iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_rtk_error)
|
||||
}
|
||||
|
||||
"SLAM" -> iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_slam_good)
|
||||
"VSLAM" -> iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_vslam_good)
|
||||
"VAL" -> iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_val_good)
|
||||
else -> iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_rtk_unknow)
|
||||
}
|
||||
}
|
||||
|
||||
is FSMStatus -> {
|
||||
when (status.state) {
|
||||
FSMStateCode.UnKnown -> {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_fsm_not_connected)
|
||||
CallerHmiManager.dismissFSMStatusDetailWindow()
|
||||
CallerHmiManager.dismissFSMExceptionStatusWindow()
|
||||
}
|
||||
|
||||
FSMStateCode.NotExist -> {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_fsm_not_exist)
|
||||
CallerHmiManager.dismissFSMStatusDetailWindow()
|
||||
CallerHmiManager.dismissFSMExceptionStatusWindow()
|
||||
}
|
||||
|
||||
FSMStateCode.ExistNormal -> {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_fsm_normal)
|
||||
CallerHmiManager.dismissFSMStatusDetailWindow()
|
||||
CallerHmiManager.dismissFSMExceptionStatusWindow()
|
||||
}
|
||||
|
||||
FSMStateCode.ExistError -> {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_fsm_error)
|
||||
CallerHmiManager.showFSMStatusDetailWindow("FSM异常:", "#FF3B3B", status.desc)
|
||||
CallerHmiManager.showFSMExceptionStatusWindow(ArrayList<String>().also {
|
||||
it += status.desc
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
is OverViewStatus -> {
|
||||
if (status.hasException) {
|
||||
iv.scaleType = ImageView.ScaleType.FIT_CENTER
|
||||
iv.setImageResource(drawable.icon_red_warning)
|
||||
} else {
|
||||
iv.scaleType = ImageView.ScaleType.FIT_CENTER
|
||||
iv.setImageResource(drawable.icon_grey_warning)
|
||||
}
|
||||
}
|
||||
|
||||
else -> throw IllegalStateException()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class OverViewHolder(item: View) : StatusViewHolder(item) {
|
||||
|
||||
private val iv: ImageView by lazy {
|
||||
itemView.findViewById(R.id.iv)
|
||||
}
|
||||
|
||||
init {
|
||||
itemView.onClick {
|
||||
CallerHmiManager.showStatusSummaryDialog()
|
||||
}
|
||||
}
|
||||
|
||||
private fun getText(status: Status): String = when (status) {
|
||||
is CanStatus -> "CAN:${if (status.enabled) "状态正常" else "非正常连接"}"
|
||||
is GpsStatus -> "GPS:${if (status.enabled) "状态正常" else "非正常连接"}"
|
||||
is IpcStatus -> "工控机:${if (status.enabled) "状态正常" else "非正常连接"}"
|
||||
// is NetStatus -> "WIFI:${ if (status.enabled) "${status.name}" else "非正常连接" }"
|
||||
is RTKStatus -> when (status.desc) {
|
||||
"RTK" ->
|
||||
when (status.state) {
|
||||
0 -> "RTK定位,状态良好"
|
||||
1 -> "RTK定位,定位不可信"
|
||||
2 -> "RTK定位,误差增大到米级"
|
||||
else -> "RTK定位,状态异常"
|
||||
}
|
||||
|
||||
"SLAM" ->
|
||||
"SLAM定位,状态良好"
|
||||
|
||||
else ->
|
||||
"定位异常"
|
||||
}
|
||||
|
||||
is FSMStatus -> when (status.state) {
|
||||
FSMStateCode.UnKnown -> {
|
||||
"FSM:未知"
|
||||
}
|
||||
FSMStateCode.NotExist -> {
|
||||
"FSM:无FSM模块"
|
||||
}
|
||||
FSMStateCode.ExistNormal -> {
|
||||
"FSM:状态正常"
|
||||
}
|
||||
FSMStateCode.ExistError -> {
|
||||
"FSM:状态异常"
|
||||
}
|
||||
}
|
||||
|
||||
is TracingStatus -> {
|
||||
val extra = status.state.extra
|
||||
val extraDesc =
|
||||
if (extra != null && extra.isNotEmpty()) extra.values.joinToString(",") else ""
|
||||
CallerLogger.d(
|
||||
"$M_DEVA$TAG",
|
||||
"traceing_state: $status -> extra: $extraDesc :: extra: $extra"
|
||||
)
|
||||
when (status.state) {
|
||||
//"轨迹类型:${ if (status.state == TRACK_LOADED) "循迹" else if (status.state == ROUTE_LOADED) "自主算路" else "暂无轨迹" }"
|
||||
MAP_TRA_TYPE -> {
|
||||
"暂无轨迹"
|
||||
}
|
||||
|
||||
MAP_DATA_EXIST -> "地图数据存在,正在加载${if (extraDesc.isNotEmpty()) "\n[$extraDesc]" else ""}"
|
||||
MAP_DATA_NOT_EXIST -> "地图数据不存在${if (extraDesc.isNotEmpty()) "\n[$extraDesc]" else ""}"
|
||||
TRACK_FINDED -> "轨迹类型:循迹(已找到轨迹)${if (extraDesc.isNotEmpty()) "\n[$extraDesc]" else ""}"
|
||||
TRACK_LOADED -> "轨迹类型:循迹(加载成功)${if (extraDesc.isNotEmpty()) "\n[$extraDesc]" else ""}"
|
||||
TRACK_NOT_EXIST -> "轨迹类型:循迹(未找到轨迹)${if (extraDesc.isNotEmpty()) "\n[$extraDesc]" else ""}"
|
||||
TRACK_LOAD_FAIL -> "轨迹类型:循迹(加载失败)${if (extraDesc.isNotEmpty()) "\n[$extraDesc]" else ""}"
|
||||
ROUTE_LOADED -> "轨迹类型:自主算路(加载成功)${if (extraDesc.isNotEmpty()) "\n[$extraDesc]" else ""}"
|
||||
ROUTE_FAILED -> "轨迹类型:自主算路(加载失败)${if (extraDesc.isNotEmpty()) "\n[$extraDesc]" else ""}"
|
||||
UNKNOWN -> "暂无轨迹"
|
||||
}
|
||||
}
|
||||
|
||||
is OverViewStatus -> {
|
||||
""
|
||||
}
|
||||
|
||||
else -> {
|
||||
throw AssertionError()
|
||||
override fun bind(status: Status) {
|
||||
val over = status as OverViewStatus
|
||||
if (over.hasException) {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_red_warning)
|
||||
} else {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_grey_warning)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 997 B |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 291 B After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 291 B After Width: | Height: | Size: 1.5 KiB |
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/iv"
|
||||
android:layout_width="@dimen/dp_115"
|
||||
android:layout_width="@dimen/dp_100"
|
||||
android:layout_height="@dimen/dp_46" />
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/iv"
|
||||
android:layout_width="@dimen/dp_51"
|
||||
android:layout_height="@dimen/dp_40" />
|
||||
@@ -9,11 +9,11 @@ import androidx.core.content.ContextCompat
|
||||
import chassis.Chassis
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.zhjt.mogo_core_function_devatools.status.StatusManager
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.AcceleratorStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.BrakeStatus
|
||||
@@ -62,7 +62,7 @@ class StartAutoPilotStatusView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
private val hasFSM by lazy { AtomicBoolean(false) }
|
||||
private val hasFSM by lazy { AtomicBoolean(true) }
|
||||
|
||||
|
||||
init {
|
||||
@@ -71,8 +71,7 @@ class StartAutoPilotStatusView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
// 默认展示 有 FSM 的情况,未知状态
|
||||
changeStatusContainer(true)
|
||||
// 默认展示 FSM 情况未知的状态
|
||||
handleFSM(FSMStatus(FSMStateCode.UnKnown, "未知"))
|
||||
}
|
||||
|
||||
@@ -91,13 +90,14 @@ class StartAutoPilotStatusView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun handleFSM(status: FSMStatus) {
|
||||
Logger.d(TAG, "--- handleFSM ---:${status.isException()}")
|
||||
Logger.d(TAG, "--- handleFSM ---FSMStatus: code=${status.state} isError=${status.isException()} ")
|
||||
val lastHasFSM = hasFSM.get()
|
||||
val newHasFSM = status.hasFSMModule()
|
||||
hasFSM.set(newHasFSM)
|
||||
Logger.d(TAG, "--- handleFSM ---lastHasFSM=${lastHasFSM} newHasFSM=${newHasFSM}")
|
||||
if (lastHasFSM != newHasFSM) {
|
||||
changeStatusContainer(status.hasFSMModule())
|
||||
changeStatusContainer(newHasFSM)
|
||||
}
|
||||
hasFSM.set(newHasFSM)
|
||||
|
||||
when (status.state) {
|
||||
FSMStateCode.UnKnown -> {
|
||||
@@ -131,9 +131,10 @@ class StartAutoPilotStatusView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
FSMStateCode.ExistError -> {
|
||||
// TODO
|
||||
fSMStatusLayout?.onClick {
|
||||
ToastUtils.showLong("onClick")
|
||||
CallerHmiManager.showFSMExceptionStatusWindow(ArrayList<String>().also {
|
||||
it += status.desc
|
||||
})
|
||||
}
|
||||
fSMStatusLayout?.setImageDrawable(
|
||||
ContextCompat.getDrawable(
|
||||
@@ -149,7 +150,7 @@ class StartAutoPilotStatusView @JvmOverloads constructor(
|
||||
private fun handleWithoutFSM(status: Status) {
|
||||
val isError =
|
||||
status.isException() && CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
|
||||
Logger.d(TAG, "--- handleWithoutFSM ---: $isError")
|
||||
Logger.d(TAG, "--- handleWithoutFSM ---${status::class.simpleName}: $isError")
|
||||
when (status) {
|
||||
is GearStatus -> {
|
||||
val position = try {
|
||||
@@ -163,28 +164,28 @@ class StartAutoPilotStatusView @JvmOverloads constructor(
|
||||
|
||||
when (position) {
|
||||
Chassis.GearPosition.GEAR_N -> {
|
||||
tv_gear.isEnabled = isError
|
||||
tv_gear.text = "N"
|
||||
tv_gear?.isEnabled = isError
|
||||
tv_gear?.text = "N"
|
||||
}
|
||||
|
||||
Chassis.GearPosition.GEAR_R -> {
|
||||
tv_gear.isEnabled = isError
|
||||
tv_gear.text = "R"
|
||||
tv_gear?.isEnabled = isError
|
||||
tv_gear?.text = "R"
|
||||
}
|
||||
|
||||
Chassis.GearPosition.GEAR_P -> {
|
||||
tv_gear.isEnabled = isError
|
||||
tv_gear.text = "P"
|
||||
tv_gear?.isEnabled = isError
|
||||
tv_gear?.text = "P"
|
||||
}
|
||||
|
||||
Chassis.GearPosition.GEAR_D -> {
|
||||
tv_gear.isEnabled = isError
|
||||
tv_gear.text = "D"
|
||||
tv_gear?.isEnabled = isError
|
||||
tv_gear?.text = "D"
|
||||
}
|
||||
|
||||
Chassis.GearPosition.GEAR_NONE -> {
|
||||
tv_gear.isEnabled = false
|
||||
tv_gear.text = ""
|
||||
tv_gear?.isEnabled = false
|
||||
tv_gear?.text = ""
|
||||
}
|
||||
|
||||
else -> {}
|
||||
@@ -207,18 +208,22 @@ class StartAutoPilotStatusView @JvmOverloads constructor(
|
||||
iv_steer?.isSelected = isError
|
||||
}
|
||||
|
||||
is SpeedStatus -> {
|
||||
// TODO
|
||||
}
|
||||
|
||||
else -> {
|
||||
Logger.d(TAG, "other state: $status")
|
||||
}
|
||||
}
|
||||
notifyStatus(isError)
|
||||
val isAnyOneError = tv_gear?.isEnabled == true || iv_accelerator?.isSelected == true || iv_brake?.isSelected == true || iv_double_flash?.isSelected == true || iv_steer?.isSelected == true
|
||||
withoutFSMStatusLayout?.background =
|
||||
ContextCompat.getDrawable(
|
||||
context,
|
||||
if (isAnyOneError) R.drawable.icon_no_fsm_status_bg_error
|
||||
else R.drawable.icon_no_fsm_status_bg_normal
|
||||
)
|
||||
notifyStatus(isAnyOneError)
|
||||
}
|
||||
|
||||
private fun notifyStatus(isError: Boolean) {
|
||||
Logger.d(TAG, "--- notifyStatus ---: $isError")
|
||||
statusChangedListeners.values.forEach { itx ->
|
||||
if (isError) {
|
||||
itx.onStatusError()
|
||||
@@ -245,11 +250,16 @@ class StartAutoPilotStatusView @JvmOverloads constructor(
|
||||
*/
|
||||
override fun onStatusChanged(changed: List<Status>, all: List<Status>) {
|
||||
changed.filter { it is IAutopilotPreLaunchStatus }.forEach { status ->
|
||||
Logger.d(TAG, "onStatusChanged --> ${status::class.simpleName}")
|
||||
when (status) {
|
||||
is FSMStatus -> {
|
||||
handleFSM(status)
|
||||
}
|
||||
|
||||
is SpeedStatus -> {
|
||||
// TODO
|
||||
}
|
||||
|
||||
else -> {
|
||||
handleWithoutFSM(status)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
package com.mogo.eagle.core.function.hmi.bone.status.fsm
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.ScrollView
|
||||
import android.widget.TextView
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.zhjt.mogo_core_function_devatools.status.StatusManager
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.FSMStateCode
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.FSMStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.Status
|
||||
|
||||
/**
|
||||
* FSM状态展示 View
|
||||
*/
|
||||
class FSMStatusDetailView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : FrameLayout(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
), StatusManager.IStatusListener {
|
||||
companion object {
|
||||
private const val TAG = "FSMStatusDetailView"
|
||||
}
|
||||
|
||||
private var tvTitle: TextView? = null
|
||||
private var scrollLayout: ScrollView? = null
|
||||
private var llFsmMsgContainerLayout: LinearLayout? = null
|
||||
private var tvCloseBtn: TextView? = null
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_status_fsm_layout, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
tvTitle = findViewById(R.id.tvTitle)
|
||||
scrollLayout = findViewById(R.id.scrollLayout)
|
||||
llFsmMsgContainerLayout = findViewById(R.id.fsmMsgContainerLayout)
|
||||
tvCloseBtn = findViewById(R.id.btnClose)
|
||||
tvCloseBtn?.onClick {
|
||||
FSMStatusDetailWindowManager.fsmStatusDetailWindowManager.dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
fun setFsmErrorStatus(msgArray: ArrayList<String>) {
|
||||
tvTitle?.text = "FSM异常"
|
||||
runCatching {
|
||||
val c = Color.parseColor("#FF4E41")
|
||||
tvTitle?.setTextColor(c)
|
||||
}
|
||||
addFsmMsgItemView(msgArray)
|
||||
|
||||
//监听最新 FSM 状态
|
||||
StatusManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
private fun setFsmNormalStatus() {
|
||||
tvTitle?.text = "FSM正常"
|
||||
runCatching {
|
||||
val c = Color.parseColor("#2EACFF")
|
||||
tvTitle?.setTextColor(c)
|
||||
}
|
||||
removeFsmMsgItemView()
|
||||
}
|
||||
|
||||
private fun setFsmUnknownStatus() {
|
||||
tvTitle?.text = "FSM状态未知"
|
||||
runCatching {
|
||||
val c = Color.parseColor("#FFFFFF")
|
||||
tvTitle?.setTextColor(c)
|
||||
}
|
||||
removeFsmMsgItemView()
|
||||
}
|
||||
|
||||
private fun setFsmNotExistStatus() {
|
||||
tvTitle?.text = "FSM不存在"
|
||||
runCatching {
|
||||
val c = Color.parseColor("#FFFFFF")
|
||||
tvTitle?.setTextColor(c)
|
||||
}
|
||||
removeFsmMsgItemView()
|
||||
}
|
||||
|
||||
private fun addFsmMsgItemView(msgArray: ArrayList<String>) {
|
||||
if (llFsmMsgContainerLayout == null) {
|
||||
Logger.e(TAG, "addFsmMsmItemView llFsmMsgContainerLayout is null")
|
||||
return
|
||||
}
|
||||
scrollLayout?.visibility = View.VISIBLE
|
||||
llFsmMsgContainerLayout?.removeAllViews()
|
||||
msgArray.forEach {
|
||||
val itemView: View = LayoutInflater.from(context)
|
||||
.inflate(R.layout.view_status_fsm_item_layout, llFsmMsgContainerLayout, false)
|
||||
val leftImageView: ImageView = itemView.findViewById(R.id.leftImageView)
|
||||
val rightTextView: TextView = itemView.findViewById(R.id.rightTextView)
|
||||
rightTextView.text = it
|
||||
llFsmMsgContainerLayout?.addView(itemView)
|
||||
}
|
||||
}
|
||||
|
||||
private fun removeFsmMsgItemView() {
|
||||
llFsmMsgContainerLayout?.removeAllViews()
|
||||
//scrollLayout?.visibility = View.GONE
|
||||
}
|
||||
|
||||
/**
|
||||
* @param changed: 变化的数据
|
||||
* @param all: 所有状态数据
|
||||
*/
|
||||
override fun onStatusChanged(changed: List<Status>, all: List<Status>) {
|
||||
changed.filterIsInstance<FSMStatus>().forEach { status ->
|
||||
when (status) {
|
||||
is FSMStatus -> {
|
||||
handleFSMStatus(status)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleFSMStatus(status: FSMStatus) {
|
||||
when (status.state) {
|
||||
FSMStateCode.NotExist -> {
|
||||
setFsmNotExistStatus()
|
||||
}
|
||||
|
||||
FSMStateCode.UnKnown -> {
|
||||
setFsmUnknownStatus()
|
||||
}
|
||||
|
||||
FSMStateCode.ExistNormal -> {
|
||||
setFsmNormalStatus()
|
||||
}
|
||||
|
||||
FSMStateCode.ExistError -> {
|
||||
// TODO 修改成多条
|
||||
setFsmErrorStatus(ArrayList<String>().also {
|
||||
it += status.desc
|
||||
it += status.desc
|
||||
it += status.desc
|
||||
it += status.desc
|
||||
it += status.desc
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
StatusManager.removeListener(TAG)
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
package com.mogo.eagle.core.function.hmi.bone.status.fsm
|
||||
|
||||
import android.animation.Animator
|
||||
import android.content.Context
|
||||
@@ -9,7 +9,6 @@ import android.view.animation.OvershootInterpolator
|
||||
import com.mogo.eagle.core.data.enums.SidePattern
|
||||
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
|
||||
import com.mogo.eagle.core.function.hmi.notification.anim.DefaultAnimator
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
/**
|
||||
* FSM 状态弹框管理类
|
||||
@@ -25,33 +24,29 @@ class FSMStatusDetailWindowManager private constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
fun show(
|
||||
context: Context, title: String, titleColor: String, content: String
|
||||
fun showExceptionStatus(
|
||||
context: Context, errorMsg: ArrayList<String>
|
||||
) {
|
||||
if (mFSMStatusDetailView == null) {
|
||||
mFSMStatusDetailView = FSMStatusDetailView(context)
|
||||
}
|
||||
if (mFSMStatusViewFloat?.isShow() == true) {
|
||||
mFSMStatusDetailView?.apply {
|
||||
setFsmMsg(title, titleColor, content)
|
||||
setFsmErrorStatus(errorMsg)
|
||||
}
|
||||
} else {
|
||||
mFSMStatusDetailView?.apply {
|
||||
setFsmMsg(title, titleColor, content)
|
||||
setFsmErrorStatus(errorMsg)
|
||||
}
|
||||
mFSMStatusViewFloat = WarningFloat.with(context)
|
||||
.setTag("FSMStatusView")
|
||||
.setLayout(mFSMStatusDetailView!!)
|
||||
.setSidePattern(SidePattern.RIGHT)
|
||||
.setGravity(
|
||||
Gravity.RIGHT,
|
||||
offsetY = AutoSizeUtils.dp2px(context, 112f),
|
||||
offsetX = AutoSizeUtils.dp2px(context, (214f) * -1L)
|
||||
)
|
||||
.setSidePattern(SidePattern.AUTO_SIDE)
|
||||
.setGravity(Gravity.CENTER)
|
||||
.setImmersionStatusBar(false)
|
||||
.slideDel(false)
|
||||
.setWindowHeight(WindowManager.LayoutParams.WRAP_CONTENT)
|
||||
.setWindowWidth(AutoSizeUtils.dp2px(context, 538f))
|
||||
.setWindowWidth(WindowManager.LayoutParams.WRAP_CONTENT)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
@@ -35,7 +35,7 @@ import com.mogo.eagle.core.function.hmi.ui.notice.DispatchDialogManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeCheckDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.traffic.NoticeTrafficDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.CameraLiveView.Companion.cameraLiveView
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.FSMStatusDetailWindowManager
|
||||
import com.mogo.eagle.core.function.hmi.bone.status.fsm.FSMStatusDetailWindowManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.StatusView
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToolsView.Companion.toolsView
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.AdUpgradeDialog
|
||||
@@ -340,16 +340,16 @@ class MoGoHmiProvider : IMoGoHmiProvider {
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示 FSM 状态详情弹框
|
||||
* 展示 FSM 异常状态弹框
|
||||
*/
|
||||
override fun showFSMStatusDetailWindow(title: String, titleColor:String, content: String) {
|
||||
context?.let { FSMStatusDetailWindowManager.fsmStatusDetailWindowManager.show(it, title, titleColor, content)}
|
||||
override fun showFSMExceptionStatusWindow(errorMsg: ArrayList<String>) {
|
||||
context?.let { FSMStatusDetailWindowManager.fsmStatusDetailWindowManager.showExceptionStatus(it, errorMsg)}
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭 FSM 状态详情弹框
|
||||
* 关闭 FSM 异常状态弹框
|
||||
*/
|
||||
override fun dismissFSMStatusDetailWindow() {
|
||||
override fun dismissFSMExceptionStatusWindow() {
|
||||
context?.let { FSMStatusDetailWindowManager.fsmStatusDetailWindowManager.dismiss()}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.text.method.ScrollingMovementMethod
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.TextView
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
|
||||
/**
|
||||
* FSM状态展示 View
|
||||
*/
|
||||
class FSMStatusDetailView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : FrameLayout(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
) {
|
||||
companion object {
|
||||
private const val TAG = "FSMStatusView"
|
||||
}
|
||||
|
||||
private var tvTitle: TextView? = null
|
||||
private var tvContent: TextView? = null
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_status_fsm_layout, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
tvTitle = findViewById(R.id.tvTitle)
|
||||
tvContent = findViewById(R.id.tvContent)
|
||||
tvContent?.movementMethod = ScrollingMovementMethod.getInstance()
|
||||
}
|
||||
|
||||
fun setFsmMsg(title: String, titleColor: String , content: String) {
|
||||
tvTitle?.text = title
|
||||
tvContent?.text = content
|
||||
runCatching {
|
||||
val c = Color.parseColor(titleColor)
|
||||
tvTitle?.setTextColor(c)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import android.os.BatteryManager
|
||||
import android.os.Handler
|
||||
import android.os.Message
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
@@ -78,8 +79,8 @@ class BatteryGroupView : LinearLayout, IMoGoSkinModeChangeListener {
|
||||
if (isCharging) {
|
||||
it.ivBatteryCharge.visibility = View.VISIBLE
|
||||
when(it.mSkinMode){
|
||||
0 -> it.ivBatteryCharge.setImageResource(R.drawable.battery_charge_dark)
|
||||
1 -> it.ivBatteryCharge.setImageResource(R.drawable.battery_charge_light)
|
||||
0 -> it.ivBatteryCharge.setImageResource(R.drawable.battery_charge_light)
|
||||
1 -> it.ivBatteryCharge.setImageResource(R.drawable.battery_charge_dark)
|
||||
}
|
||||
} else {
|
||||
it.ivBatteryCharge.visibility = View.GONE
|
||||
|
||||
@@ -24,7 +24,7 @@ class DemoModeView @JvmOverloads constructor(
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_demo_mode, this, true)
|
||||
background = this.context.getDrawable(R.drawable.demo_mode)
|
||||
background = this.context.getDrawable(R.drawable.icon_status_demo_close)
|
||||
setOnClickListener {
|
||||
HmiActionLog.hmiAction("SOP 演示模式开关", !FunctionBuildConfig.isDemoMode)
|
||||
FunctionBuildConfig.isDemoMode = !FunctionBuildConfig.isDemoMode
|
||||
@@ -50,9 +50,9 @@ class DemoModeView @JvmOverloads constructor(
|
||||
override fun updateFuncMode(tag: String, boolean: Boolean) {
|
||||
if(tag == FUNC_MODE_DEMO){
|
||||
background = if(FunctionBuildConfig.isDemoMode){
|
||||
this.context.getDrawable(R.drawable.demo_mode_open)
|
||||
this.context.getDrawable(R.drawable.icon_status_demo_open)
|
||||
}else{
|
||||
this.context.getDrawable(R.drawable.demo_mode)
|
||||
this.context.getDrawable(R.drawable.icon_status_demo_close)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ class RainModeView @JvmOverloads constructor(
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_demo_mode, this, true)
|
||||
background = this.context.getDrawable(R.drawable.rain_mode)
|
||||
background = this.context.getDrawable(R.drawable.icon_status_yutian_close)
|
||||
setOnClickListener {
|
||||
HmiActionLog.hmiAction("SOP 雨天模式开关", !FunctionBuildConfig.isRainMode)
|
||||
FunctionBuildConfig.isRainMode = !FunctionBuildConfig.isRainMode
|
||||
@@ -48,9 +48,9 @@ class RainModeView @JvmOverloads constructor(
|
||||
if(tag == FUNC_MODE_RAIN){
|
||||
ThreadUtils.runOnUiThread {
|
||||
background = if(FunctionBuildConfig.isRainMode){
|
||||
this.context.getDrawable(R.drawable.rain_mode_open)
|
||||
this.context.getDrawable(R.drawable.icon_status_yutian_open)
|
||||
}else{
|
||||
this.context.getDrawable(R.drawable.rain_mode)
|
||||
this.context.getDrawable(R.drawable.icon_status_yutian_close)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,13 @@ package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.LinearLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
@@ -21,12 +24,10 @@ import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.kotlin.scope
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import kotlinx.android.synthetic.main.view_status_bar.view.routeDownloadFailMark
|
||||
import kotlinx.android.synthetic.main.view_status_bar.view.routeDownloadStatus
|
||||
import kotlinx.android.synthetic.main.view_status_bar.view.routeDownloadStatusRoot
|
||||
import kotlinx.android.synthetic.main.view_status_bar.view.ll_status_download
|
||||
import kotlinx.android.synthetic.main.view_status_bar.view.route_download_status
|
||||
import kotlinx.android.synthetic.main.view_status_bar.view.status_container
|
||||
import kotlinx.android.synthetic.main.view_status_bar.view.viewProgressTv
|
||||
import kotlinx.android.synthetic.main.view_status_bar.view.viewStatusBarLeft
|
||||
@@ -34,6 +35,7 @@ import kotlinx.android.synthetic.main.view_status_bar.view.viewStatusBarRight
|
||||
import kotlinx.android.synthetic.main.view_status_bar.view.viewTextClock
|
||||
import kotlinx.coroutines.Runnable
|
||||
import kotlinx.coroutines.launch
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
import java.util.concurrent.CopyOnWriteArrayList
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
|
||||
@@ -41,7 +43,7 @@ class StatusBarView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : LinearLayout(context, attrs, defStyleAttr), IMoGoSkinModeChangeListener, IViewControlListener,
|
||||
) : FrameLayout(context, attrs, defStyleAttr), IMoGoSkinModeChangeListener, IViewControlListener,
|
||||
IMoGoAutopilotStatusListener {
|
||||
|
||||
companion object {
|
||||
@@ -49,8 +51,8 @@ class StatusBarView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
init {
|
||||
orientation = HORIZONTAL
|
||||
LayoutInflater.from(context).inflate(R.layout.view_status_bar, this, true)
|
||||
background = ColorDrawable(Color.parseColor("#A6000000")) // 黑色的65%
|
||||
}
|
||||
|
||||
private val rightViewList = CopyOnWriteArrayList<String>()
|
||||
@@ -60,12 +62,6 @@ class StatusBarView @JvmOverloads constructor(
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
post {
|
||||
val params: ViewGroup.LayoutParams = getLayoutParams()
|
||||
params.height = BarUtils.getStatusBarHeight()
|
||||
layoutParams = params
|
||||
}
|
||||
|
||||
//添加view控制
|
||||
CallerHmiViewControlListenerManager.addListener(TAG, this)
|
||||
// 添加换肤监听
|
||||
@@ -76,44 +72,40 @@ class StatusBarView @JvmOverloads constructor(
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
updateStatusBarLeftView(true, FUNC_MODE_DEMO, DemoModeView(this.context))
|
||||
updateStatusBarLeftView(true, FUNC_MODE_RAIN, RainModeView(this.context))
|
||||
routeDownloadStatusRoot?.visibility = View.GONE
|
||||
route_download_status?.visibility = View.GONE
|
||||
CallerDevaToolsManager.registerRouteDownloadListener(TAG) { state ->
|
||||
when (state) {
|
||||
0 -> {
|
||||
routeDownloadStatusRoot?.visibility = View.GONE
|
||||
route_download_status?.visibility = View.GONE
|
||||
}
|
||||
|
||||
1 -> {
|
||||
routeDownloadStatusRoot?.visibility = View.VISIBLE
|
||||
routeDownloadStatus?.background = ContextCompat.getDrawable(
|
||||
route_download_status?.visibility = View.VISIBLE
|
||||
route_download_status?.background = ContextCompat.getDrawable(
|
||||
context,
|
||||
R.drawable.bg_autopilot_route_download_start
|
||||
R.drawable.icon_status_route_download_start
|
||||
)
|
||||
routeDownloadFailMark?.visibility = View.GONE
|
||||
}
|
||||
|
||||
2 -> {
|
||||
routeDownloadStatusRoot?.visibility = View.VISIBLE
|
||||
routeDownloadStatus?.background = ContextCompat.getDrawable(
|
||||
route_download_status?.visibility = View.VISIBLE
|
||||
route_download_status?.background = ContextCompat.getDrawable(
|
||||
context,
|
||||
R.drawable.bg_autopilot_route_download_success
|
||||
R.drawable.icon_status_route_download_complete
|
||||
)
|
||||
routeDownloadFailMark?.visibility = View.GONE
|
||||
UiThreadHandler.postDelayed(Runnable {
|
||||
routeDownloadStatusRoot?.visibility = View.GONE
|
||||
route_download_status?.visibility = View.GONE
|
||||
}, 3000)
|
||||
}
|
||||
|
||||
3 -> {
|
||||
routeDownloadStatusRoot?.visibility = View.VISIBLE
|
||||
routeDownloadStatus?.background = ContextCompat.getDrawable(
|
||||
route_download_status?.visibility = View.VISIBLE
|
||||
route_download_status?.background = ContextCompat.getDrawable(
|
||||
context,
|
||||
R.drawable.bg_autopilot_route_download_failed
|
||||
R.drawable.icon_status_route_download_failed
|
||||
)
|
||||
routeDownloadFailMark?.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -131,12 +123,12 @@ class StatusBarView @JvmOverloads constructor(
|
||||
super.onAutopilotRouteLineId(lineId)
|
||||
if (lineId != this.lineId.get()) {
|
||||
this.lineId.set(lineId)
|
||||
routeDownloadStatusRoot?.scope?.launch {
|
||||
if ((routeDownloadStatusRoot?.visibility == View.VISIBLE) && AppIdentityModeUtils.isDriver(
|
||||
route_download_status?.scope?.launch {
|
||||
if ((route_download_status?.visibility == View.VISIBLE) && AppIdentityModeUtils.isDriver(
|
||||
FunctionBuildConfig.appIdentityMode
|
||||
)
|
||||
) {
|
||||
routeDownloadStatusRoot?.visibility = View.GONE
|
||||
route_download_status?.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -167,8 +159,10 @@ class StatusBarView @JvmOverloads constructor(
|
||||
if (leftViewList.contains(tag)) {
|
||||
return
|
||||
}
|
||||
val params = LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT)
|
||||
params.marginStart = AutoSizeUtils.dp2px(context, 30.0f)
|
||||
viewStatusBarLeft.addView(viewGroup, leftViewList.size, params)
|
||||
leftViewList.add(0, tag)
|
||||
viewStatusBarLeft.addView(viewGroup, 0)
|
||||
} else {
|
||||
leftViewList.forEachIndexed { index, s ->
|
||||
if (s == tag) {
|
||||
@@ -182,10 +176,10 @@ class StatusBarView @JvmOverloads constructor(
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun updateStatusBarDownloadView(insert: Boolean, tag: String, progress: Int) {
|
||||
if (insert) {
|
||||
viewProgressTv.visibility = VISIBLE
|
||||
ll_status_download.visibility = VISIBLE
|
||||
viewProgressTv.text = "$progress%"
|
||||
} else {
|
||||
viewProgressTv.visibility = GONE
|
||||
ll_status_download.visibility = GONE
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.net.wifi.WifiManager
|
||||
import android.os.Handler
|
||||
import android.os.Message
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.util.TypedValue
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -82,11 +83,12 @@ class WifiStateView @JvmOverloads constructor(
|
||||
resources.getDimension(R.dimen.dp_35)
|
||||
)
|
||||
a.recycle()
|
||||
viewStatusBarTag.setTextSize(TypedValue.COMPLEX_UNIT_PX,AutoSizeUtils.dp2px(context,txtSize).toFloat())
|
||||
// viewStatusBarTag.setTextSize(TypedValue.COMPLEX_UNIT_PX,AutoSizeUtils.dp2px(context,txtSize).toFloat())
|
||||
wifiManager =
|
||||
context.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager?
|
||||
wifiHandler = WifiHandler(this)
|
||||
val wifiInfo = wifiManager!!.connectionInfo
|
||||
Log.d(TAG, "wifi-info : $wifiInfo, ssid->: ${wifiInfo.ssid}")
|
||||
wifiName = wifiInfo.ssid.replace("\"","")
|
||||
}
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.9 MiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 2.8 KiB |
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#000000" />
|
||||
<corners android:radius="@dimen/dp_30" />
|
||||
</shape>
|
||||
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 756 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 680 B |
|
Before Width: | Height: | Size: 721 B |
@@ -1,5 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#B3000000" />
|
||||
<corners android:radius="@dimen/dp_30" />
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:endColor="#2E323A"
|
||||
android:startColor="#3B3D44" />
|
||||
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#FFFFFF">
|
||||
<shape>
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:endColor="#6C6C6C"
|
||||
android:startColor="#FFFFFF" />
|
||||
</shape>
|
||||
</stroke>
|
||||
|
||||
<corners android:radius="@dimen/dp_50" />
|
||||
</shape>
|
||||
@@ -3,7 +3,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.BatteryView
|
||||
|
||||
@@ -6,11 +6,9 @@
|
||||
tools:parentTag="android.widget.LinearLayout"
|
||||
tools:orientation="horizontal"
|
||||
tools:background="@color/black">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivMoFangStatus"
|
||||
android:layout_width="@dimen/dp_65"
|
||||
android:layout_height="@dimen/dp_65"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:ignore="ContentDescription" />
|
||||
</merge>
|
||||
@@ -3,22 +3,25 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/bone_bg">
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.bone.BoneTopStatusLayout
|
||||
android:id="@+id/boneTopStatusLayout"
|
||||
android:layout_width="match_parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_19"
|
||||
android:layout_marginTop="@dimen/dp_76"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_19"
|
||||
android:layout_height="wrap_content"/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clBoneBiz"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_385"
|
||||
android:elevation="1dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -27,6 +30,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_385"
|
||||
android:elevation="20dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -10,6 +10,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_59"
|
||||
android:layout_marginStart="@dimen/dp_39"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_fsm_status_bg_normal"
|
||||
android:visibility="visible"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<LinearLayout
|
||||
@@ -20,7 +21,6 @@
|
||||
android:paddingStart="@dimen/dp_34"
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="gone"
|
||||
tools:visibility="gone"
|
||||
tools:background="@drawable/icon_no_fsm_status_bg_error">
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -3,113 +3,115 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_72"
|
||||
tools:parentTag="android.widget.LinearLayout">
|
||||
|
||||
<TextClock
|
||||
android:id="@+id/viewTextClock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_24"
|
||||
android:format12Hour="HH:mm"
|
||||
android:format24Hour="HH:mm"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_2C2E30"
|
||||
android:textSize="@dimen/dp_45"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!--Wifi状态-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.WifiStateView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_54"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_18" />
|
||||
|
||||
<!--魔方连接状态-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.BlueToothView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_8" />
|
||||
tools:background="#A6000000"
|
||||
tools:parentTag="android.widget.FrameLayout">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/viewStatusBarLeft"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="end|center"
|
||||
android:orientation="horizontal"
|
||||
android:showDividers="middle"
|
||||
android:divider="@drawable/bg_divider_empty"
|
||||
android:layout_marginStart="@dimen/dp_8"/>
|
||||
|
||||
<!--app下载进度-->
|
||||
<TextView
|
||||
android:id="@+id/viewProgressTv"
|
||||
android:layout_width="@dimen/dp_96"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/app_download_bg"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:gravity="center"
|
||||
android:drawableLeft="@drawable/icon_download_guide"
|
||||
android:textColor="@color/background_debug"
|
||||
android:textSize="@dimen/dp_20" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/routeDownloadStatusRoot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
tools:background="#2F4266">
|
||||
<View
|
||||
android:id="@+id/routeDownloadStatus"
|
||||
android:layout_width="@dimen/dp_70"
|
||||
android:layout_height="@dimen/dp_10"
|
||||
android:layout_gravity="center_vertical"
|
||||
tools:visibility="visible"
|
||||
tools:background="@drawable/bg_autopilot_route_download_failed"/>
|
||||
<TextView
|
||||
android:id="@+id/routeDownloadFailMark"
|
||||
android:orientation="horizontal">
|
||||
<TextClock
|
||||
android:id="@+id/viewTextClock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:text="!"
|
||||
android:textStyle="bold"
|
||||
tools:visibility="visible"
|
||||
android:visibility="gone"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:textSize="@dimen/dp_28"/>
|
||||
</LinearLayout>
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_61"
|
||||
android:format12Hour="HH:mm"
|
||||
android:format24Hour="HH:mm"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="@dimen/dp_45"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
|
||||
<Space
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="@dimen/dp_1"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/status_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginEnd="@dimen/dp_30"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/viewStatusBarRight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="@dimen/dp_44"
|
||||
android:gravity="end|center"
|
||||
android:orientation="horizontal">
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.BatteryGroupView
|
||||
<!--Wifi状态-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.WifiStateView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_30" />
|
||||
|
||||
<!--魔方连接状态-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.BlueToothView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_30" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/viewStatusBarLeft"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
/>
|
||||
|
||||
<!--app下载进度-->
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_status_download"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="gone"
|
||||
android:layout_marginStart="@dimen/dp_30">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/icon_download_guide"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/viewProgressTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/background_debug"
|
||||
android:textSize="@dimen/dp_30"
|
||||
tools:visibility="visible"
|
||||
tools:text="80%" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/route_download_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_30"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/icon_status_route_download_complete"
|
||||
android:layout_gravity="center_vertical"/>
|
||||
|
||||
<Space
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="@dimen/dp_1"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/status_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginEnd="@dimen/dp_30"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/viewStatusBarRight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_40"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.BatteryGroupView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/icon_status_bar_logo"
|
||||
android:contentDescription="@null"/>
|
||||
</merge>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/leftImageView"
|
||||
android:layout_width="@dimen/dp_18"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_gravity="top"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:src="@drawable/icon_fsm_error_red_arrow" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rightTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:text=""
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/sp_36"
|
||||
tools:text="未收到全局轨迹状态 档位不是D 主车制动未释放 未收到SsmPilotState未收到" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -2,43 +2,66 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="@dimen/dp_538"
|
||||
android:layout_width="@dimen/dp_900"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/status_dialog_fsm_status_background"
|
||||
android:paddingStart="@dimen/dp_30"
|
||||
android:paddingTop="@dimen/dp_20"
|
||||
android:paddingEnd="@dimen/dp_30"
|
||||
android:paddingBottom="@dimen/dp_20"
|
||||
tools:ignore="MissingDefaultResource">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_65"
|
||||
android:layout_marginTop="@dimen/dp_82"
|
||||
android:layout_marginEnd="@dimen/dp_65"
|
||||
android:ellipsize="end"
|
||||
android:gravity="left|center_vertical"
|
||||
android:maxLines="1"
|
||||
android:gravity="center"
|
||||
android:maxLines="2"
|
||||
android:text=""
|
||||
android:textColor="#FF3B3B"
|
||||
android:textSize="@dimen/dp_28"
|
||||
android:textColor="#FF4E41"
|
||||
android:textSize="@dimen/sp_46"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="FSM异常:" />
|
||||
tools:text="FSM异常,无法启动AD" />
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/scrollLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_300"
|
||||
android:layout_marginStart="@dimen/dp_65"
|
||||
android:layout_marginTop="@dimen/dp_61"
|
||||
android:layout_marginEnd="@dimen/dp_65"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTitle"
|
||||
app:layout_goneMarginTop="0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/fsmMsgContainerLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
layout="@layout/view_status_fsm_item_layout"
|
||||
android:visibility="visible" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="left|center_vertical"
|
||||
android:text=""
|
||||
android:maxLines="5"
|
||||
android:scrollbars="vertical"
|
||||
android:textColor="#D5D5D5"
|
||||
android:textSize="@dimen/dp_28"
|
||||
android:id="@+id/btnClose"
|
||||
android:layout_width="@dimen/dp_356"
|
||||
android:layout_height="@dimen/dp_120"
|
||||
android:layout_marginTop="@dimen/dp_61"
|
||||
android:layout_marginBottom="@dimen/dp_65"
|
||||
android:background="@drawable/bg_fsm_status_detail_close"
|
||||
android:gravity="center"
|
||||
android:text="关闭"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/sp_40"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTitle"
|
||||
tools:text="FSM异常,不能启动自驾,刹车干预" />
|
||||
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/scrollLayout" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -2,27 +2,33 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/viewStatusBarTag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_27"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLength="15"
|
||||
android:textColor="@color/color_2C2E30"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:background="#A6000000"
|
||||
tools:layout_height="@dimen/dp_72">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/viewWifiStateBg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@+id/viewStatusBarTag"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="MissingConstraints" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:ignore="MissingConstraints"
|
||||
tools:src="@drawable/wifi_light_state_five" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/viewStatusBarTag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLength="15"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="@dimen/dp_30"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="@dimen/dp_6"
|
||||
app:layout_constraintStart_toEndOf="@+id/viewWifiStateBg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="京888888" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -2,12 +2,12 @@ package com.mogo.eagle.core.function.api.hmi.warning
|
||||
|
||||
import android.view.ViewGroup
|
||||
import com.alibaba.android.arouter.facade.template.IProvider
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.IPCUpgradeStateInfo
|
||||
import com.mogo.eagle.core.data.biz.dispatch.DispatchAdasAutoPilotLocReceiverBean
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.data.map.Infrastructure
|
||||
import com.mogo.eagle.core.data.biz.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.data.biz.notice.NoticeTrafficStylePushData
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.IPCUpgradeStateInfo
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.data.map.Infrastructure
|
||||
import com.mogo.eagle.core.function.api.hmi.xiaozhi.event.Event
|
||||
import com.mogo.eagle.core.function.api.hmi.xiaozhi.listener.OnXiaoZhiStateChangeListener
|
||||
import com.mogo.eagle.core.function.api.hmi.xiaozhi.state.State
|
||||
@@ -158,14 +158,14 @@ interface IMoGoHmiProvider :IProvider{
|
||||
fun is360LookAroundShowing(): Boolean
|
||||
|
||||
/**
|
||||
* 展示 FSM 状态详情弹框
|
||||
* 展示 FSM 异常状态弹框
|
||||
*/
|
||||
fun showFSMStatusDetailWindow(title: String, titleColor:String, content: String)
|
||||
fun showFSMExceptionStatusWindow(errorMsg: ArrayList<String>)
|
||||
|
||||
/**
|
||||
* 关闭 FSM 状态详情弹框
|
||||
* 关闭 FSM 异常状态弹框
|
||||
*/
|
||||
fun dismissFSMStatusDetailWindow()
|
||||
fun dismissFSMExceptionStatusWindow()
|
||||
|
||||
fun showStatusSummaryDialog()
|
||||
|
||||
|
||||
@@ -16,8 +16,6 @@ import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.api.hmi.xiaozhi.event.Event
|
||||
import com.mogo.eagle.core.function.api.hmi.xiaozhi.listener.OnXiaoZhiStateChangeListener
|
||||
import com.mogo.eagle.core.function.api.hmi.xiaozhi.state.State
|
||||
import com.mogo.eagle.core.function.call.order.CallerOrderListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
@@ -236,22 +234,17 @@ object CallerHmiManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示 FSM 状态详情弹框
|
||||
* 展示 FSM 异常状态弹框
|
||||
*/
|
||||
fun showFSMStatusDetailWindow(title: String, titleColor:String, content: String) {
|
||||
// if (!CallerOrderListenerManager.isLoginStatus()) {
|
||||
// CallerLogger.i(TAG, "showFSMStatusDetailWindow isLogin=false dismiss")
|
||||
// dismissFSMStatusDetailWindow()
|
||||
// return
|
||||
// }
|
||||
hmiProviderApi?.showFSMStatusDetailWindow(title, titleColor, content)
|
||||
fun showFSMExceptionStatusWindow(errorMsg: ArrayList<String>) {
|
||||
hmiProviderApi?.showFSMExceptionStatusWindow(errorMsg)
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭 FSM 状态详情弹框
|
||||
* 关闭 FSM 异常状态弹框
|
||||
*/
|
||||
fun dismissFSMStatusDetailWindow() {
|
||||
hmiProviderApi?.dismissFSMStatusDetailWindow()
|
||||
fun dismissFSMExceptionStatusWindow() {
|
||||
hmiProviderApi?.dismissFSMExceptionStatusWindow()
|
||||
}
|
||||
|
||||
fun showStatusSummaryDialog() {
|
||||
|
||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 885 B |
|
After Width: | Height: | Size: 832 B |
|
After Width: | Height: | Size: 911 B |