Merge branch 'test_MogoAP_eagle-1030_211020_8.0.14.2' into dev_MogoAP_eagle-1030_211020_8.0.14_for_newtts

This commit is contained in:
donghongyu
2021-12-07 15:02:47 +08:00
8 changed files with 55 additions and 34 deletions

View File

@@ -200,6 +200,7 @@ class CameraListView : FrameLayout {
clickListener?.refreshCameraList()
clickListener?.onShowLive(false)
}
isFirstPage = true
isPlaySuccess = false
}
else -> {

View File

@@ -458,28 +458,29 @@ class MogoPrivateObuManager private constructor() {
// (5) 限速预警信息CVX_SLW_THREAT_IND
override fun onCvxSlwThreatIndInfo(info: CvxSlwThreatIndInfo?) {
Logger.d(MogoObuConst.TAG_MOGO_OBU, "onCvxSlwThreatIndInfo ------> $info")
if (info != null) {
when (info.status) {
// 添加
ObuConstants.STATUS.ADD,
ObuConstants.STATUS.UPDATE
-> {
if (info.ext_info != null) {
// 计算为千米每小时 TODO 这里需要做一下向上取整数406080120等
Logger.d(
MogoObuConst.TAG_MOGO_OBU,
"info.ext_info.speed_limit_max ------> ${info.ext_info.speed_limit_max}"
)
CallerHmiManager.showLimitingVelocity((Math.round(((info.ext_info.speed_limit_max * 60 * 60) / 1000) / 10) * 10).toInt())
}
}
// 删除
ObuConstants.STATUS.DELETE -> {
CallerHmiManager.disableLimitingVelocity()
}
}
}
//todo 限速走高精地图 屏蔽OBU限速\
// Logger.d(MogoObuConst.TAG_MOGO_OBU, "onCvxSlwThreatIndInfo ------> $info")
// if (info != null) {
// when (info.status) {
// // 添加
// ObuConstants.STATUS.ADD,
// ObuConstants.STATUS.UPDATE
// -> {
// if (info.ext_info != null) {
// // 计算为千米每小时 TODO 这里需要做一下向上取整数406080120等
// Logger.d(
// MogoObuConst.TAG_MOGO_OBU,
// "info.ext_info.speed_limit_max ------> ${info.ext_info.speed_limit_max}"
// )
// CallerHmiManager.showLimitingVelocity((Math.round(((info.ext_info.speed_limit_max * 60 * 60) / 1000) / 10) * 10).toInt())
// }
// }
// // 删除
// ObuConstants.STATUS.DELETE -> {
// CallerHmiManager.disableLimitingVelocity()
// }
// }
// }
}

View File

@@ -45,6 +45,10 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) {
// 到路口100m时回调
Logger.d(TAG, "处理路口交通数据:是否是第一次处理:${isFirst}是否进入路口:${isEnter}")
if (trafficLightResult.currentRoadIsRight()) {
Logger.d(TAG,"当前道路右转,不处理")
return
}
if (isFirst && !isEnter) {
getCurrentRoadTrafficLight(trafficLightResult)?.let {
handleRedLightWarning(it, trafficLightResult)
@@ -111,13 +115,13 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
when {
trafficLightStatus.isRed() -> {
Logger.d(TAG, "=====当前为红灯=====")
// 到达路口时红灯还没走完(由于多个数据有偏差红灯预警延长1s绿灯提示延长3s多报出错不如少报且准)
// 到达路口时红灯还没走完(由于多个数据有偏差红灯预警延长1s绿灯提示条件延长1.5s多报出错不如少报且准)
if (arriveTime <= remainTime + 1) {
redLightWarning()
} else if (arriveTime > remainTime + trafficLightResult.flashYellow + 3) {// 到达时红、黄灯都走完
} else if (arriveTime > remainTime + trafficLightResult.flashYellow + 1.5) {// 到达时红、黄灯都走完
// 单位Km/h当前为红灯推荐速度越慢越容易绿灯通过且要满足[10,50]
val originRemainSpeed =
floor(distance / (remainTime + trafficLightResult.flashYellow + 3) * 3.6).toInt()
floor(distance / (remainTime + trafficLightResult.flashYellow + 1.5) * 3.6).toInt()
when {
originRemainSpeed > 50 -> greenLightWarning("10到50")
originRemainSpeed in 10..50 -> greenLightWarning("10到$originRemainSpeed")
@@ -126,12 +130,12 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
}
trafficLightStatus.isYellow() -> {
Logger.d(TAG, "=====当前为黄灯=====")
// 到达路口时黄灯还没走完(由于多个数据有偏差红灯预警延长1s绿灯提示延长3s多报出错不如少报且准)
// 到达路口时黄灯还没走完(由于多个数据有偏差红灯预警延长1s绿灯提示延长1.5s多报出错不如少报且准)
if (arriveTime <= remainTime + 1) {
redLightWarning()
} else if (arriveTime > remainTime + 3) {
} else if (arriveTime > remainTime + 1.5) {
// 单位Km/h当前为黄灯推荐速度越慢越容易绿灯通过且要满足[10,50]
val originRemainSpeed = floor(distance / (remainTime + 3) * 3.6).toInt()
val originRemainSpeed = floor(distance / (remainTime + 1.5) * 3.6).toInt()
when {
originRemainSpeed > 50 -> greenLightWarning("10到50")
originRemainSpeed in 10..50 -> greenLightWarning("10到$originRemainSpeed")
@@ -143,9 +147,9 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
// 到达路口时绿灯已经走完(由于多个数据有偏差,多报出错不如少报且准,绿灯时间减少一点)
if (arriveTime >= remainTime - 1) {
redLightWarning()
} else if (arriveTime < remainTime - 3) {
} else if (arriveTime < remainTime - 1.5) {
// 单位Km/h当前为绿灯推荐速度越快越容易绿灯通过且要满足[10,50]
val originRemainSpeed = ceil(distance / (remainTime - 3) * 3.6).toInt()
val originRemainSpeed = ceil(distance / (remainTime - 1.5) * 3.6).toInt()
when {
originRemainSpeed < 10 -> greenLightWarning("10到50")
originRemainSpeed in 10..50 -> greenLightWarning("${originRemainSpeed}到50")

View File

@@ -25,6 +25,10 @@ class RoadArrow {
fun isRight(arrowId: Int): Boolean {
return arrowId == TURN_RIGHT || arrowId == STRAIGHT_OR_RIGHT || arrowId == TURN_LEFT_OR_RIGHT
}
fun isOnlyRight(arrowId: Int): Boolean {
return arrowId == TURN_RIGHT
}
}
}

View File

@@ -4,6 +4,10 @@ fun TrafficLightResult.currentRoadTrafficLight(): TrafficLightStatus? {
return TrafficLightStatusHelper.getCurrentRoadTrafficLight(this)
}
fun TrafficLightResult.currentRoadIsRight():Boolean{
return TrafficLightStatusHelper.currentRoadIsRight(this)
}
/**
* 路口红绿灯请求返回数据
*/

View File

@@ -16,5 +16,10 @@ object TrafficLightStatusHelper {
return null
}
fun currentRoadIsRight(trafficLightResult: TrafficLightResult) : Boolean{
val arrowNo = trafficLightResult.arrowNo
return RoadArrow.isOnlyRight(arrowNo)
}
}

View File

@@ -493,15 +493,17 @@ class CallChatCenter private constructor() : IBizCallChat.IBizCallBack, IVoiceCo
* 2.如果当前正在打电话中,则拒绝
*/
override fun showIncomingCall(userInfo: UserInfo) {
Logger.d(TAG, "showIncomingCall===userInfo: $userInfo")
currentUserInfo = userInfo
if (callChatManager.isCalling() || callingWindowManager.isIncomingWindowShow()) {
log(TAG, "已在通话进程中,准备拒绝他 ---> ")
refuseCall(userInfo.sn)
} else {
log(TAG, "有人打来电话,准备显示 ---> ${UserInfoHelper.currentRoomId}")
log(TAG, "有人打来电话,准备显示 房间号---> ${UserInfoHelper.currentRoomId} , 用户---> ${currentUserInfo!!.sn}")
callingWindowManager.showIncomingView({
callChatManager.answerInvoke(userInfo.sn)
callChatManager.answerInvoke(currentUserInfo!!.sn)
}, {
refuseCall(userInfo.sn)
refuseCall(currentUserInfo!!.sn)
})
}
}

View File

@@ -155,7 +155,7 @@ class CallChatManager(iBizCallChat: IBizCallChat.IBizCallBack) : ICallResponse {
}
fun answerInvoke(sn: String) {
Logger.i(TAG, "answerInvoke")
Logger.i(TAG, "answerInvoke sn : $sn")
IMCallManager.answer(sn, this)
}