This commit is contained in:
tongchenfei
2020-10-27 17:50:28 +08:00
parent 6339f604b8
commit dad639fe8a
3 changed files with 142 additions and 60 deletions

View File

@@ -12,6 +12,7 @@ import android.widget.TextView;
import com.mogo.map.location.IMogoLocationListener;
import com.mogo.map.location.MogoLocation;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.entity.CloudRoadData;
import com.mogo.module.common.entity.MogoSnapshotSetData;
import com.mogo.module.extensions.R;
import com.mogo.service.adas.IMogoAdasWarnMessageCallback;
@@ -94,10 +95,7 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
if (!isVrMode) {
return;
}
// 处理adas识别的时间主要是行人碰撞预警
if (msg.type == MogoADASWarnType.ADAS_WARNING_PERSON) {
MogoApisHandler.getInstance().getApis().getEntranceButtonController().showLeftNoticeByType(IMogoEntranceButtonController.NOTICE_TYPE_PEOPLE_WARN, R.drawable.module_ext_people_warn, "前方注意行人");
}
if (msg.type == MogoADASWarnType.ADAS_WARNING_LIMIT_SPEED) {
// 收到限速信息,更新界面
if (tvLimitSpeed != null) {
@@ -164,13 +162,6 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
if (!isVrMode) {
return;
}
// todo 处理发给adas的事件, 主要处理逆向超车和obu行人碰撞
String id = intent.getStringExtra("v2x_warning_type");
if (id != null) {
if ("100003".equals(id)) {// 行人碰撞
MogoApisHandler.getInstance().getApis().getEntranceButtonController().showLeftNoticeByType(IMogoEntranceButtonController.NOTICE_TYPE_PEOPLE_WARN, R.drawable.module_ext_people_warn, "前方注意行人");
}
}
int type = intent.getIntExtra("type", -1);
if (type == 2) {
@@ -204,10 +195,11 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
}
}
private void handleCloudTrafficLight(){
private void handleCloudTrafficLight(CloudRoadData roadData){
if (tvTrafficLight != null && !handler.hasMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU)) {
handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD);
// todo drawTrafficLight
handler.sendEmptyMessageDelayed(MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD,
HIDE_TRAFFIC_LIGHT_DELAY);
}
@@ -243,5 +235,10 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
@Override
public void onMsgReceived(MogoSnapshotSetData obj) {
Logger.d(TAG, "收到大而全数据: " + obj);
CloudRoadData roadData = obj.getTrafficLight();
if (roadData != null) {
Logger.d(TAG, "收到红绿灯数据");
handleCloudTrafficLight(roadData);
}
}
}