[2.13.0-arch-opt] merge
This commit is contained in:
@@ -11,10 +11,19 @@ import androidx.lifecycle.LifecycleCoroutineScope
|
||||
import androidx.lifecycle.LifecycleEventObserver
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.RecordBagMsg
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.utilcode.kotlin.lifecycleOwner
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.biz.*
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
@@ -27,7 +36,7 @@ import record_cache.RecordPanelOuterClass
|
||||
import java.lang.ref.WeakReference
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
internal object BadCaseManager : LifecycleEventObserver {
|
||||
internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordListener {
|
||||
|
||||
const val TAG = "BadCase"
|
||||
|
||||
@@ -96,6 +105,8 @@ internal object BadCaseManager : LifecycleEventObserver {
|
||||
* 主动采集BadCase
|
||||
*/
|
||||
fun initBadCase(view: View) {
|
||||
CallerAutopilotRecordListenerManager.addListener(TAG, this)
|
||||
|
||||
val activity = view.context as? FragmentActivity
|
||||
?: throw IllegalStateException("please ensure context is FragmentActivity.")
|
||||
view.setOnClickListener {
|
||||
@@ -193,24 +204,62 @@ internal object BadCaseManager : LifecycleEventObserver {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) {
|
||||
super.onAutopilotRecordResult(recordPanel)
|
||||
CallerLogger.d("$M_DEVA$TAG", "recordKey=${recordPanel.key},stat=${recordPanel.stat}")
|
||||
if (BadCaseConfig.recordKeyList.contains(recordPanel.key)) {
|
||||
if (recordPanel.stat == 100 || recordPanel.stat == 101) {
|
||||
//成功结束录制
|
||||
TipToast.shortTip(
|
||||
"${
|
||||
TimeUtils.millis2String(
|
||||
System.currentTimeMillis(),
|
||||
TimeUtils.getHourMinSecondFormat()
|
||||
)
|
||||
} bag录制成功"
|
||||
)
|
||||
}
|
||||
if (recordPanel.stat == 200) {
|
||||
//录制失败
|
||||
TipToast.shortTip(
|
||||
"${
|
||||
TimeUtils.millis2String(
|
||||
System.currentTimeMillis(),
|
||||
TimeUtils.getHourMinSecondFormat()
|
||||
)
|
||||
} bag录制失败"
|
||||
)
|
||||
}
|
||||
return
|
||||
}
|
||||
//在工控机taxi2.3.0版本和Bus2.4.0版本上不支持被动录包,不进行被动录包的弹窗
|
||||
BadCaseConfig.dockerVersion?.let {
|
||||
if (it.contains("taxi") && it.contains("2.3.0")) {
|
||||
return
|
||||
}
|
||||
if (it.contains("bus") && it.contains("2.4.0")) {
|
||||
return
|
||||
}
|
||||
}
|
||||
//处于非美化模式下弹窗;是地图数据采集任务时即type=2时,不弹窗
|
||||
if (!FunctionBuildConfig.isDemoMode && (recordPanel.stat == 100 || recordPanel.stat == 101) && recordPanel.type != 2) {
|
||||
//只在司机屏生效,乘客屏不生效
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.RECORD, RecordBagMsg(
|
||||
recordPanel.key, recordPanel.stat, recordPanel.id,
|
||||
recordPanel.type, recordPanel.filename, recordPanel.note
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onStateChanged(source: LifecycleOwner, event: Event) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
internal fun RecordPanelOuterClass.RecordPanel.toRecord(): AutoPilotRecord =
|
||||
AutoPilotRecord().also {
|
||||
it.id = this.id
|
||||
it.stat = this.stat
|
||||
it.key = this.key.toString()
|
||||
it.note = this.note
|
||||
it.type = this.type
|
||||
it.total = this.totalSize
|
||||
it.fileName = this.filename
|
||||
it.duration = this.duration.toDouble()
|
||||
it.diskFree = this.diskFree
|
||||
it.consumed = false
|
||||
}
|
||||
@@ -373,6 +373,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
|
||||
override fun onAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) {
|
||||
CallerLogger.d("${M_DEVA}${TAG}", "-- 收到工控机录制任务回调 -- $recordPanel")
|
||||
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (recordKey == null) {
|
||||
recordKey = recordPanel.key.toString()
|
||||
|
||||
@@ -40,6 +40,7 @@ import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.PerspectiveSwitchView_TAG
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.SpeedPanelView_TAG
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.ToolsView_TAG
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.TrafficLightView_TAG
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewLimitingVelocity
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoHmiProvider
|
||||
@@ -99,8 +100,7 @@ import java.util.concurrent.atomic.AtomicReference
|
||||
class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
IMoGoHmiProvider,
|
||||
IMoGoHmiViewProxy,
|
||||
MoGoHmiContract.View,
|
||||
IMoGoAutopilotRecordListener {
|
||||
MoGoHmiContract.View{
|
||||
|
||||
companion object {
|
||||
private const val TAG = "MoGoHmiFragment"
|
||||
@@ -119,29 +119,10 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
private var showingV2XTip: IReminder? = null
|
||||
|
||||
override fun initViews() {
|
||||
initViewShowWithConfig()
|
||||
|
||||
//设置StatusBar初始状态
|
||||
CallerHmiViewControlListenerManager.updateStatusBarRightView(StatusBarView.TAG,FunctionBuildConfig.isDemoMode, "demoMode", DemoModeView(requireContext()))
|
||||
|
||||
ivCameraIcon?.setOnClickListener {
|
||||
cameraLiveView.showCameraList(
|
||||
context,
|
||||
CallerFuncBizManager.bizProvider.getCameraList
|
||||
) { liveStatus ->
|
||||
if (liveStatus) {
|
||||
ivCameraIcon.setBackgroundResource(R.drawable.icon_camera_selected)
|
||||
} else {
|
||||
ivCameraIcon.setBackgroundResource(R.drawable.icon_camera_nor)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
viewShowDebugView.setOnLongClickListener {
|
||||
toggleDebugView.toggle(requireContext())
|
||||
true
|
||||
}
|
||||
|
||||
//todo 新超,封装至消息盒子
|
||||
cbMsgBoxDriver.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (isChecked) {
|
||||
@@ -204,14 +185,10 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
CallerAutopilotRecordListenerManager.addListener(TAG, this)
|
||||
|
||||
// 首次初始化使用默认视图
|
||||
setProxyTrafficLightView(viewTrafficLightVr)
|
||||
//todo 确认使用方 taxi bus 乘客/司机
|
||||
setProxyLimitingSpeedView(viewLimitingVelocity)
|
||||
}
|
||||
|
||||
|
||||
/** todo ----------------------------------------------**/
|
||||
/**
|
||||
* 设置 红绿灯 代理View
|
||||
@@ -227,109 +204,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
mViewLimitingVelocity = view
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据配置文件初始化视图显示
|
||||
*/
|
||||
private fun initViewShowWithConfig() {
|
||||
// 控制 自动驾驶状态 展示
|
||||
if (HmiBuildConfig.isShowAutopilotStatusView) {
|
||||
setAutopilotStatusViewVisibility(View.VISIBLE)
|
||||
} else {
|
||||
setAutopilotStatusViewVisibility(View.GONE)
|
||||
}
|
||||
|
||||
// 控制 切换视角 展示
|
||||
if (HmiBuildConfig.isShowPerspectiveSwitchView) {
|
||||
setPerspectiveSwitchViewVisibility(View.VISIBLE)
|
||||
} else {
|
||||
setPerspectiveSwitchViewVisibility(View.GONE)
|
||||
}
|
||||
|
||||
// 控制 红绿灯 展示
|
||||
if (HmiBuildConfig.isShowTrafficLightView) {
|
||||
setTrafficLightVrVisibility(View.VISIBLE)
|
||||
} else {
|
||||
setTrafficLightVrVisibility(View.GONE)
|
||||
}
|
||||
|
||||
// 控制 远程摄像头图标 展示
|
||||
if (HmiBuildConfig.isShowCameraView) {
|
||||
setCameraViewVisibility(View.VISIBLE)
|
||||
} else {
|
||||
setCameraViewVisibility(View.GONE)
|
||||
}
|
||||
}
|
||||
|
||||
/** todo----------------------------------------------- **/
|
||||
|
||||
override fun onAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) {
|
||||
CallerLogger.d("$M_HMI$TAG", "recordKey=${recordPanel.key},stat=${recordPanel.stat}")
|
||||
if (BadCaseConfig.recordKeyList.contains(recordPanel.key)) { //todo InitiativeBadCaseWindow
|
||||
if (recordPanel.stat == 100 || recordPanel.stat == 101) {
|
||||
//成功结束录制
|
||||
TipToast.shortTip(
|
||||
"${
|
||||
millis2String(
|
||||
System.currentTimeMillis(),
|
||||
TimeUtils.getHourMinSecondFormat()
|
||||
)
|
||||
} bag录制成功"
|
||||
)
|
||||
}
|
||||
if (recordPanel.stat == 200) {
|
||||
//录制失败
|
||||
TipToast.shortTip(
|
||||
"${
|
||||
millis2String(
|
||||
System.currentTimeMillis(),
|
||||
TimeUtils.getHourMinSecondFormat()
|
||||
)
|
||||
} bag录制失败"
|
||||
)
|
||||
}
|
||||
return
|
||||
}
|
||||
//在工控机taxi2.3.0版本和Bus2.4.0版本上不支持被动录包,不进行被动录包的弹窗
|
||||
BadCaseConfig.dockerVersion?.let {
|
||||
if (it.contains("taxi") && it.contains("2.3.0")) {
|
||||
return
|
||||
}
|
||||
if (it.contains("bus") && it.contains("2.4.0")) {
|
||||
return
|
||||
}
|
||||
}
|
||||
//处于非美化模式下弹窗;是地图数据采集任务时即type=2时,不弹窗
|
||||
if (!FunctionBuildConfig.isDemoMode && (recordPanel.stat == 100 || recordPanel.stat == 101) && recordPanel.type != 2) {
|
||||
//只在司机屏生效,乘客屏不生效
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { //todo 数据中心控制来源
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.RECORD, RecordBagMsg(
|
||||
recordPanel.key, recordPanel.stat, recordPanel.id,
|
||||
recordPanel.type, recordPanel.filename, recordPanel.note
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
if (!FunctionBuildConfig.isDemoMode && recordPanel.type == 2 && ( //todo CallerMapDataCollectorManager
|
||||
recordPanel.stat == 101 || //工控机采集完成-被动完成
|
||||
recordPanel.stat == 100 || //工控机采集完成-主动完成
|
||||
recordPanel.stat == 102 || //工控机达到最大采集时长
|
||||
recordPanel.stat == 103) //工控机磁盘满了
|
||||
) {
|
||||
CallerMapDataCollectorManager.finish(
|
||||
recordPanel.id, recordPanel.stat, "", recordPanel.filename
|
||||
?: "", recordPanel.note ?: ""
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
CallerAutopilotRecordListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
/**
|
||||
* ok
|
||||
* 工控机重启返回结果
|
||||
@@ -410,9 +284,8 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
DisplayEffectsHelper.getInstance().display()
|
||||
}
|
||||
|
||||
/** todo----------------------------------------------- **/
|
||||
override fun setTrafficLightVrVisibility(visibility: Int) {
|
||||
mViewTrafficLight?.visibility = visibility
|
||||
CallerHmiViewControlListenerManager.invokeVisible(TrafficLightView_TAG,visibility)
|
||||
}
|
||||
|
||||
override fun setToolsViewVisibility(visibility: Int) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.ToolsView_TAG
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToolsView.Companion.toolsView
|
||||
|
||||
class ToolsImageView(context: Context, attrs: AttributeSet?) :
|
||||
androidx.appcompat.widget.AppCompatImageView(context, attrs), IViewControlListener {
|
||||
@@ -15,6 +16,9 @@ class ToolsImageView(context: Context, attrs: AttributeSet?) :
|
||||
setBackgroundResource(R.drawable.module_ext_check)
|
||||
setImageResource(R.drawable.icon_tools_nor)
|
||||
scaleType = ScaleType.CENTER
|
||||
setOnClickListener{
|
||||
toolsView.showToolsFloat(context)
|
||||
}
|
||||
|
||||
CallerHmiViewControlListenerManager.addListener(ToolsView_TAG, this)
|
||||
}
|
||||
|
||||
@@ -4,8 +4,10 @@ import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.CameraView_TAG
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.CameraLiveView.Companion.cameraLiveView
|
||||
|
||||
class CameraView(context: Context, attrs: AttributeSet?) :
|
||||
androidx.appcompat.widget.AppCompatImageView(context, attrs), IViewControlListener {
|
||||
@@ -13,6 +15,19 @@ class CameraView(context: Context, attrs: AttributeSet?) :
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
setBackgroundResource(R.drawable.icon_camera_nor)
|
||||
setOnClickListener {
|
||||
cameraLiveView.showCameraList(
|
||||
context,
|
||||
CallerFuncBizManager.bizProvider.getCameraList
|
||||
) { liveStatus ->
|
||||
if (liveStatus) {
|
||||
setBackgroundResource(R.drawable.icon_camera_selected)
|
||||
} else {
|
||||
setBackgroundResource(R.drawable.icon_camera_nor)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CallerHmiViewControlListenerManager.addListener(CameraView_TAG, this)
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,10 @@ import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.TrafficLightView_TAG
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
@@ -20,7 +23,7 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
context: Context?,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : IViewTrafficLight(context, attrs, defStyleAttr) {
|
||||
) : IViewTrafficLight(context, attrs, defStyleAttr), IViewControlListener {
|
||||
private var mLightIconIV: ImageView? = null
|
||||
private var mLightIconBG: ImageView? = null
|
||||
private var mLightTimeTV: GradientTextView? = null
|
||||
@@ -28,17 +31,26 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
private var mLightSourceDivider: View? = null
|
||||
private var mCurrentLightId = 0
|
||||
|
||||
init {
|
||||
init(context)
|
||||
}
|
||||
|
||||
private fun init(context: Context?) {
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
LayoutInflater.from(context).inflate(R.layout.hmi_view_traffic_light, this, true)
|
||||
mLightIconIV = findViewById(R.id.hmi_traffic_light_iv)
|
||||
mLightIconBG = findViewById(R.id.hmi_traffic_light_bg)
|
||||
mLightTimeTV = findViewById(R.id.hmi_traffic_light_time_tv)
|
||||
mLightSourceTV = findViewById(R.id.hmi_traffic_light_source)
|
||||
mLightSourceDivider = findViewById(R.id.hmi_traffic_light_divider)
|
||||
|
||||
CallerHmiViewControlListenerManager.addListener(TrafficLightView_TAG, this)
|
||||
}
|
||||
|
||||
override fun visible(v: Int) {
|
||||
super.visible(v)
|
||||
visibility = v
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerHmiViewControlListenerManager.removeListener(TrafficLightView_TAG)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -47,11 +59,11 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
* @param checkLightId 0-都是默认,1-红,2-黄,3-绿
|
||||
* @param lightSource 1:云端下发;2:自车感知
|
||||
*/
|
||||
override fun showWarningTrafficLight(checkLightId: Int,lightSource: Int) {
|
||||
super.showWarningTrafficLight(checkLightId,lightSource)
|
||||
override fun showWarningTrafficLight(checkLightId: Int, lightSource: Int) {
|
||||
super.showWarningTrafficLight(checkLightId, lightSource)
|
||||
mCurrentLightId = checkLightId
|
||||
if(!HmiBuildConfig.isShowTrafficLightView){
|
||||
updateTrafficLightIcon(checkLightId,lightSource)
|
||||
if (!HmiBuildConfig.isShowTrafficLightView) {
|
||||
updateTrafficLightIcon(checkLightId, lightSource)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,24 +82,28 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
super.disableCountdown()
|
||||
UiThreadHandler.post {
|
||||
// 小巴车的司机端需要展示红绿灯信号来源
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||
&& AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)){
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||
&& AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||
) {
|
||||
val lp = this.layoutParams as MarginLayoutParams
|
||||
lp.width = context.resources.getDimension(R.dimen.dp_325).toInt()
|
||||
this.layoutParams = lp
|
||||
mLightSourceTV!!.visibility = VISIBLE
|
||||
mLightSourceDivider!!.visibility = VISIBLE
|
||||
mLightTimeTV!!.visibility = GONE
|
||||
mLightSourceTV!!.setPadding(0,0,75,0)
|
||||
mLightIconBG!!.layoutParams.width = context.resources.getDimension(R.dimen.dp_310).toInt()
|
||||
}else{
|
||||
mLightSourceTV!!.setPadding(0, 0, 75, 0)
|
||||
mLightIconBG!!.layoutParams.width =
|
||||
context.resources.getDimension(R.dimen.dp_310).toInt()
|
||||
} else {
|
||||
val lp = this.layoutParams as MarginLayoutParams
|
||||
lp.width = context.resources.getDimension(R.dimen.hmi_traffic_light_icon_size).toInt()
|
||||
lp.width =
|
||||
context.resources.getDimension(R.dimen.hmi_traffic_light_icon_size).toInt()
|
||||
this.layoutParams = lp
|
||||
mLightTimeTV!!.visibility = GONE
|
||||
mLightSourceDivider!!.visibility = View.GONE
|
||||
mLightSourceTV!!.visibility = View.GONE
|
||||
mLightIconBG!!.layoutParams.width = context.resources.getDimension(R.dimen.dp_124).toInt()
|
||||
mLightIconBG!!.layoutParams.width =
|
||||
context.resources.getDimension(R.dimen.dp_124).toInt()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -176,7 +192,7 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
* @param lightId 0-都是默认,1-红,2-黄,3-绿
|
||||
* @param lightSource 1:云端下发;2:自车感知
|
||||
*/
|
||||
private fun updateTrafficLightIcon(lightId: Int,lightSource: Int) {
|
||||
private fun updateTrafficLightIcon(lightId: Int, lightSource: Int) {
|
||||
UiThreadHandler.post {
|
||||
when (lightId) {
|
||||
1 -> {
|
||||
@@ -193,7 +209,7 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
}
|
||||
else -> this@SingleTrafficLightView.visibility = GONE
|
||||
}
|
||||
when(lightSource){
|
||||
when (lightSource) {
|
||||
1 -> {
|
||||
mLightSourceTV!!.text = "云端下发"
|
||||
}
|
||||
@@ -207,26 +223,31 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
private fun resetView(){
|
||||
private fun resetView() {
|
||||
// 小巴车的司机端需要展示红绿灯信号来源
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||
&& AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)){
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||
&& AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||
) {
|
||||
val lp = this.layoutParams as MarginLayoutParams
|
||||
lp.width = context.resources.getDimension(R.dimen.hmi_traffic_light_bus_layout_width).toInt()
|
||||
lp.width =
|
||||
context.resources.getDimension(R.dimen.hmi_traffic_light_bus_layout_width).toInt()
|
||||
this.layoutParams = lp
|
||||
mLightTimeTV!!.visibility = View.VISIBLE
|
||||
mLightSourceDivider!!.visibility = View.VISIBLE
|
||||
mLightSourceTV!!.visibility = View.VISIBLE
|
||||
mLightSourceTV!!.setPadding(0,0,0,0)
|
||||
mLightIconBG!!.layoutParams.width = context.resources.getDimension(R.dimen.hmi_traffic_light_bus_bg_width).toInt()
|
||||
}else{
|
||||
mLightSourceTV!!.setPadding(0, 0, 0, 0)
|
||||
mLightIconBG!!.layoutParams.width =
|
||||
context.resources.getDimension(R.dimen.hmi_traffic_light_bus_bg_width).toInt()
|
||||
} else {
|
||||
val lp = this.layoutParams as MarginLayoutParams
|
||||
lp.width = context.resources.getDimension(R.dimen.hmi_traffic_light_layout_width).toInt()
|
||||
lp.width =
|
||||
context.resources.getDimension(R.dimen.hmi_traffic_light_layout_width).toInt()
|
||||
this.layoutParams = lp
|
||||
mLightTimeTV!!.visibility = View.VISIBLE
|
||||
mLightSourceDivider!!.visibility = View.GONE
|
||||
mLightSourceTV!!.visibility = View.GONE
|
||||
mLightIconBG!!.layoutParams.width = context.resources.getDimension(R.dimen.hmi_traffic_light_bg_width).toInt()
|
||||
mLightIconBG!!.layoutParams.width =
|
||||
context.resources.getDimension(R.dimen.hmi_traffic_light_bg_width).toInt()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,14 +6,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<View
|
||||
android:id="@+id/viewShowDebugView"
|
||||
android:layout_width="@dimen/dp_400"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!--V2X预警红色边框-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
|
||||
android:id="@+id/flV2XWarningView"
|
||||
@@ -47,27 +39,6 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--超视距-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.CameraView
|
||||
android:id="@+id/ivCameraIcon"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginTop="45dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
app:layout_constraintRight_toLeftOf="@id/viewTrafficLightVr"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!--红绿灯-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
|
||||
android:id="@+id/viewTrafficLightVr"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/hmi_traffic_light_layout_margin_top"
|
||||
android:layout_marginEnd="@dimen/hmi_traffic_light_layout_margin_right"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--地图视角切换-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.PerspectiveSwitchView
|
||||
android:id="@+id/viewPerspectiveSwitch"
|
||||
@@ -104,10 +75,12 @@
|
||||
android:textSize="60dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_goneMarginEnd="40dp"
|
||||
app:layout_goneMarginTop="40dp"
|
||||
tools:visibility="gone" />
|
||||
<!-- todo 需要放入使用方 -->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"-->
|
||||
|
||||
<!--限速来源-->
|
||||
<TextView
|
||||
@@ -133,9 +106,11 @@
|
||||
android:layout_marginEnd="25dp"
|
||||
android:background="@drawable/selector_msg_box"
|
||||
android:button="@null"
|
||||
android:visibility="visible"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon" />
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
<!-- todo 需要放入使用方 , view先gone掉方便重组 -->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon" />-->
|
||||
|
||||
<!--司机端消息提示-->
|
||||
<View
|
||||
|
||||
@@ -6,22 +6,28 @@ import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.cloud.passport.IMoGoTokenCallback
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
||||
import com.zhidaoauto.map.operational.open.GatherApi
|
||||
import com.zhidaoauto.map.operational.open.GatherParams
|
||||
import com.zhidaoauto.map.operational.open.abs.OnTaskListener
|
||||
import record_cache.RecordPanelOuterClass
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.concurrent.CopyOnWriteArrayList
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
|
||||
@Route(path = MogoServicePaths.PATH_MAP_DATA_COLLECT_PROVIDER)
|
||||
class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener, IMoGoMapLocationListener, IMoGoTokenCallback {
|
||||
class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener, IMoGoMapLocationListener, IMoGoTokenCallback,
|
||||
IMoGoAutopilotRecordListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "MoGoMapDataCollect"
|
||||
@@ -39,13 +45,16 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
|
||||
ConcurrentHashMap()
|
||||
}
|
||||
|
||||
override val functionName: String = "$M_MAP$TAG"
|
||||
override val functionName: String = TAG
|
||||
|
||||
@Volatile
|
||||
private var hasInit = false
|
||||
|
||||
override fun init(context: Context?) {
|
||||
CallerMapLocationListenerManager.addListener(functionName, this, false)
|
||||
|
||||
CallerMapLocationListenerManager.addListener(TAG, this, false)
|
||||
CallerAutopilotRecordListenerManager.addListener(TAG, this)
|
||||
|
||||
executor.set(context?.let {
|
||||
GatherApi.also { itx ->
|
||||
itx.init(it,
|
||||
@@ -64,13 +73,27 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
CallerMapLocationListenerManager.removeListener("$M_MAP$TAG", false)
|
||||
CallerLogger.d("$M_MAP$TAG", "--------- onDestroy --------")
|
||||
CallerMapLocationListenerManager.removeListener(TAG, false)
|
||||
CallerAutopilotRecordListenerManager.removeListener(TAG)
|
||||
executor.get()?.setOnTaskListener(null)
|
||||
listeners.clear()
|
||||
map.clear()
|
||||
}
|
||||
|
||||
override fun onAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) {
|
||||
super.onAutopilotRecordResult(recordPanel)
|
||||
CallerLogger.d("$M_MAP$TAG", "recordKey=${recordPanel.key},stat=${recordPanel.stat}")
|
||||
if (!FunctionBuildConfig.isDemoMode && recordPanel.type == 2 && (
|
||||
recordPanel.stat == 101 || //工控机采集完成-被动完成
|
||||
recordPanel.stat == 100 || //工控机采集完成-主动完成
|
||||
recordPanel.stat == 102 || //工控机达到最大采集时长
|
||||
recordPanel.stat == 103) //工控机磁盘满了
|
||||
) {
|
||||
finish(recordPanel.id, recordPanel.stat, "", recordPanel.filename ?: "", recordPanel.note ?: "")
|
||||
}
|
||||
}
|
||||
|
||||
override fun registerOnMapCollectTaskListener(listener: IMoGoMapDataCollectProvider.OnMapCollectCmdListener?) {
|
||||
CallerLogger.d("$M_MAP$TAG", "--------- registerOnMapCollectTaskListener --------")
|
||||
listener ?: return
|
||||
|
||||
Reference in New Issue
Block a user