fix the logger add add func of vip check and take over
This commit is contained in:
@@ -33,7 +33,6 @@ import com.mogo.eagle.core.data.camera.CameraEntity
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_RTS
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I
|
||||
import com.mogo.eagle.core.data.enums.SidePattern
|
||||
@@ -94,6 +93,10 @@ import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils.millis2String
|
||||
import com.mogo.map.MogoMap
|
||||
import com.mogo.module.common.enums.*
|
||||
import com.zhidao.support.adas.high.common.MogoReport.Code.Error.EAGENT.FATAL
|
||||
import com.zhidao.support.adas.high.common.MogoReport.Code.Error.EMAP.*
|
||||
import com.zhidao.support.adas.high.common.MogoReport.Code.Error.ESYS.TOPIC_FREQ_DROPED
|
||||
import com.zhidao.support.adas.high.common.MogoReport.Code.Error.ETELEMATICS.AICLOUD_AUTH_ERROR
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import com.zhjt.service_biz.BizConfig
|
||||
import kotlinx.android.synthetic.main.fragment_hmi.*
|
||||
@@ -112,12 +115,12 @@ import java.util.*
|
||||
* 预警图层
|
||||
*/
|
||||
@Route(path = MoGoFragmentPaths.PATH_FRAGMENT_HMI)
|
||||
class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
IMoGoWaringProvider,
|
||||
IMoGoHmiViewProxy,
|
||||
MoGoHmiContract.View,
|
||||
IMoGoAutopilotRecordListener,
|
||||
IMoGoAutopilotStatusListener, IViewNotificationProvider {
|
||||
class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
IMoGoWaringProvider,
|
||||
IMoGoHmiViewProxy,
|
||||
MoGoHmiContract.View,
|
||||
IMoGoAutopilotRecordListener,
|
||||
IMoGoAutopilotStatusListener, IViewNotificationProvider {
|
||||
private val TAG = "MoGoHmiFragment"
|
||||
|
||||
// DebugSettingView
|
||||
@@ -153,11 +156,12 @@ import java.util.*
|
||||
|
||||
//工控机节点上报列表
|
||||
private var reportList = arrayListOf<ReportEntity>()
|
||||
//工控机上报列表悬浮窗
|
||||
private var reportListFloatWindow: ReportListFloatWindow?=null
|
||||
private var ipcReportWindow: IPCReportWindow?=null
|
||||
|
||||
private var adUpgradeDialog: AdUpgradeDialog?=null
|
||||
//工控机上报列表悬浮窗
|
||||
private var reportListFloatWindow: ReportListFloatWindow? = null
|
||||
private var ipcReportWindow: IPCReportWindow? = null
|
||||
|
||||
private var adUpgradeDialog: AdUpgradeDialog? = null
|
||||
|
||||
private var lastSpeakJob: Job? = null
|
||||
|
||||
@@ -191,8 +195,8 @@ import java.util.*
|
||||
}
|
||||
|
||||
/**ivCameraIcon?.setOnLongClickListener {
|
||||
activity?.let { it1 -> CarcorderPreviewView.show(it1) }
|
||||
true
|
||||
activity?.let { it1 -> CarcorderPreviewView.show(it1) }
|
||||
true
|
||||
}*/
|
||||
|
||||
ivToolsIcon?.setOnClickListener {
|
||||
@@ -272,45 +276,62 @@ import java.util.*
|
||||
}
|
||||
}
|
||||
|
||||
override fun getNotificationView(): IViewNotification? = context?.let { V2XNotificationView(it) }
|
||||
override fun getNotificationView(): IViewNotification? =
|
||||
context?.let { V2XNotificationView(it) }
|
||||
|
||||
override fun onAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) {
|
||||
CallerLogger.d("$M_HMI$TAG", "recordKey=${recordPanel.key},stat=${recordPanel.stat}")
|
||||
if(BadCaseConfig.recordKeyList.contains(recordPanel.key)){
|
||||
if(recordPanel.stat == 100 || recordPanel.stat == 101){
|
||||
if (BadCaseConfig.recordKeyList.contains(recordPanel.key)) {
|
||||
if (recordPanel.stat == 100 || recordPanel.stat == 101) {
|
||||
//成功结束录制
|
||||
TipToast.shortTip("${millis2String(System.currentTimeMillis(),TimeUtils.getHourMinSecondFormat())} bag录制成功")
|
||||
TipToast.shortTip(
|
||||
"${
|
||||
millis2String(
|
||||
System.currentTimeMillis(),
|
||||
TimeUtils.getHourMinSecondFormat()
|
||||
)
|
||||
} bag录制成功"
|
||||
)
|
||||
}
|
||||
if(recordPanel.stat == 200){
|
||||
if (recordPanel.stat == 200) {
|
||||
//录制失败
|
||||
TipToast.shortTip("${millis2String(System.currentTimeMillis(),TimeUtils.getHourMinSecondFormat())} bag录制失败")
|
||||
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")){
|
||||
if (it.contains("taxi") && it.contains("2.3.0")) {
|
||||
return
|
||||
}
|
||||
if(it.contains("bus") && it.contains("2.4.0")){
|
||||
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 (!FunctionBuildConfig.isDemoMode && (recordPanel.stat == 100 || recordPanel.stat == 101) && recordPanel.type != 2) {
|
||||
//只在司机屏生效,乘客屏不生效
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
activity?.let { CallerDevaToolsManager.onReceiveBadCaseRecord(recordPanel, it) }
|
||||
}
|
||||
}
|
||||
if (!FunctionBuildConfig.isDemoMode && recordPanel.type == 2 && (
|
||||
recordPanel.stat == 101 || //工控机采集完成-被动完成
|
||||
recordPanel.stat == 100 || //工控机采集完成-主动完成
|
||||
recordPanel.stat == 102 || //工控机达到最大采集时长
|
||||
recordPanel.stat == 103) //工控机磁盘满了
|
||||
recordPanel.stat == 101 || //工控机采集完成-被动完成
|
||||
recordPanel.stat == 100 || //工控机采集完成-主动完成
|
||||
recordPanel.stat == 102 || //工控机达到最大采集时长
|
||||
recordPanel.stat == 103) //工控机磁盘满了
|
||||
) {
|
||||
CallerMapDataCollectorManager.finish(recordPanel.id, recordPanel.stat, "", recordPanel.filename
|
||||
?: "", recordPanel.note ?: "")
|
||||
CallerMapDataCollectorManager.finish(
|
||||
recordPanel.id, recordPanel.stat, "", recordPanel.filename
|
||||
?: "", recordPanel.note ?: ""
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -354,15 +375,19 @@ import java.util.*
|
||||
* @param warningReportList 提醒级别上报数据列表
|
||||
* @param reportLevel 1:error级别 2:warning级别
|
||||
*/
|
||||
override fun showIPCReportWindow(errorReportList: ArrayList<ReportEntity>,warningReportList: ArrayList<ReportEntity>,reportLevel: Int) {
|
||||
ThreadUtils.runOnUiThread{
|
||||
if(reportLevel == 1){
|
||||
if(ipcReportWindow==null){
|
||||
ipcReportWindow= activity?.let { IPCReportWindow(it) }
|
||||
ipcReportWindow?.setClickListener(object: IPCReportWindow.ClickListener{
|
||||
override fun showIPCReportWindow(
|
||||
errorReportList: ArrayList<ReportEntity>,
|
||||
warningReportList: ArrayList<ReportEntity>,
|
||||
reportLevel: Int
|
||||
) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (reportLevel == 1) {
|
||||
if (ipcReportWindow == null) {
|
||||
ipcReportWindow = activity?.let { IPCReportWindow(it) }
|
||||
ipcReportWindow?.setClickListener(object : IPCReportWindow.ClickListener {
|
||||
override fun closeWindow() {
|
||||
ipcReportWindow?.hideFloatWindow()
|
||||
ipcReportWindow =null
|
||||
ipcReportWindow = null
|
||||
}
|
||||
})
|
||||
ipcReportWindow?.let {
|
||||
@@ -371,7 +396,7 @@ import java.util.*
|
||||
}
|
||||
ipcReportWindow?.showFloatWindow()
|
||||
}
|
||||
ipcReportWindow?.refreshData(errorReportList,warningReportList,reportLevel)
|
||||
ipcReportWindow?.refreshData(errorReportList, warningReportList, reportLevel)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -430,41 +455,41 @@ import java.util.*
|
||||
})
|
||||
}
|
||||
toolsViewFloat = WarningFloat.with(it)
|
||||
.setTag("ToolsViewFloat")
|
||||
.setLayout(toolsView!!)
|
||||
.setSidePattern(SidePattern.LEFT)
|
||||
.setGravity(Gravity.LEFT)
|
||||
.setImmersionStatusBar(true)
|
||||
.setWindowHeight(LayoutParams.MATCH_PARENT)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
.setTag("ToolsViewFloat")
|
||||
.setLayout(toolsView!!)
|
||||
.setSidePattern(SidePattern.LEFT)
|
||||
.setGravity(Gravity.LEFT)
|
||||
.setImmersionStatusBar(true)
|
||||
.setWindowHeight(LayoutParams.MATCH_PARENT)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
toolsViewFloat = null
|
||||
toolsView = null
|
||||
// TODO:("")
|
||||
}
|
||||
})
|
||||
.show()
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
toolsViewFloat = null
|
||||
toolsView = null
|
||||
// TODO:("")
|
||||
}
|
||||
})
|
||||
.show()
|
||||
} else {
|
||||
toolsViewFloat?.show()
|
||||
}
|
||||
@@ -509,7 +534,7 @@ import java.util.*
|
||||
ivAiCollectTools.visibility = View.VISIBLE
|
||||
CallerDevaToolsManager.initBadCase(ivBadCaseTools)
|
||||
CallerDevaToolsManager.initAiCollect(ivAiCollectTools)
|
||||
}else{
|
||||
} else {
|
||||
ivBadCaseTools.visibility = View.GONE
|
||||
ivAiCollectTools.visibility = View.GONE
|
||||
}
|
||||
@@ -586,20 +611,20 @@ import java.util.*
|
||||
mDebugSettingView = DebugSettingView(it)
|
||||
Log.i("DebugViewSwitchLog", "new DebugSettingView")
|
||||
mDebugSettingView?.reportInit(reportList)
|
||||
mDebugSettingView?.setClickListener(object: DebugSettingView.ClickListener{
|
||||
mDebugSettingView?.setClickListener(object : DebugSettingView.ClickListener {
|
||||
override fun showReportListWindow(show: Boolean) {
|
||||
if(show){
|
||||
if (show) {
|
||||
//打开工控机上报列表
|
||||
reportListFloatWindow = ReportListFloatWindow(it)
|
||||
reportListFloatWindow?.showFloatWindow()
|
||||
reportListFloatWindow?.refreshData(reportList)
|
||||
}else{
|
||||
} else {
|
||||
//关闭工控机上报列表
|
||||
reportListFloatWindow?.hideFloatWindow()
|
||||
}
|
||||
}
|
||||
})
|
||||
if(mDebugSettingView!=null){
|
||||
if (mDebugSettingView != null) {
|
||||
Log.i("DebugViewSwitchLog", "new DebugSettingView success")
|
||||
}
|
||||
}
|
||||
@@ -607,38 +632,39 @@ import java.util.*
|
||||
var gravity = Gravity.RIGHT
|
||||
//调试窗默认靠右显示,Bus的乘客端右端有视图覆盖,调试窗靠左显示
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
|
||||
AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||
) {
|
||||
side = SidePattern.LEFT
|
||||
gravity = Gravity.LEFT
|
||||
}
|
||||
mDebugSettingViewFloat = WarningFloat.with(it)
|
||||
.setTag("DebugSettingView")
|
||||
.setLayout(mDebugSettingView!!)
|
||||
.setSidePattern(side)
|
||||
.setGravity(gravity, offsetY = 70)
|
||||
.setImmersionStatusBar(true)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
.setTag("DebugSettingView")
|
||||
.setLayout(mDebugSettingView!!)
|
||||
.setSidePattern(side)
|
||||
.setGravity(gravity, offsetY = 70)
|
||||
.setImmersionStatusBar(true)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.show()
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -653,15 +679,16 @@ import java.util.*
|
||||
*/
|
||||
@Synchronized
|
||||
override fun showWarningV2X(
|
||||
v2xType: String,
|
||||
alertContent: CharSequence?,
|
||||
ttsContent: String?,
|
||||
tag: String?,
|
||||
listener: IMoGoWarningStatusListener?,
|
||||
playTts: Boolean,
|
||||
expireTime: Long
|
||||
v2xType: String,
|
||||
alertContent: CharSequence?,
|
||||
ttsContent: String?,
|
||||
tag: String?,
|
||||
listener: IMoGoWarningStatusListener?,
|
||||
playTts: Boolean,
|
||||
expireTime: Long
|
||||
) {
|
||||
val playTTS = playTts && !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
|
||||
val playTTS =
|
||||
playTts && !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
|
||||
activity?.let {
|
||||
val warningContent = alertContent
|
||||
?: EventTypeEnum.getWarningContent(v2xType)
|
||||
@@ -672,70 +699,87 @@ import java.util.*
|
||||
val content = mViewNotificationProvider?.getNotificationView() ?: return
|
||||
content.setWarningIcon(EventTypeEnum.getWarningIcon(v2xType))
|
||||
content.setWarningContent(warningContent)
|
||||
Log.d("$M_HMI$TAG", "--- show v2x dialog 1 ---: info -> v2x-type: $v2xType : expireTime: $expireTime")
|
||||
Reminder.enqueue(this@MoGoHmiFragment, object : PopupWindowReminder(PopupWindow(content, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT).also { itx ->
|
||||
itx.isTouchable = false
|
||||
itx.isFocusable = false
|
||||
itx.isClippingEnabled = false
|
||||
itx.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
|
||||
val transition = Slide(when(content.sidePattern) {
|
||||
LEFT, RESULT_LEFT-> Gravity.LEFT
|
||||
RIGHT, RESULT_RIGHT -> Gravity.RIGHT
|
||||
TOP, RESULT_TOP -> Gravity.TOP
|
||||
BOTTOM, RESULT_BOTTOM -> Gravity.BOTTOM
|
||||
else -> Gravity.TOP
|
||||
}).also { t ->
|
||||
t.interpolator = AccelerateDecelerateInterpolator()
|
||||
t.duration = 200
|
||||
}
|
||||
if (VERSION.SDK_INT >= VERSION_CODES.M) {
|
||||
itx.enterTransition = transition
|
||||
itx.exitTransition = transition
|
||||
}
|
||||
}) {
|
||||
override fun show() {
|
||||
val parent = it.window.decorView
|
||||
parent.doOnAttach {
|
||||
Log.d("$M_HMI$TAG", "--- show v2x dialog 2 ---: info -> v2x-type: $v2xType : expireTime: $expireTime")
|
||||
popupWindow.showAtLocation(parent, content.layoutGravity, 0, 0)
|
||||
}
|
||||
}
|
||||
override fun isOverride(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun key(): String {
|
||||
return v2xType
|
||||
}
|
||||
}, object : IStateChangeListener {
|
||||
|
||||
override fun onShow(reminder: IReminder) {
|
||||
listener?.onShow()
|
||||
lastShowV2XJob?.safeCancel()
|
||||
lastSpeakJob?.safeCancel()
|
||||
showingV2XTip = reminder
|
||||
lifecycleScope.launch {
|
||||
delay(expireTime)
|
||||
}.also { itx ->
|
||||
lastShowV2XJob = itx
|
||||
}.invokeOnCompletion { _ ->
|
||||
reminder.hide()
|
||||
}
|
||||
if (ttsContent != null && !TextUtils.isEmpty(ttsContent) && playTTS) {
|
||||
lifecycleScope.launch {
|
||||
speak(it, ttsContent)
|
||||
}.also { itx ->
|
||||
lastSpeakJob = itx
|
||||
Log.d(
|
||||
"$M_HMI$TAG",
|
||||
"--- show v2x dialog 1 ---: info -> v2x-type: $v2xType : expireTime: $expireTime"
|
||||
)
|
||||
Reminder.enqueue(
|
||||
this@MoGoHmiFragment,
|
||||
object : PopupWindowReminder(
|
||||
PopupWindow(
|
||||
content,
|
||||
LayoutParams.WRAP_CONTENT,
|
||||
LayoutParams.WRAP_CONTENT
|
||||
).also { itx ->
|
||||
itx.isTouchable = false
|
||||
itx.isFocusable = false
|
||||
itx.isClippingEnabled = false
|
||||
itx.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
|
||||
val transition = Slide(
|
||||
when (content.sidePattern) {
|
||||
LEFT, RESULT_LEFT -> Gravity.LEFT
|
||||
RIGHT, RESULT_RIGHT -> Gravity.RIGHT
|
||||
TOP, RESULT_TOP -> Gravity.TOP
|
||||
BOTTOM, RESULT_BOTTOM -> Gravity.BOTTOM
|
||||
else -> Gravity.TOP
|
||||
}
|
||||
).also { t ->
|
||||
t.interpolator = AccelerateDecelerateInterpolator()
|
||||
t.duration = 200
|
||||
}
|
||||
if (VERSION.SDK_INT >= VERSION_CODES.M) {
|
||||
itx.enterTransition = transition
|
||||
itx.exitTransition = transition
|
||||
}
|
||||
}) {
|
||||
override fun show() {
|
||||
val parent = it.window.decorView
|
||||
parent.doOnAttach {
|
||||
Log.d(
|
||||
"$M_HMI$TAG",
|
||||
"--- show v2x dialog 2 ---: info -> v2x-type: $v2xType : expireTime: $expireTime"
|
||||
)
|
||||
popupWindow.showAtLocation(parent, content.layoutGravity, 0, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onHide(reminder: IReminder) {
|
||||
listener?.onDismiss()
|
||||
showingV2XTip = null
|
||||
showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
}
|
||||
})
|
||||
override fun isOverride(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun key(): String {
|
||||
return v2xType
|
||||
}
|
||||
},
|
||||
object : IStateChangeListener {
|
||||
|
||||
override fun onShow(reminder: IReminder) {
|
||||
listener?.onShow()
|
||||
lastShowV2XJob?.safeCancel()
|
||||
lastSpeakJob?.safeCancel()
|
||||
showingV2XTip = reminder
|
||||
lifecycleScope.launch {
|
||||
delay(expireTime)
|
||||
}.also { itx ->
|
||||
lastShowV2XJob = itx
|
||||
}.invokeOnCompletion { _ ->
|
||||
reminder.hide()
|
||||
}
|
||||
if (ttsContent != null && !TextUtils.isEmpty(ttsContent) && playTTS) {
|
||||
lifecycleScope.launch {
|
||||
speak(it, ttsContent)
|
||||
}.also { itx ->
|
||||
lastSpeakJob = itx
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onHide(reminder: IReminder) {
|
||||
listener?.onDismiss()
|
||||
showingV2XTip = null
|
||||
showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -782,8 +826,8 @@ import java.util.*
|
||||
* @param checkLightId 0-都是默认不亮起,1-红,2-黄,3-绿
|
||||
* @param lightSource 1:云端下发;2:自车感知
|
||||
*/
|
||||
override fun showWarningTrafficLight(checkLightId: Int,lightSource: Int) {
|
||||
mViewTrafficLight?.showWarningTrafficLight(checkLightId,lightSource)
|
||||
override fun showWarningTrafficLight(checkLightId: Int, lightSource: Int) {
|
||||
mViewTrafficLight?.showWarningTrafficLight(checkLightId, lightSource)
|
||||
}
|
||||
|
||||
override fun isWarningTrafficLightShow(): Boolean {
|
||||
@@ -857,7 +901,7 @@ import java.util.*
|
||||
* @see WarningDirectionEnum
|
||||
*/
|
||||
override fun showWarning(direction: WarningDirectionEnum) {
|
||||
Log.d(TAG,"showWarning====")
|
||||
Log.d(TAG, "showWarning====")
|
||||
flV2XWarningView?.showWarning(direction)
|
||||
flicker(flV2XWarningView)
|
||||
}
|
||||
@@ -906,42 +950,42 @@ import java.util.*
|
||||
mNoticeFloat = it?.let { it1 ->
|
||||
noticeBannerView?.let { it2 ->
|
||||
WarningFloat.with(it1)
|
||||
.setTag(WaringConst.NOTICE_FOR_TRAFFIC_KEY)
|
||||
.setLayout(it2)
|
||||
.setSidePattern(SidePattern.TOP)
|
||||
.setCountDownTime(60 * 1000 * 3)
|
||||
.setGravity(Gravity.CENTER_HORIZONTAL, offsetY = 110)
|
||||
.setImmersionStatusBar(true)
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
// 创建弹窗成功才进行TTS播报
|
||||
.setTag(WaringConst.NOTICE_FOR_TRAFFIC_KEY)
|
||||
.setLayout(it2)
|
||||
.setSidePattern(SidePattern.TOP)
|
||||
.setCountDownTime(60 * 1000 * 3)
|
||||
.setGravity(Gravity.CENTER_HORIZONTAL, offsetY = 110)
|
||||
.setImmersionStatusBar(true)
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
// 创建弹窗成功才进行TTS播报
|
||||
// AIAssist.getInstance(activity)
|
||||
// .speakTTSVoice("")
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
})
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.show()
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -956,41 +1000,41 @@ import java.util.*
|
||||
mNoticeFloat = it.let { it1 ->
|
||||
noticeBannerView?.let { it2 ->
|
||||
WarningFloat.with(it1)
|
||||
.setTag(WaringConst.NOTICE_FOR_NORMAL_KEY)
|
||||
.setLayout(it2)
|
||||
.setSidePattern(SidePattern.TOP)
|
||||
.setCountDownTime(10000)
|
||||
.setGravity(Gravity.CENTER_HORIZONTAL, offsetY = 110)
|
||||
.setImmersionStatusBar(true)
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
// 创建弹窗成功才进行TTS播报
|
||||
// AIAssist.getInstance(activity)
|
||||
// .speakTTSVoice("")
|
||||
}
|
||||
})
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
.setTag(WaringConst.NOTICE_FOR_NORMAL_KEY)
|
||||
.setLayout(it2)
|
||||
.setSidePattern(SidePattern.TOP)
|
||||
.setCountDownTime(10000)
|
||||
.setGravity(Gravity.CENTER_HORIZONTAL, offsetY = 110)
|
||||
.setImmersionStatusBar(true)
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
// 创建弹窗成功才进行TTS播报
|
||||
// AIAssist.getInstance(activity)
|
||||
// .speakTTSVoice("")
|
||||
}
|
||||
})
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.show()
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1077,7 +1121,7 @@ import java.util.*
|
||||
dismissToolsFloatView()
|
||||
}
|
||||
|
||||
@BizConfig(V2I,"",BIZ_RTS)
|
||||
@BizConfig(V2I, "", BIZ_RTS)
|
||||
override fun showVideoDialog(infList: List<Infrastructure>) {
|
||||
context?.let {
|
||||
if (roadVideoDialog == null) {
|
||||
@@ -1087,7 +1131,7 @@ import java.util.*
|
||||
}
|
||||
}
|
||||
|
||||
@BizConfig(V2I,"", BIZ_RTS)
|
||||
@BizConfig(V2I, "", BIZ_RTS)
|
||||
private fun showCameraList(cameraList: List<CameraEntity>?) {
|
||||
context?.let {
|
||||
if (cameraViewFloat == null) {
|
||||
@@ -1116,40 +1160,40 @@ import java.util.*
|
||||
}
|
||||
})
|
||||
cameraViewFloat = WarningFloat.with(it)
|
||||
.setTag("CameraListFloat")
|
||||
.setLayout(cameraListView!!)
|
||||
.setSidePattern(SidePattern.RIGHT)
|
||||
.setGravity(Gravity.RIGHT, -40, 255)
|
||||
.setImmersionStatusBar(true)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
.setTag("CameraListFloat")
|
||||
.setLayout(cameraListView!!)
|
||||
.setSidePattern(SidePattern.RIGHT)
|
||||
.setGravity(Gravity.RIGHT, -40, 255)
|
||||
.setImmersionStatusBar(true)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
cameraViewFloat = null
|
||||
cameraListView = null
|
||||
ivCameraIcon.setBackgroundResource(R.drawable.icon_camera_nor)
|
||||
}
|
||||
})
|
||||
.show()
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
cameraViewFloat = null
|
||||
cameraListView = null
|
||||
ivCameraIcon.setBackgroundResource(R.drawable.icon_camera_nor)
|
||||
}
|
||||
})
|
||||
.show()
|
||||
} else {
|
||||
cameraViewFloat?.show()
|
||||
}
|
||||
@@ -1180,9 +1224,9 @@ import java.util.*
|
||||
}
|
||||
}
|
||||
|
||||
private var isLeftLight :Boolean = false
|
||||
private var isRightLight :Boolean = false
|
||||
private var isDisappare :Boolean = false
|
||||
private var isLeftLight: Boolean = false
|
||||
private var isRightLight: Boolean = false
|
||||
private var isDisappare: Boolean = false
|
||||
|
||||
/**
|
||||
* 显示转向灯效果 if (HmiBuildConfig.isShowBadCaseView) {
|
||||
@@ -1287,13 +1331,14 @@ import java.util.*
|
||||
padSn: String,
|
||||
releaseId: String
|
||||
) {
|
||||
ThreadUtils.runOnUiThread{
|
||||
if(adUpgradeDialog == null){
|
||||
adUpgradeDialog = AdUpgradeDialog(requireContext(),images, padSn, releaseId)
|
||||
adUpgradeDialog?.setClickListener(object: AdUpgradeDialog.ClickListener{
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (adUpgradeDialog == null) {
|
||||
adUpgradeDialog = AdUpgradeDialog(requireContext(), images, padSn, releaseId)
|
||||
adUpgradeDialog?.setClickListener(object : AdUpgradeDialog.ClickListener {
|
||||
override fun confirm() {
|
||||
//确认升级
|
||||
CallerBindingcarManager.getBindingcarProvider().upgradeConfirm(images, padSn, releaseId)
|
||||
CallerBindingcarManager.getBindingcarProvider()
|
||||
.upgradeConfirm(images, padSn, releaseId)
|
||||
AdUpgradeStateHelper.setConfirmUpgrade(true)
|
||||
ToastUtils.showLong("最新版本下载中...")
|
||||
adUpgradeDialog?.dismiss()
|
||||
@@ -1312,10 +1357,10 @@ import java.util.*
|
||||
}
|
||||
|
||||
override fun showAdUpgradeStatus(ipcUpgradeStateInfo: IPCUpgradeStateInfo) {
|
||||
ThreadUtils.runOnUiThread{
|
||||
ThreadUtils.runOnUiThread {
|
||||
toolsView?.showAdUpgradeStatus(ipcUpgradeStateInfo)
|
||||
ipcUpgradeStateInfo.status.let {
|
||||
if(AdUpgradeStateHelper.isUpgradeSuccess(it)){
|
||||
if (AdUpgradeStateHelper.isUpgradeSuccess(it)) {
|
||||
ToastUtils.showLong("升级成功")
|
||||
AdUpgradeStateHelper.setConfirmUpgrade(false)
|
||||
}
|
||||
@@ -1342,17 +1387,37 @@ import java.util.*
|
||||
*/
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
|
||||
guardianInfo?.let {
|
||||
if(reportList.size>49){
|
||||
if (reportList.size > 49) {
|
||||
reportList.removeLast()
|
||||
}
|
||||
reportList.add(0,
|
||||
ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()),
|
||||
it.src,it.level,it.msg,it.code,it.resultList,it.actionsList))
|
||||
reportList.add(
|
||||
0,
|
||||
ReportEntity(
|
||||
TimeUtils.millis2String(System.currentTimeMillis()),
|
||||
it.src, it.level, it.msg, it.code, it.resultList, it.actionsList
|
||||
)
|
||||
)
|
||||
}
|
||||
reportListFloatWindow?.let {
|
||||
ThreadUtils.runOnUiThread{
|
||||
ThreadUtils.runOnUiThread {
|
||||
|
||||
reportListFloatWindow?.let {
|
||||
it.refreshData(reportList)
|
||||
}
|
||||
|
||||
guardianInfo?.let {
|
||||
when (it.code) {
|
||||
NODE, NODE_DEAD,
|
||||
EXIT_AUTOPILOT_FOR_PLANNING,
|
||||
EXIT_AUTOPILOT_FOR_LOCATION,
|
||||
EXIT_AUTOPILOT_FOR_CHASSIS,
|
||||
EXIT_AUTOPILOT_FOR_DISTANCE,
|
||||
AICLOUD_AUTH_ERROR,
|
||||
TOPIC_FREQ_DROPED,
|
||||
FATAL -> {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1362,12 +1427,16 @@ import java.util.*
|
||||
.navigation() as BaseFragment
|
||||
activity?.supportFragmentManager?.beginTransaction()
|
||||
?.setCustomAnimations(R.anim.slide_in, R.anim.fade_out)?.apply {
|
||||
if (!fragmentOverview.isAdded) {
|
||||
add(R.id.module_main_id_smp_fragment, fragmentOverview, fragmentOverview.tagName)
|
||||
} else {
|
||||
if (!fragmentOverview.isAdded) {
|
||||
add(
|
||||
R.id.module_main_id_smp_fragment,
|
||||
fragmentOverview,
|
||||
fragmentOverview.tagName
|
||||
)
|
||||
} else {
|
||||
show(fragmentOverview)
|
||||
}.commitAllowingStateLoss()
|
||||
}
|
||||
}.commitAllowingStateLoss()
|
||||
}
|
||||
CallerDevaToolsManager.hideStatusBar()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user