[2.14.0] pnc add try catch
This commit is contained in:
@@ -72,37 +72,40 @@ class PncActionsView @JvmOverloads constructor(
|
||||
|
||||
@BizConfig(FOUNDATION, "", BIZ_PNC_ACTIONS)
|
||||
override fun pncActions(planningActionMsg: MessagePad.PlanningActionMsg) {
|
||||
mAutoPilotStatusInfo?.let { it ->
|
||||
if (it.state == STATUS_AUTOPILOT_RUNNING) {
|
||||
UiThreadHandler.post {
|
||||
var actions: String? = null
|
||||
planningActionMsg.actionMsg?.let {
|
||||
actions = PncActionsHelper.getAction(it.drivingState.number, it.drivingAction.number)
|
||||
try {
|
||||
mAutoPilotStatusInfo?.let { it ->
|
||||
if (it.state == STATUS_AUTOPILOT_RUNNING) {
|
||||
UiThreadHandler.post {
|
||||
var actions: String? = null
|
||||
planningActionMsg.actionMsg?.let {
|
||||
actions = PncActionsHelper.getAction(it.drivingState.number, it.drivingAction.number)
|
||||
|
||||
//如果是存在云端红绿灯数据条件下,设置云端数据
|
||||
if (PncActionsHelper.isWaitingTrafficlight(it.drivingState.number, it.drivingAction.number)
|
||||
&& mTrafficLightResult != null
|
||||
&& getWaitTrafficlightTime().isNotBlank()) {
|
||||
actions += ",预计${getWaitTrafficlightTime()}秒后通过"
|
||||
//如果是存在云端红绿灯数据条件下,设置云端数据
|
||||
if (PncActionsHelper.isWaitingTrafficlight(it.drivingState.number, it.drivingAction.number)
|
||||
&& mTrafficLightResult != null
|
||||
&& getWaitTrafficlightTime().isNotBlank()) {
|
||||
actions += ",预计${getWaitTrafficlightTime()}秒后通过"
|
||||
} else {
|
||||
mTrafficLightResult = null
|
||||
}
|
||||
}
|
||||
// update view
|
||||
if (actions.isNullOrEmpty()) {
|
||||
this.background = null
|
||||
tvHmiPncActions.text = ""
|
||||
} else {
|
||||
mTrafficLightResult = null
|
||||
this.background = AppCompatResources.getDrawable(context, R.drawable.pnc_actions_bg)
|
||||
tvHmiPncActions.text = actions
|
||||
}
|
||||
}
|
||||
// update view
|
||||
if (actions.isNullOrEmpty()) {
|
||||
this.background = null
|
||||
tvHmiPncActions.text = ""
|
||||
} else {
|
||||
this.background = AppCompatResources.getDrawable(context, R.drawable.pnc_actions_bg)
|
||||
tvHmiPncActions.text = actions
|
||||
}
|
||||
}else{
|
||||
this.background = null
|
||||
tvHmiPncActions.text = ""
|
||||
}
|
||||
}else{
|
||||
this.background = null
|
||||
tvHmiPncActions.text = ""
|
||||
}
|
||||
}catch (e:Exception){
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) {
|
||||
|
||||
Reference in New Issue
Block a user