Merge branch 'dev2_aiSdk' into dev2_smp_change

This commit is contained in:
董宏宇
2021-05-18 17:43:11 +08:00
141 changed files with 1988 additions and 385 deletions

View File

@@ -86,31 +86,15 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
markerShowEntity.setMarkerLocation(location);
markerShowEntity.setMarkerType(TYPE_MARKER_CLOUD_WARN_DATA);
IMogoMarker bottomMarker = drawMarkerWith2Resource(markerShowEntity);
MogoLatLng mogoLatLng = new MogoLatLng(data.getCollisionLat(), data.getCollisionLon());
//2D资源图片位置调整
// MogoLatLng stopLineNew = Trigonometric.getNewLocation(data.getStopLines().get(1), 5, 180);
// MogoLatLng newLocation = Trigonometric.getNewLocation(mogoLatLng, 5, 180);
IMogoMarker marker = drawMarker(markerShowEntity, modeResType(data.getType()));
//识别物
marker.addDynamicAnchorPosition(new MogoLatLng(
data.getDirection() == 1 ? data.getStopLines().get(1).lat : data.getCollisionLat(),
data.getDirection() == 1 ? data.getStopLines().get(1).lon : data.getCollisionLon()), (float) data.getHeading(), 5000);
//识别物下方的红色圆圈
bottomMarker.addDynamicAnchorPosition(new MogoLatLng(
data.getDirection() == 1 ? data.getStopLines().get(1).lat : data.getCollisionLat(),
data.getDirection() == 1 ? data.getStopLines().get(1).lon : data.getCollisionLon()), (float) data.getHeading(), 5000);
// bottomMarker.addDynamicAnchorPosition(new MogoLatLng(
// data.getDirection() == 1 ? stopLineNew.lat : newLocation.getLat(),
// data.getDirection() == 1 ? stopLineNew.lon : newLocation.getLon()), (float) data.getHeading(), 5000);
//移动完成以后3s后消失
UiThreadHandler.postDelayed(() -> {
marker.remove();
bottomMarker.remove();
}, 8000);
}, data.getShowTime());
}
@@ -140,7 +124,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
.setGps(false);
IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
options.icon3DRes(getModelRes(modeResType)); //TODO
options.anchorColor("#FB3C3CFF"); //红色#FF3036 蓝色:#256BFF
options.anchorColor("#FB3C3CFF");
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerShowEntity.getMarkerType(), options);
iMarkerView.setMarker(marker);
marker.setToTop();
@@ -196,13 +180,8 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
markerShowEntity.setMarkerLocation(location);
markerShowEntity.setMarkerType(TYPE_MARKER_CLOUD_STOP_LINE_DATA);
IMogoMarker marker = drawStopLineMarker(markerShowEntity);
//移动完成以后3s后消失
UiThreadHandler.postDelayed(() -> {
marker.remove();
}, 8000);
}
@@ -221,7 +200,6 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerShowEntity.getMarkerType(), options);
iMarkerView.setMarker(marker);
marker.setToTop();
return marker;
}

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<dimen name="dp_32">42px</dimen>
<dimen name="module_v2n_tip_width">628px</dimen>
<dimen name="module_v2n_tip_height">188px</dimen>
<dimen name="module_v2n_tip_text_width">106px</dimen>
<dimen name="module_v2n_tip_text_margin_right">52px</dimen>
<dimen name="module_v2n_image_margin_left">37px</dimen>
</resources>

View File

@@ -1123,5 +1123,11 @@
<dimen name="module_map_amap_my_location_bg_size">360px</dimen>
<dimen name="module_map_amap_my_location_icon_width">63px</dimen>
<dimen name="module_map_amap_my_location_icon_height">96px</dimen>
<dimen name="module_v2n_tip_width">470px</dimen>
<dimen name="module_v2n_tip_height">140px</dimen>
<dimen name="module_v2n_tip_text_width">100px</dimen>
<dimen name="module_v2n_tip_text_margin_right">28px</dimen>
<dimen name="module_v2n_image_margin_left">28px</dimen>
</resources>

View File

@@ -46,6 +46,7 @@ import com.mogo.map.navi.MogoTraffic;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.module.common.ModuleNames;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.dialog.WMDialog;
import com.mogo.module.common.glide.SkinAbleBitmapTarget;
@@ -180,6 +181,9 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
private boolean isShowGuide;
private ImageView mSwitchMapModeImage;
private FrameLayout mSwitchMapModeLayout;
/**
* 搜索莫模块
*/
@@ -205,7 +209,6 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
/**
* 内部变量标识是否在vrMode用于方法执行过滤避免重复或异常调用
*/
@@ -369,6 +372,11 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
tvYellow = (TextView) findViewById(R.id.tv_yellow);
tvRed = (TextView) findViewById(R.id.tv_red);
tvGreen = (TextView) findViewById(R.id.tv_green);
mSwitchMapModeLayout = (FrameLayout) findViewById(R.id.module_switch_model_layout);
mSwitchMapModeImage = (ImageView) findViewById(R.id.module_switch_model_icon);
mSwitchMapModeImage.setOnClickListener(clickListener);
}
private int debugPanelClickCount = 0;
@@ -400,6 +408,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
localIsVrMode = true;
flSpeed.setVisibility(View.VISIBLE);
mSwitchMapModeLayout.setVisibility(View.VISIBLE);
// clTrafficLight.setVisibility(View.VISIBLE);
}
}
@@ -427,6 +436,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().unregisterMogoLocationListener(TAG);
localIsVrMode = false;
flSpeed.setVisibility(View.GONE);
mSwitchMapModeLayout.setVisibility(View.GONE);
clTrafficLight.setVisibility(View.GONE);
}
}
@@ -1085,7 +1095,13 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
@Override
public void onMapVisualAngleChanged(VisualAngleMode visualAngleMode) {
//todo visual
if (visualAngleMode.isMediumSight()) {
mSwitchMapModeLayout.setVisibility(View.VISIBLE);
} else if (visualAngleMode.isLongSight()) {
mSwitchMapModeLayout.setVisibility(View.VISIBLE);
} else if (visualAngleMode.isCloseSight()) {
mSwitchMapModeLayout.setVisibility(View.GONE);
}
}
private static final int SEEK_HELP_NOTICE_NUM_MSG_TYPE = 401015;
@@ -1329,11 +1345,22 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
// show panel
debugPanelGroup.setVisibility(View.VISIBLE);
}
}
} else if (v.getId() == R.id.module_switch_model_icon) { //切换地图的远近视图
if (MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().getCurrentMapVisualAngle().isLongSight()) {
MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(AbsMogoApplication.getApp()).visibleAllMarkers();
MogoApisHandler.getInstance().getApis().getMapServiceApi()
.getMapUIController().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT);
} else if (MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().getCurrentMapVisualAngle().isMediumSight()) {
MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(AbsMogoApplication.getApp()).inVisibleAllMarkers();
MogoApisHandler.getInstance().getApis().getMapServiceApi()
.getMapUIController().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT);
}
}
}
};
@Override
public void onCarLocationChanged2(Location location) {
vrModeNavInfoView.refreshCurrentSpeed((int) (location.getSpeed() * 3.6F));

View File

@@ -15,6 +15,8 @@ import android.view.View;
import androidx.annotation.Nullable;
import com.mogo.module.extensions.R;
/**
* created by wujifei on 2021/3/24 16:20
* describe:
@@ -28,7 +30,7 @@ public class ArcView extends View {
//圆弧颜色
private int mArcColor;
//圆弧的画笔的宽度
private float mStrokeWith = 10;
private float mStrokeWith = getResources().getDimension(R.dimen.module_ext_arcView_stroke_with);
//文字描述的paint
private Paint mTextPaint;
@@ -73,11 +75,11 @@ public class ArcView extends View {
mTextPaint.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
//绘制中心的数值
mTextPaint.getTextBounds(mValue, 0, mValue.length(), mRect);
canvas.drawText(mValue, getWidth() / 2, getHeight() / 2 + mRect.height() / 2-10, mTextPaint);
canvas.drawText(mValue, getWidth() / 2, getHeight() / 2 + mRect.height() / 2 - 10, mTextPaint);
mTextPaint.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
//绘制中心文字描述
mTextPaint.setTextSize(28);
mTextPaint.setTextSize(getResources().getDimension(R.dimen.module_ext_arcView_des_text_size));
mTextPaint.getTextBounds(mDes, 0, mDes.length(), mRect);
canvas.drawText(mDes, getWidth() / 2, getHeight() * 17 / 20 + mRect.height() / 2, mTextPaint);
}
@@ -116,7 +118,7 @@ public class ArcView extends View {
//设置文本的对齐方式
mTextPaint.setTextAlign(Paint.Align.CENTER);
//mTextPaint.setTextSize(getResources().getDimensionPixelSize(R.dimen.dp_12));
mTextPaint.setTextSize(80);
mTextPaint.setTextSize(getResources().getDimension(R.dimen.module_ext_arcView_center_text_size));
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 B

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="26px" />
<solid android:color="@color/module_switch_map_bg" />
</shape>

View File

@@ -6,8 +6,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
layout="@layout/module_ext_layout_extensions"
android:layout_width="match_parent"
@@ -28,8 +26,8 @@
<FrameLayout
android:id="@+id/fl_speed"
android:layout_width="@dimen/dp_300"
android:layout_height="@dimen/dp_300"
android:layout_width="@dimen/module_ext_speed_width"
android:layout_height="@dimen/module_ext_speed_height"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_10"
android:background="@drawable/yi_biao_pan_bg_nor"
@@ -41,9 +39,32 @@
<com.mogo.module.extensions.view.ArcView
android:id="@+id/moudule_arc"
android:layout_width="@dimen/dp_200"
android:layout_height="@dimen/dp_200"
android:layout_width="@dimen/module_ext_arcView_width"
android:layout_height="@dimen/module_ext_arcView_height"
android:layout_gravity="center" />
</FrameLayout>
<!--切换地图远近事件-->
<FrameLayout
android:id="@+id/module_switch_model_layout"
android:layout_width="@dimen/module_switch_map"
android:layout_height="@dimen/module_switch_map"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginBottom="26px"
android:elevation="@dimen/dp_10"
android:padding="@dimen/dp_20"
android:visibility="gone"
android:background="@drawable/module_switch_map_bg"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toBottomOf="parent">
<ImageView
android:id="@+id/module_switch_model_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/module_switch_map_angle" />
</FrameLayout>
<androidx.constraintlayout.widget.ConstraintLayout

View File

@@ -163,4 +163,6 @@
<dimen name="module_event_live_error_text_size">36px</dimen>
<dimen name="module_video_window_height_content">393px</dimen>
<dimen name="module_video_window_width_content">700px</dimen>
<dimen name="module_switch_map">108px</dimen>
</resources>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_ext_top_view_width_in_vr_mode">1100px</dimen>
<dimen name="module_ext_speed_width">460px</dimen>
<dimen name="module_ext_speed_height">460px</dimen>
<dimen name="module_ext_arcView_width">320px</dimen>
<dimen name="module_ext_arcView_height">320px</dimen>
<dimen name="module_ext_arcView_stroke_with">15px</dimen>
<dimen name="module_ext_arcView_center_text_size">110px</dimen>
<dimen name="module_ext_arcView_des_text_size">40px</dimen>
</resources>

View File

@@ -0,0 +1,167 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- module_ext_layout_entrance.xml-->
<dimen name="module_ext_search_height">90px</dimen>
<dimen name="module_ext_search_marginLeft">32px</dimen>
<dimen name="module_ext_search_marginTop">2px</dimen>
<dimen name="module_ext_search_drawablePadding">16px</dimen>
<dimen name="module_ext_search_paddingLeft">26px</dimen>
<dimen name="module_ext_search_paddingRight">26px</dimen>
<dimen name="module_ext_search_textSize">32px</dimen>
<dimen name="module_ext_common_address_height">90px</dimen>
<dimen name="module_ext_common_address_marginLeft">32px</dimen>
<dimen name="module_ext_common_address_marginTop">2px</dimen>
<dimen name="module_ext_common_address_home_width">100px</dimen>
<dimen name="module_ext_common_address_home_height">90px</dimen>
<dimen name="module_ext_common_address_divider_width">2px</dimen>
<dimen name="module_ext_common_address_divider_height">54px</dimen>
<dimen name="module_ext_common_address_company_width">100px</dimen>
<dimen name="module_ext_common_address_company_height">90px</dimen>
<dimen name="module_ext_weather_space_between_icon_and_tem">8px</dimen>
<dimen name="module_ext_speed_limit_width">180px</dimen>
<dimen name="module_ext_speed_limit_height">180px</dimen>
<dimen name="module_ext_speed_limit_marginTop">2px</dimen>
<dimen name="module_ext_speed_limit_marginRight">60px</dimen>
<dimen name="module_ext_speed_limit_value_textSize">60px</dimen>
<dimen name="module_ext_speed_limit_unit_textSize">28px</dimen>
<dimen name="module_ext_navi_panel_marginLeft">32px</dimen>
<dimen name="module_ext_navi_panel_marginTop">2px</dimen>
<dimen name="module_ext_operation_panel_width">140px</dimen>
<dimen name="module_ext_operation_panel_marginRight">32px</dimen>
<dimen name="module_ext_operation_panel_marginBottom">60px</dimen>
<dimen name="module_ext_operation_panel_vr_height">92px</dimen>
<dimen name="module_ext_operation_panel_vr_textSize">24px</dimen>
<dimen name="module_ext_operation_panel_divider_width">48px</dimen>
<dimen name="module_ext_operation_panel_divider_height">2px</dimen>
<dimen name="module_ext_operation_panel_move2_height">140px</dimen>
<dimen name="module_ext_operation_panel_share_width">140px</dimen>
<dimen name="module_ext_operation_panel_share_height">120px</dimen>
<dimen name="module_ext_operation_panel_share_marginBottom">20px</dimen>
<dimen name="module_ext_operation_panel_share_textSize">30px</dimen>
<dimen name="module_ext_operation_panel_share_goneMarginBottom">32px</dimen>
<dimen name="module_ext_operation_panel_share_goneMarginRight">32px</dimen>
<dimen name="module_ext_navi_exit_width">120px</dimen>
<dimen name="module_ext_navi_exit_height">120px</dimen>
<dimen name="module_ext_navi_exit_marginLeft">32px</dimen>
<dimen name="module_ext_navi_exit_marginBottom">60px</dimen>
<dimen name="module_ext_button_container_marginLeft">32px</dimen>
<dimen name="module_ext_button_container_marginBottom">60px</dimen>
<dimen name="module_ext_navi_exit_textSize">32px</dimen>
<dimen name="v2x_cancel_help_text_size">30px</dimen>
<dimen name="module_entrance_id_button_marginTop">20px</dimen>
<!-- module_ext_layout_extensions.xml-->
<dimen name="module_ext_height">120px</dimen>
<dimen name="module_ext_paddingRight">60px</dimen>
<dimen name="module_ext_paddingLeft">60px</dimen>
<dimen name="module_ext_voice_textSize">32px</dimen>
<dimen name="module_ext_time_textSize">48px</dimen>
<dimen name="module_ext_date_marginRight">80px</dimen>
<dimen name="module_ext_date_textSize">28px</dimen>
<dimen name="module_ext_weather_marginRight">26px</dimen>
<dimen name="module_ext_weather_icon_width">44px</dimen>
<dimen name="module_ext_weather_icon_height">44px</dimen>
<dimen name="module_ext_weather_temp_marginRight">18px</dimen>
<dimen name="module_ext_weather_temp_textSize">34px</dimen>
<dimen name="module_ext_weather_temp_desc_marginRight">26px</dimen>
<dimen name="module_ext_weather_temp_desc_textSize">28px</dimen>
<dimen name="module_ext_msg_marginRight">30px</dimen>
<dimen name="module_ext_msg_counter_width">30px</dimen>
<dimen name="module_ext_msg_counter_height">30px</dimen>
<dimen name="module_ext_msg_counter_textSize">20px</dimen>
<dimen name="module_ext_user_img_width">103px</dimen>
<dimen name="module_ext_user_img_height">103px</dimen>
<!-- module_map_layout_navi_info_panel.xml-->
<dimen name="module_ext_navi_info_panel_width">1058px</dimen>
<dimen name="module_ext_navi_info_panel_height">210px</dimen>
<dimen name="module_ext_navi_info_panel_small_height">144px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_width">159px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_height">159px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_small_width">70px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_small_height">70px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_marginLeft">56px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_small_marginLeft">83px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_marginTop">24px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_marginTop">40px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_textSize">60px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_textSize_small">50px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_unit_marginLeft">12px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_unit_marginBottom">10px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_unit_textSize">40px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_unit_textSize_small">30px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_road_textSize">34px</dimen>
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_marginTop">24px</dimen>
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_textSize">28px</dimen>
<dimen name="module_ext_navi_info_turn_icon_margin_bottom">23px</dimen>
<dimen name="module_ext_voice_msg_padding_top">17px</dimen>
<dimen name="module_ext_voice_msg_padding_bottom">17px</dimen>
<dimen name="module_ext_voice_msg_padding_left">36px</dimen>
<dimen name="module_ext_voice_msg_padding_right">36px</dimen>
<dimen name="module_ext_voice_msg_icon_margin_left">-2px</dimen>
<dimen name="module_ext_navi_extra_info_margin_right">95px</dimen>
<dimen name="module_ext_weather_bkg_corner">30px</dimen>
<dimen name="module_ext_weather_container_paddingLeft">40px</dimen>
<dimen name="module_ext_weather_container_paddingRight">40px</dimen>
<dimen name="module_ext_msg_dot_marginLeft">15px</dimen>
<dimen name="module_ext_msg_dot_marginRight">15px</dimen>
<dimen name="module_ext_navi_next_info_road_marginTop">5px</dimen>
<dimen name="module_ext_remaining_info_marginRight">50px</dimen>
<dimen name="module_ext_remaining_distance_textSize">56px</dimen>
<dimen name="module_ext_remaining_distance_unit_textSize">30px</dimen>
<dimen name="module_ext_remaining_time_textSize">56px</dimen>
<dimen name="module_ext_remaining_time_unit_textSize">30px</dimen>
<dimen name="module_ext_arrive_time_textSize">56px</dimen>
<dimen name="module_ext_arrive_time_unit_textSize">30px</dimen>
<dimen name="module_map_navi_next_info_road_turn_marginLeft">15px</dimen>
<dimen name="module_map_navi_next_info_road_turn_marginRight">15px</dimen>
<!-- 导航查看全程显示范围-->
<dimen name="module_map_display_overview_left_margin">1000px</dimen>
<dimen name="module_map_display_overview_top_margin">390px</dimen>
<dimen name="module_map_display_overview_bottom_margin">200px</dimen>
<dimen name="module_map_display_overview_right_margin">200px</dimen>
<dimen name="module_ext_north_goneMarginTop">240px</dimen>
<dimen name="module_ext_common_corner">30px</dimen>
<dimen name="module_ext_button_width">120px</dimen>
<dimen name="module_ext_button_height">120px</dimen>
<dimen name="module_ext_camera_button_marginTop">10px</dimen>
<dimen name="module_ext_display_overview_textSize">22px</dimen>
<dimen name="module_ext_display_overview_textSize_large">28px</dimen>
<dimen name="module_ext_north_textSize">28px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_next_step_textSize">30px</dimen>
<dimen name="module_entrance_id_uploading_width">90px</dimen>
<dimen name="module_entrance_id_uploading_height">90px</dimen>
<dimen name="module_map_id_navi_next_info_distance_marginTop">6dp</dimen>
<dimen name="module_map_id_navi_next_info_road_marginBottom">15px</dimen>
<dimen name="module_map_id_navi_next_info_road_marginBottom_small">4px</dimen>
<dimen name="module_map_id_navi_next_info_distance_marginStart">10px</dimen>
<dimen name="module_ext_display_overview_icon_marginTop">20px</dimen>
<dimen name="module_ext_top_over_navi_height">40px</dimen>
<dimen name="module_ext_msg_counter_margin">45px</dimen>
<dimen name="module_ext_user_avator_size">100px</dimen>
<dimen name="module_ext_user_avator_board_size">134px</dimen>
<dimen name="module_ext_layout_padding">30px</dimen>
<dimen name="module_ext_layout_paddingRight">20px</dimen>
<dimen name="module_ext_layout_paddingBottom">20px</dimen>
<dimen name="module_ext_destination_online_car_drawablePadding">8px</dimen>
<dimen name="module_ext_destination_online_car_paddingLeft">21px</dimen>
<dimen name="module_ext_destination_online_car_paddingRight">31px</dimen>
<dimen name="module_ext_top_view_max_width">1920px</dimen>
<dimen name="module_ext_navi_width">-1</dimen>
<dimen name="module_ext_bottom_btn_margin_bottom">0px</dimen>
<dimen name="module_event_live_error_text_size">36px</dimen>
<dimen name="module_video_window_height_content">393px</dimen>
<dimen name="module_video_window_width_content">700px</dimen>
<dimen name="module_switch_map">145px</dimen>
</resources>

View File

@@ -98,7 +98,8 @@
<dimen name="module_ext_navi_info_panel_next_info_distance_unit_textSize">40px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_unit_textSize_small">30px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_road_textSize">34px</dimen>
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_marginTop">24px</dimen>
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_marginTop">24px
</dimen>
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_textSize">28px</dimen>
<dimen name="module_ext_navi_info_turn_icon_margin_bottom">24px</dimen>
<dimen name="module_ext_voice_msg_padding_top">17px</dimen>
@@ -181,4 +182,13 @@
<dimen name="module_video_window_height_content">393px</dimen>
<dimen name="module_video_window_width_content">700px</dimen>
<dimen name="module_ext_speed_width">300px</dimen>
<dimen name="module_ext_speed_height">300px</dimen>
<dimen name="module_ext_arcView_width">200px</dimen>
<dimen name="module_ext_arcView_height">200px</dimen>
<dimen name="module_ext_arcView_stroke_with">10px</dimen>
<dimen name="module_ext_arcView_center_text_size">80px</dimen>
<dimen name="module_ext_arcView_des_text_size">28px</dimen>
</resources>

View File

@@ -14,4 +14,5 @@
<color name="arc_speeding">#DB3137</color>
<color name="arc_speed">#3E77F6</color>
<color name="module_switch_map_bg">#3B4577</color>
</resources>

View File

@@ -244,5 +244,5 @@
<dimen name="module_video_window_width_content">400px</dimen>
<dimen name="module_video_window_height_content">300px</dimen>
<dimen name="module_switch_map">108px</dimen>
</resources>

View File

@@ -2,6 +2,8 @@ package com.mogo.module.main.utils;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.content.res.Resources;
import android.util.DisplayMetrics;
import android.view.View;
import com.mogo.module.main.R;
@@ -44,4 +46,9 @@ public class DisplayEffectsHelper {
public void display() {
animatorSet.start();
}
private float dp2px(float dp) {
DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics();
return dp * metrics.density;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 784 KiB

View File

@@ -15,6 +15,7 @@ import com.mogo.map.marker.IMogoMarker
import com.mogo.map.marker.IMogoMarkerClickListener
import com.mogo.map.marker.MogoMarkerOptions
import com.mogo.map.search.geo.MogoPoiItem
import com.mogo.module.common.MogoApisHandler
import com.mogo.module.common.map.MapCenterPointStrategy
import com.mogo.module.common.map.Scene
import com.mogo.module.common.utils.CarSeries
@@ -188,7 +189,7 @@ class CategorySearchFragment : BaseFragment(), CategoryView, IMogoVoiceCmdCallBa
current.setToTop()
arrayList[mAdapter.lastPosition].icon(getMarkerIcon(mAdapter.lastPosition))
arrayList[mAdapter.current].icon(getMarkerIcon(mAdapter.current))
if (moveToCenter) {
if (moveToCenter && !MogoApisHandler.getInstance().apis.statusManagerApi.isVrMode) {
SearchApisHolder.getStatusManager().setUserInteractionStatus(TAG, true, false)
SearchApisHolder.getUiControllerApis().moveToCenter(current.position, CarSeries.isF8xxSeries())
}

View File

@@ -35,6 +35,7 @@ import com.mogo.module.common.uploadintime.SnapshotLocationController;
import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.service.R;
import com.mogo.module.service.status.EnvStatusManager;
import com.mogo.module.service.timedelay.TimeDelayUploadManager;
import com.mogo.realtime.entity.ADASRecognizedResult;
import com.mogo.realtime.entity.CloudRoadData;
import com.mogo.realtime.entity.MogoSnapshotSetData;
@@ -338,7 +339,9 @@ public class MockIntentHandler implements IntentHandler {
MarkerServiceHandler.getApis().getRefreshStrategyControllerApi().restartAutoRefreshAtTime(duration);
IMogoMarker marker = MarkerServiceHandler.getMarkerManager().addMarker(TAG, options);
MarkerServiceHandler.getMogoStatusManager().setUserInteractionStatus(TAG, true, false);
MarkerServiceHandler.getMapUIController().moveToCenter(mogoLatLngs.get(0));
if(!MarkerServiceHandler.getApis().getStatusManagerApi().isVrMode()){
MarkerServiceHandler.getMapUIController().moveToCenter(mogoLatLngs.get(0));
}
WorkThreadHandler.getInstance().post(() -> marker.startSmooth(mogoLatLngs, duration));
break;
}
@@ -615,6 +618,10 @@ public class MockIntentHandler implements IntentHandler {
case 54:
mTimeTickCarHandler.sendEmptyMessageDelayed(1, 0L);
break;
case 55:
//开启模拟数据Mock用于验证算法准确性
TimeDelayUploadManager.getInstance().init(context);
break;
}
}

View File

@@ -170,7 +170,9 @@ class OnlineCarSearchIntentHandler implements IntentHandler {
int radius ) {
MarkerServiceHandler.getApis().getRefreshStrategyControllerApi().restartAutoRefreshAtTime( 30_000 );
MarkerServiceHandler.getMogoStatusManager().setUserInteractionStatus( TAG, true, false );
MarkerServiceHandler.getMapUIController().moveToCenter( target );
if(!MarkerServiceHandler.getApis().getStatusManagerApi().isVrMode()){
MarkerServiceHandler.getMapUIController().moveToCenter( target );
}
MapMarkerManager.getInstance().getOnlineCarDataByVoiceControl(
target,
onlyFocus,

View File

@@ -698,7 +698,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
* @return
*/
private boolean ignoreOnlineCarRequest() {
return ignoreDrawRequest();
return ignoreDrawRequest() || MarkerServiceHandler.getMogoStatusManager().isVrMode();
}
/**

View File

@@ -0,0 +1,21 @@
package com.mogo.module.service.network;
import com.mogo.module.common.entity.MarkerResponse;
import java.util.Map;
import io.reactivex.Observable;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
public interface TimeDelayApiService {
/**
* 上报延时时间
*/
@FormUrlEncoded
@POST("/yycp-computer-vision-service/mockEye/delayTimeCallBack")
Observable<Object> uploadDelayData(@FieldMap Map<String, Object> parameters);
}

View File

@@ -0,0 +1,50 @@
package com.mogo.module.service.network.bean;
public class MockSocketReceiverData {
public static final int MOCK_RECEIVER_STATUS_START = 0;
public static final int MOCK_RECEIVER_STATUS_STOP = 1;
private int status;
private double lat;
private double lon;
private double heading;
private long systemTime;
private long satelliteTime;
public int getStatus() {
return status;
}
public double getLat() {
return lat;
}
public double getLon() {
return lon;
}
public double getHeading() {
return heading;
}
public long getSystemTime() {
return systemTime;
}
public long getSatelliteTime() {
return satelliteTime;
}
@Override
public String toString() {
return "MockSocketReceiverData{" +
"status=" + status +
", lat=" + lat +
", lon=" + lon +
", heading=" + heading +
", systemTime=" + systemTime +
", satelliteTime=" + satelliteTime +
'}';
}
}

View File

@@ -0,0 +1,24 @@
package com.mogo.module.service.timedelay;
import com.mogo.commons.debug.DebugConfig;
public class MockDataDelayUploadHttpConstant {
public static final String HOST_DEV = "http://dzt-test.zhidaozhixing.com";
public static final String HOST_TEST = "http://dzt-test.zhidaozhixing.com";
public static final String HOST_DEMO = "http://dzt-show.zhidaozhixing.com";
public static final String HOST_PRODUCT = "http://dzt.zhidaozhixing.com";
public static String getBaseUrl() {
switch (DebugConfig.getNetMode()) {
case DebugConfig.NET_MODE_DEV:
return HOST_DEV;
case DebugConfig.NET_MODE_QA:
return HOST_TEST;
case DebugConfig.NET_MODE_DEMO:
return HOST_DEMO;
default:
return HOST_PRODUCT;
}
}
}

View File

@@ -0,0 +1,137 @@
package com.mogo.module.service.timedelay;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.uploadintime.SnapshotLocationController;
import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.service.network.TimeDelayApiService;
import com.mogo.module.service.network.bean.MockSocketReceiverData;
import com.mogo.realtime.api.MoGoAiCloudRealTime;
import com.mogo.realtime.entity.MogoSnapshotSetData;
import com.mogo.realtime.socket.IMogoCloudOnMsgListener;
import com.mogo.service.connection.IMogoOnMessageListener;
import com.mogo.utils.WorkThreadHandler;
import com.mogo.utils.logger.Logger;
import org.json.JSONException;
import org.json.JSONObject;
import io.reactivex.schedulers.Schedulers;
import rx.android.schedulers.AndroidSchedulers;
import static com.mogo.module.service.network.bean.MockSocketReceiverData.MOCK_RECEIVER_STATUS_START;
/**
* 接收服务端模拟定位数据对下发数据做实时Post上报统计时延
*/
public class TimeDelayUploadManager implements IMogoOnMessageListener<MockSocketReceiverData>, IMogoCloudOnMsgListener {
private static final String TAG = "TimeDelayUploadManager";
private volatile static TimeDelayUploadManager timeDelayUploadManager;
private static final int MSG_SOCKET_TYPE = 403000;
private static final int MOCK_MSG = 1;
private boolean isMockData = false;
private MockSocketReceiverData mMockData;
private long mRecordSatelliteTime; //todo 后续多点模拟用
private TimeDelayApiService timeDelayApiService;
private TimeDelayUploadManager() {
}
public static TimeDelayUploadManager getInstance() {
if (timeDelayUploadManager == null) {
synchronized (TimeDelayUploadManager.class) {
if (timeDelayUploadManager == null) {
timeDelayUploadManager = new TimeDelayUploadManager();
}
}
}
return timeDelayUploadManager;
}
public void init(Context mContext) {
MogoApisHandler.getInstance()
.getApis()
.getSocketManagerApi(mContext).registerOnMessageListener(MSG_SOCKET_TYPE, this);
MoGoAiCloudRealTime.registerOnMsgListener(this);
}
private final Handler mockHandler = new Handler(WorkThreadHandler.newInstance("mock-algorithm-work-thread").getLooper()) {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
if (msg.what == MOCK_MSG) {
//改变地图定位数据,触发自车移动
JSONObject jo = new JSONObject();
try {
jo.put("lon", mMockData.getLon());
jo.put("lat", mMockData.getLat());
jo.put("heading", mMockData.getHeading());
jo.put("systemTime", System.currentTimeMillis());
jo.put("satelliteTime", System.currentTimeMillis());
} catch (JSONException e) {
e.printStackTrace();
}
Logger.d(TAG, "更改自车定位点");
MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().syncLocation2Map(jo);
Logger.d(TAG, "同步定位信息,用于上报");
SnapshotLocationController.getInstance().syncAdasLocationInfo(jo);
mockHandler.sendEmptyMessageDelayed(MOCK_MSG, 50);
}
}
};
@Override
public Class<MockSocketReceiverData> target() {
return MockSocketReceiverData.class;
}
//接收socket数据
@Override
public void onMsgReceived(MockSocketReceiverData mockData) {
Logger.d(TAG, "onMsgReceived obj : " + mockData.toString());
if (mockData.getStatus() == MOCK_RECEIVER_STATUS_START) { //todo 暂时以单条数据发送后续多点实时发送Message
isMockData = true;
//开启定位模拟
mMockData = mockData;
mRecordSatelliteTime = mockData.getSatelliteTime();
mockHandler.sendEmptyMessage(MOCK_MSG);
if (timeDelayApiService == null) {
timeDelayApiService = MogoApisHandler.getInstance().getApis().getNetworkApi().create(TimeDelayApiService.class, MockDataDelayUploadHttpConstant.getBaseUrl());
}
} else {
isMockData = false;
//停止定位模拟
if (mockHandler.hasMessages(MOCK_MSG)) {
mockHandler.removeMessages(MOCK_MSG);
mMockData = null;
mRecordSatelliteTime = 0;
timeDelayApiService = null;
}
}
}
@Override
public void onMsgSend(long id) {
}
//接收实时数据监听回调,用于给服务端上报时延
@Override
public void onMsgReceived(MogoSnapshotSetData mogoSnapshotSetData) {
if (isMockData) {
//接口数据上报
// timeDelayApiService.uploadDelayData()
// .subscribeOn(Schedulers.io())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe()
}
}
}

View File

@@ -498,7 +498,9 @@ public class TanluManager implements IMogoMarkerClickListener,
Logger.d(TAG, "moveToMarcker lat = " + lat + " >>>>lon = " + lon);
MogoLatLng latLng = new MogoLatLng(lat, lon);
mMogoStatusManager.setUserInteractionStatus(TAG, true, false);
mMApUIController.moveToCenter(latLng);
if(!mMogoStatusManager.isVrMode()){
mMApUIController.moveToCenter(latLng);
}
}
private void moveNotFresh() {

View File

@@ -1,20 +1,13 @@
package com.mogo.module.v2x;
import android.content.Context;
import android.util.Log;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.map.MogoLatLng;
import com.mogo.map.location.IMogoLocationClient;
import com.mogo.map.marker.IMogoMarkerManager;
import com.mogo.map.navi.IMogoNavi;
import com.mogo.map.overlay.IMogoOverlayManager;
import com.mogo.map.overlay.IMogoPolyline;
import com.mogo.map.search.geo.IMogoGeoSearch;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.drawer.AdasRecognizedResultDrawer;
import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.v2x.alarm.V2XCalculateServer;
import com.mogo.module.v2x.manager.IMoGoPersonWarnPolylineManager;
import com.mogo.module.v2x.manager.IMoGoStopPolylineManager;
@@ -23,10 +16,8 @@ import com.mogo.module.v2x.manager.IMoGoV2XMarkerManager;
import com.mogo.module.v2x.manager.IMoGoV2XPolylineManager;
import com.mogo.module.v2x.manager.IMoGoV2XStatusManager;
import com.mogo.module.v2x.manager.IMoGoWarnPolylineManager;
import com.mogo.module.v2x.manager.impl.MoGoV2XCloundDataManager;
import com.mogo.module.v2x.network.V2XRefreshModel;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.realtime.entity.ADASRecognizedResult;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.adas.IMogoADASController;

View File

@@ -10,6 +10,7 @@ import com.mogo.module.v2x.listener.V2XMessageListener_401010;
import com.mogo.module.v2x.listener.V2XMessageListener_401011;
import com.mogo.module.v2x.listener.V2XMessageListener_401012;
import com.mogo.module.v2x.listener.V2XMessageListener_402000;
import com.mogo.module.v2x.listener.V2XMessageListener_402001;
import com.mogo.utils.logger.Logger;
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
@@ -34,7 +35,7 @@ public class V2XSocketManager {
private V2XMessageListener_401009 v2XMessageListener_401009;
private V2XMessageListener_401010 v2XMessageListener_401010;
private V2XMessageListener_402000 mV2XMessageListener_402000;
private V2XMessageListener_402001 mV2XMessageListener402001;
private V2XSocketManager() {
}
@@ -65,6 +66,7 @@ public class V2XSocketManager {
register401007();
register401009();
register401020();
registerWarningMsg();
// TODO 这里是前瞻需求,量产版本需要注释
register401003();
@@ -72,6 +74,7 @@ public class V2XSocketManager {
//register401006();
}
/**
* 反注册消息通道,不再进行接受
*/
@@ -225,6 +228,7 @@ public class V2XSocketManager {
v2XMessageListener_401009
);
}
/**
* * 车路云—场景预警-V1.0
* * http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=52829799
@@ -241,6 +245,16 @@ public class V2XSocketManager {
);
}
/**
* * 车路云—场景预警-V1.0
* * http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=52829799
* * 弱势交通参与者
*/
public void registerWarningMsg() {
mV2XMessageListener402001 = new V2XMessageListener_402001();
V2XServiceManager.getMoGoSocketManager().registerOnMessageListener(402001, mV2XMessageListener402001);
}
/**
* * 2.0.3

View File

@@ -5,7 +5,7 @@ import android.content.Intent;
import android.util.Log;
import com.mogo.module.common.entity.V2XWarningEntity;
import com.mogo.module.v2x.listener.V2XWarnMessageListener;
import com.mogo.module.v2x.listener.V2XMessageListener_402001;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
@@ -22,7 +22,7 @@ public class V2XWaringManager {
private static V2XWaringManager mV2XWaringManager;
//TODO 需要修改
private V2XWarnMessageListener v2XWarnMessageListener;
private V2XMessageListener_402001 mV2XMessageListener402001;
private V2XWaringManager() {
@@ -83,7 +83,7 @@ public class V2XWaringManager {
// 加载数据源
V2XWarningEntity warningEntity = GsonUtil.objectFromJson(baos.toString(), V2XWarningEntity.class);
V2XServiceManager.getMoGoV2XCloundDataManager().analysisV2XCloundDataEvent(warningEntity);
// V2XServiceManager.getMoGoV2XCloundDataManager().analysisV2XCloundDataEvent(warningEntity);
} catch (Exception e) {
e.printStackTrace();
}
@@ -94,10 +94,10 @@ public class V2XWaringManager {
*/
public void unregisterAdasSocketMessage() {
Logger.w(V2XConst.LOG_NAME_WARN, "反注册Socket通道....");
if (v2XWarnMessageListener != null) {
if (mV2XMessageListener402001 != null) {
V2XServiceManager
.getMoGoSocketManager()
.unregisterOnMessageListener(401018, v2XWarnMessageListener);
.unregisterOnMessageListener(401018, mV2XMessageListener402001);
}
}
@@ -105,16 +105,16 @@ public class V2XWaringManager {
* 道路预警 弱势群体事件,行人 TODO type
*/
private void registerWarnListener() {
v2XWarnMessageListener = new V2XWarnMessageListener();
mV2XMessageListener402001 = new V2XMessageListener_402001();
V2XServiceManager
.getMoGoSocketManager()
.registerOnMessageListener(
401018,
v2XWarnMessageListener);
mV2XMessageListener402001);
}
public V2XWarnMessageListener getV2XMessageListener() {
return v2XWarnMessageListener;
public V2XMessageListener_402001 getV2XMessageListener() {
return mV2XMessageListener402001;
}

View File

@@ -0,0 +1,48 @@
package com.mogo.module.v2x.listener;
import android.content.Intent;
import android.util.Log;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XWarningEntity;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.entity.net.V2XOptimalRouteDataRes;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.service.connection.IMogoOnMessageListener;
/**
* desc: 下发的云端预警数据
*/
public class V2XMessageListener_402001 implements IMogoOnMessageListener<V2XOptimalRouteDataRes> {
@Override
public Class<V2XOptimalRouteDataRes> target() {
return V2XOptimalRouteDataRes.class;
}
@Override
public void onMsgReceived(V2XOptimalRouteDataRes info) {
Log.d(V2XConst.LOG_NAME_WARN, "V2XWarnMessageListener onMsgReceived ---11---> ");
//Logger.d(MODULE_NAME, "V2XMessageListener_401011==V2X地图气泡数据刷新\n" + GsonUtil.jsonFromObject(response));
V2XUtils.runOnBackgroundThread(() -> {
// 解析不同的Marker类型然后对应的进行绘制
if (info != null) {
// 解析存储道路事件 liyz
Log.d(V2XConst.LOG_NAME_WARN, "V2XWarnMessageListener onMsgReceived --22--> ");
V2XMessageEntity<V2XOptimalRouteDataRes> v2xMessageEntity = new V2XMessageEntity<>();
// 控制类型
v2xMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_VR_SHOW);
// 设置数据
v2xMessageEntity.setContent(info);
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2xMessageEntity);
LocalBroadcastManager.getInstance(V2XUtils.getApp()).sendBroadcast(intent);
}
});
}
}

View File

@@ -1,37 +0,0 @@
package com.mogo.module.v2x.listener;
import android.util.Log;
import com.mogo.module.common.entity.V2XWarningEntity;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.service.connection.IMogoOnMessageListener;
/**
* desc: 下发的云端预警数据
*
*/
public class V2XWarnMessageListener implements IMogoOnMessageListener<V2XWarningEntity> {
@Override
public Class<V2XWarningEntity> target() {
return V2XWarningEntity.class;
}
@Override
public void onMsgReceived(V2XWarningEntity info) {
Log.d(V2XConst.LOG_NAME_WARN, "V2XWarnMessageListener onMsgReceived ---11---> ");
//Logger.d(MODULE_NAME, "V2XMessageListener_401011==V2X地图气泡数据刷新\n" + GsonUtil.jsonFromObject(response));
V2XUtils.runOnBackgroundThread(() -> {
// 解析不同的Marker类型然后对应的进行绘制
if (info != null) {
// 解析存储道路事件 liyz
Log.d(V2XConst.LOG_NAME_WARN, "V2XWarnMessageListener onMsgReceived --22--> ");
V2XServiceManager.getMoGoV2XCloundDataManager().analysisV2XCloundDataEvent(info);
}
});
}
}

View File

@@ -7,8 +7,6 @@ import android.util.Log;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.map.MogoLatLng;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
import com.mogo.map.overlay.IMogoPolyline;
import com.mogo.module.common.MogoApisHandler;
@@ -80,7 +78,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
if (mV2XScenario == null) {
mV2XScenario = new V2XFrontWarningScenario();
}
mV2XScenario.setWarningEntity(cloundWarningInfo);
// mV2XScenario.setWarningEntity(cloundWarningInfo);
mV2XScenario.init(null);
//预警蒙层
MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection(cloundWarningInfo.getDirection(), MogoReceiver.ACTION_V2X_FRONT_WARNING);

View File

@@ -90,6 +90,9 @@ public class V2XRefreshModel {
}
/**
* 已经由
* @see com.mogo.module.v2x.V2XMarkerService
* 短链代替
* 刷新地图点数据,同步获取
*/
public void querySnapshotAsync(MogoLatLng latLng, int radius, int limit) {

View File

@@ -23,7 +23,7 @@ public class AdasDataBroadcastReceiver extends BroadcastReceiver {
// Logger.d(V2XConst.LOG_NAME_WARN, "AdasDataBroadcastReceiver -->" + GsonUtil.jsonFromObject(adasResult));
String adasResult = (String) intent.getSerializableExtra(V2XConst.BROADCAST_ADAS_EXTRA_KEY);
Log.d(V2XConst.LOG_NAME_WARN, "AdasDataBroadcastReceiver -----> ");
V2XWaringManager.getInstance().handleAdasData(intent);
// V2XWaringManager.getInstance().handleAdasData(intent);
} catch (Exception e) {
e.printStackTrace();

View File

@@ -25,6 +25,7 @@ import com.zhidao.carchattingprovider.MogoDriverInfo;
import java.util.List;
import static android.text.style.TtsSpan.GENDER_MALE;
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
/**
* V2X 测试面板广播接收,目的是可以通过广播调用起来面板
@@ -76,17 +77,9 @@ public class TestPanelBroadcastReceiver extends BroadcastReceiver {
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
// 存储本地,出行动态作展示
saveLocalStory(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING,
v2XMessageEntity.getContent().getNoveltyInfo());
} else if (sceneType == 2) {//车路云—场景预警-V1.0 碰撞预警
V2XMessageEntity<V2XWarningEntity> v2XMessageEntity =
TestOnLineCarUtils.getV2XScenarioPushFrontWarningEventData();
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
} else if (sceneType == 3) {//触发H5推送事件
V2XMessageEntity<V2XPushMessageEntity> v2XMessageEntity =
TestOnLineCarUtils.getV2XScenarioPushEventData();
@@ -110,7 +103,7 @@ public class TestPanelBroadcastReceiver extends BroadcastReceiver {
LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
} else if (sceneType == 6) {//查看前车直播
V2XVoiceCallLiveBiz.getInstance().getFrontCarLive();
} else if (sceneType == 7) {//查看前直播
} else if (sceneType == 7) {//查看前方路口直播
V2XVoiceCallLiveBiz.getInstance().getOpenRoadCameraLive();
} else if (sceneType == 8) {//触发疲劳驾驶
V2XMessageEntity<V2XPushMessageEntity> v2XMessageEntity =
@@ -141,17 +134,21 @@ public class TestPanelBroadcastReceiver extends BroadcastReceiver {
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
} else if (sceneType == 12) {//车路云场景预警-右侧
Intent intent = new Intent(V2XConst.BROADCAST_ADAS_SCENE_HANDLER_ACTION);
intent.putExtra(V2XConst.BROADCAST_ADAS_EXTRA_KEY, "right");
V2XMessageEntity messageEntity = TestOnLineCarUtils.getV2XScenarioPushFrontWarningEventData("right");
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, messageEntity);
LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
mContext.sendBroadcast(intent);
} else if (sceneType == 13) {//车路云场景预警-左侧
Intent intent = new Intent(V2XConst.BROADCAST_ADAS_SCENE_HANDLER_ACTION);
intent.putExtra(V2XConst.BROADCAST_ADAS_EXTRA_KEY, "left");
mContext.sendBroadcast(intent);
V2XMessageEntity messageEntity = TestOnLineCarUtils.getV2XScenarioPushFrontWarningEventData("left");
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, messageEntity);
LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
} else if (sceneType == 14) {//行人预警,行人路线预测 车路云预警-前方行人
Intent intent = new Intent(V2XConst.BROADCAST_ADAS_SCENE_HANDLER_ACTION);
intent.putExtra(V2XConst.BROADCAST_ADAS_EXTRA_KEY, "pedestrians");
mContext.sendBroadcast(intent);
V2XMessageEntity messageEntity = TestOnLineCarUtils.getV2XScenarioPushFrontWarningEventData("pedestrians");
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, messageEntity);
LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
} else if (sceneType == 15) {// 交通状况查询
V2XServiceManager.getIMogoTrafficUploadProvider().verifyCurrentTrafficStatus();
} else if (sceneType == 16) {//触发基于目的地预测的线路推荐
@@ -164,11 +161,19 @@ public class TestPanelBroadcastReceiver extends BroadcastReceiver {
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
} else if (sceneType == 18) { //test visualAngle UI
V2XServiceManager.getMapService().getMarkerManager(mContext).inVisibleAllMarkers();
V2XServiceManager.getMapService().getMapUIController().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT);
} else if (sceneType == 19) { //test visualAngle UI
V2XServiceManager.getMapService().getMapUIController().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT);
} else if (sceneType == 20) { //test visualAngle UI
V2XServiceManager.getMapService().getMapUIController().changeMapVisualAngle(VisualAngleMode.MODE_CLOSE_SIGHT);
} else if (sceneType == 21) {// 自车求助
V2XMessageEntity<Boolean> v2XMessageEntity =
TestOnLineCarUtils.getV2XScenarioCarForHelpEventData();
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
V2XServiceManager.getMoGoStatusManager().setSeekHelping(MODULE_NAME, true);
}
}

View File

@@ -4,6 +4,8 @@ import android.content.Intent;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
@@ -63,6 +65,7 @@ public class V2XScenarioManager implements IV2XScenarioManager {
V2XUtils.runOnUiThread(() -> {
// 提取之前存储的场景
if (v2XMessageEntity != null) {
sceneChange();
// 广播给应用内部其它模块
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_ACTION);
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
@@ -110,8 +113,8 @@ public class V2XScenarioManager implements IV2XScenarioManager {
case V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_LEFT:
case V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_RIGHT:
case V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_BOTTOM:
mV2XScenario = new V2XFrontWarningScenario();
if (V2XServiceManager.getMoGoStatusManager().isVrMode()) {
mV2XScenario = new V2XFrontWarningScenario();
} else {
mV2XScenario = null;
}
@@ -138,6 +141,17 @@ public class V2XScenarioManager implements IV2XScenarioManager {
}
}
/**
* http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=52833468
* 道路事件触发后,切换到中景
*/
private void sceneChange() {
if (MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().
getCurrentMapVisualAngle() != VisualAngleMode.MODE_MEDIUM_SIGHT) {
V2XServiceManager.getMapService().getMapUIController().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT);
}
}
private void hidOtherPanel() {
try {
// 与其它面板互斥

View File

@@ -84,7 +84,7 @@ public class V2XSeekHelpButton implements IV2XButton {
doAction();
});
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
(int) V2XUtils.getApp().getResources().getDimension(R.dimen.dp_150));
(int) V2XUtils.getApp().getResources().getDimension(R.dimen.module_v2x_car_for_help_window_height));
V2XServiceManager.getMogoTopViewManager().addView(topView, layoutParams);
}

View File

@@ -13,6 +13,7 @@ import com.mogo.commons.voice.AIAssist;
import com.mogo.map.location.MogoLocation;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XPushMessageEntity;
@@ -85,9 +86,22 @@ public class V2XVoiceCallLiveBiz implements IMogoMarkerClickListener{
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().registerMogoStaticMarkerClickListener(MAP_STATIC, this);
}
/**
* 地图上静态marker点击现在仅点击摄像头
* @param marker
* @return
*/
@Override
public boolean onStaticMarkerClicked(IMogoMarker marker) {
Log.d(REGISTER_LIFECYCLE_TAG,"onStaticMarkerClicked marker");
if(V2XServiceManager.getMapService().getMapUIController().getCurrentMapVisualAngle().isLongSight()){
Log.d(REGISTER_LIFECYCLE_TAG,"onStaticMarkerClicked marker is on LongSight, so don't response");
return false;
}
//拉近地图视角为近景
V2XServiceManager.getMapService().getMapUIController().changeMapVisualAngle(VisualAngleMode.MODE_CLOSE_SIGHT);
//移动地图中心点至marker位置
V2XServiceManager.getMapService().getMapUIController().moveToCenter(marker.getPosition(),true);
String assInfo = marker.getMarkerAssInfo();
Log.d(REGISTER_LIFECYCLE_TAG,"onStaticMarkerClicked marker assInfo : " + assInfo);
if (TextUtils.isEmpty(assInfo) || !assInfo.contains(MAP_STATIC_TRAFFIC)) {
@@ -161,6 +175,10 @@ public class V2XVoiceCallLiveBiz implements IMogoMarkerClickListener{
});
}
/**
* 获取特定路口摄像头直播
* @param assInfo 路口摄像头Id
*/
private void getSpecifiedOpenCameraLive(String assInfo) {
MoGoAiCloudTrafficLive.viewDesignativeIntersectionLive(assInfo, new ITrafficIntersectionLiveCallBack() {
@Override

View File

@@ -226,14 +226,14 @@ public class V2XTestConsoleWindow extends ConstraintLayout {
});
//车路云—场景预警-V1.0 碰撞预警
mBtnTriggerWarningEvent.setOnClickListener(v -> {
V2XMessageEntity<V2XWarningEntity> v2XMessageEntity =
TestOnLineCarUtils.getV2XScenarioPushFrontWarningEventData();
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
LocalBroadcastManager.getInstance(getContext()).sendBroadcast(intent);
});
// mBtnTriggerWarningEvent.setOnClickListener(v -> {
// V2XMessageEntity<V2XWarningEntity> v2XMessageEntity =
// TestOnLineCarUtils.getV2XScenarioPushFrontWarningEventData("right");
//
// Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
// intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
// LocalBroadcastManager.getInstance(getContext()).sendBroadcast(intent);
// });
mBtnTriggerPushEvent.setOnClickListener(v -> {
V2XMessageEntity<V2XPushMessageEntity> v2XMessageEntity =

View File

@@ -42,41 +42,33 @@ import java.util.List;
* @description 车路云—场景预警-V1.0 前车/行人/摩托车/盲区碰撞预警
* @since: 2021/3/24
*/
public class V2XFrontWarningScenario extends AbsV2XScenario implements IMogoTopViewStatusListener {
private int direction;
public class V2XFrontWarningScenario extends AbsV2XScenario implements IMogoTopViewStatusListener, IMogoCarLocationChangedListener2 {
private V2XWarningEntity mMarkerEntity;
static private V2XWarningMarker sV2XWarningMarker = new V2XWarningMarker();
public V2XFrontWarningScenario() {
setV2XWindow(new V2XWarningWindow());
// setV2XMarker(new V2XWarningMarker());
setV2XMarker(sV2XWarningMarker);
}
@Override
public void init(@Nullable V2XMessageEntity v2XMessageEntity) {
try {
if (v2XMessageEntity != null) {
if (v2XMessageEntity.getContent() != null) {
MogoApisHandler.getInstance().getApis().getRegisterCenterApi()
.registerCarLocationChangedListener(TAG, this);
if (V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) {
mMarkerEntity = (V2XWarningEntity) v2XMessageEntity.getContent();
direction = mMarkerEntity.getDirection();
MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection(direction, MogoReceiver.ACTION_V2X_FRONT_WARNING);
show();
drawPOI();
}
} else {
direction = mMarkerEntity.getDirection();
MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection(direction, MogoReceiver.ACTION_V2X_FRONT_WARNING);
show();
// drawPOI();
}
} catch (Exception e) {
e.printStackTrace();
}
}
public void setWarningEntity(V2XWarningEntity markerEntity) {
mMarkerEntity = markerEntity;
}
@Override
public void show() {
showWindow();
@@ -85,8 +77,6 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMogoTopV
@Override
public void showWindow() {
if (getV2XWindow() != null && mMarkerEntity != null) {
View view = getV2XWindow().getView();
//Logger.d(MODULE_NAME, "添加window= " + view);
ViewGroup.LayoutParams layoutParams =
new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
@@ -95,7 +85,7 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMogoTopV
.getMogoTopViewManager()
.addView(getV2XWindow().getView(), layoutParams, this);
getV2XWindow().show(mMarkerEntity);
// getV2XMarker().drawPOI(mMarkerEntity);
getV2XMarker().drawPOI(mMarkerEntity);
}
}
@@ -134,7 +124,7 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMogoTopV
@Override
public void onViewRemoved(View view) {
Log.d(TAG, "onViewRemoved");
}
@Override
@@ -147,4 +137,14 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMogoTopV
}
@Override
public void onCarLocationChanged2(Location latLng) {
sV2XWarningMarker.onCarLocationChanged2(latLng);
}
@Override
public void onCarLocationChanged(MogoLatLng latLng) {
}
}

View File

@@ -1,14 +1,18 @@
package com.mogo.module.v2x.scenario.scene.warning;
import android.content.Context;
import android.location.Location;
import android.util.Log;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.map.MogoLatLng;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
import com.mogo.map.overlay.IMogoPolyline;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.drawer.MarkerDrawer;
import com.mogo.module.common.drawer.V2XWarnDataDrawer;
import com.mogo.module.common.drawer.marker.EmptyMarkerView;
import com.mogo.module.common.drawer.marker.IMarkerView;
import com.mogo.module.common.drawer.marker.MapMarkerAdapter;
@@ -17,10 +21,13 @@ import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.common.entity.V2XWarningEntity;
import com.mogo.module.common.utils.Trigonometric;
import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.service.receiver.MogoReceiver;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.entity.model.DrawLineInfo;
import com.mogo.module.v2x.listener.V2XLocationListener;
import com.mogo.module.v2x.marker.OptimalSpeedMarkerView;
import com.mogo.module.v2x.marker.V2XFrontTargetMarkerView;
import com.mogo.module.v2x.scenario.view.IV2XMarker;
@@ -30,11 +37,15 @@ import com.mogo.utils.ViewUtils;
import com.mogo.utils.WorkThreadHandler;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_STOP_LINE_DATA;
import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_DATA;
import static com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_TOP;
import static com.mogo.module.v2x.V2XConst.V2X_FRONT_WARNING_MARKER;
import static com.mogo.module.v2x.V2XConst.V2X_OPTIMAL_SPEED_MARKER;
import static com.mogo.module.v2x.V2XServiceManager.getContext;
/**
* @author liujing
@@ -43,64 +54,316 @@ import static com.mogo.module.v2x.V2XConst.V2X_OPTIMAL_SPEED_MARKER;
*/
public class V2XWarningMarker implements IV2XMarker {
private static final String TAG = "V2XWarningMarker";
private V2XWarningEntity mMarkerEntity;
private MarkerShowEntity markerShowEntity = new MarkerShowEntity();
private Context mContext = V2XServiceManager.getContext();
private IMogoMarker optimalMarker = null;
private static String WARNING_ARROWS = "WARNING_ARROWS";
private V2XWarningEntity mCloundWarningInfo;
private boolean isSelfLineClear = true;//绘制线是否已被清除
private List fillPoints = new ArrayList();//停止线经纬度合集
private boolean isFirstLocation = false;
private MogoLatLng carLocation = new MogoLatLng(
MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLat(),
MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLon()
);
/*
* 自车前方的点,在停止线上--通过自车位置与距离停止线之间的距离计算
* */
private MogoLatLng middleLocationInStopLine;
private static long showTime = 5000;
private float bearing;
@Override
public void drawPOI(Object entity) {
try {
mMarkerEntity = (V2XWarningEntity) entity;
MarkerLocation location = new MarkerLocation();
location.setLat(mMarkerEntity.getLat());
location.setLon(mMarkerEntity.getLon());
markerShowEntity.setMarkerLocation(location);
MogoMarkerOptions optionsRipple = new MogoMarkerOptions()
.latitude(mMarkerEntity.getLat())
.longitude(mMarkerEntity.getLon())
.anchor(0.5f, 0.5f)
.zIndex(MarkerDrawer.MARKER_Z_INDEX_HIGH);
optionsRipple
.icon(ViewUtils.fromView(new EmptyMarkerView(mContext)));
optimalMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_FRONT_WARNING_MARKER, optionsRipple);
optimalMarker.setInfoWindowAdapter(new SimpleWindow3DAdapter(new V2XFrontTargetMarkerView(mContext)));
optimalMarker.showInfoWindow();
UiThreadHandler.postDelayed(() -> {
optimalMarker.hideInfoWindow();
}, 8000);
mCloundWarningInfo = (V2XWarningEntity) entity;
drawLineWithEntity();
} catch (Exception e) {
Log.d(TAG, e.toString());
}
}
public void drawLineWithEntity() {
showTime = mCloundWarningInfo.getShowTime() > 0 ? mCloundWarningInfo.getShowTime() : 5000;
Log.d(TAG, "显示时间为++" + String.valueOf(showTime));
pointsBetween();
bearing = V2XLocationListener.getInstance().getLastCarLocation().getBearing();
//预警蒙层
MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection(mCloundWarningInfo.getDirection(), MogoReceiver.ACTION_V2X_FRONT_WARNING);
isSelfLineClear = false;
isFirstLocation = false;
V2XServiceManager.getMarkerManager().removeMarkers(WARNING_ARROWS);
if (mCloundWarningInfo.getDirection() == ALERT_THE_FRONT_CRASH_WARNING_TOP) { //前方 TODO
middleLocationInStopLine = getMiddleLocationInStopLine();
//如果是正前方类型,红色绘制区域从停止线向前绘制50米
MogoLatLng warningLocation = Trigonometric.getNewLocation(middleLocationInStopLine, 50, mCloundWarningInfo.getAngle());
//停止线前方画线
WorkThreadHandler.getInstance().postDelayed(() -> {
//二轮车和行人的渲染和移动
V2XServiceManager.getMarkerManager().removeMarkers(TYPE_MARKER_CLOUD_WARN_DATA);
V2XWarnDataDrawer.getInstance().renderWarnData(mCloundWarningInfo);
//绘制识别物与交汇点连线,并且更新连线数据
drawRedWarningLineFrontOfStopLine(mCloundWarningInfo, middleLocationInStopLine, warningLocation);
//添加停止线marker
handleStopLine();
//自车画线
drawSelfCarLine(carLocation.lon, carLocation.lat, bearing);
}, 0);
@Override
public void clearPOI() {
V2XServiceManager.getMarkerManager().removeMarkers(V2X_FRONT_WARNING_MARKER);
UiThreadHandler.postDelayed(() -> {
V2XServiceManager.getMoGoPersonWarnPolylineManager().clearLine();
V2XServiceManager.getMoGoWarnPolylineManager().clearLine();
V2XServiceManager.getMoGoStopPolylineManager().clearLine();
isSelfLineClear = true;
}, showTime);
} else { //左侧或者右侧
WorkThreadHandler.getInstance().postDelayed(() -> {
//绘制识别物与交汇点连线,并且更新连线数据
drawOtherObjectLine(mCloundWarningInfo);
//二轮车和行人的渲染和移动
V2XServiceManager.getMarkerManager().removeMarkers(TYPE_MARKER_CLOUD_WARN_DATA);
V2XWarnDataDrawer.getInstance().renderWarnData(mCloundWarningInfo);
//车辆静止的时候
drawSelfCarLine(carLocation.lon, carLocation.lat, bearing);
}, 0);
//延迟3秒清理线
UiThreadHandler.postDelayed(() -> {
V2XServiceManager.getMoGoPersonWarnPolylineManager().clearLine();
V2XServiceManager.getMoGoWarnPolylineManager().clearLine();
isSelfLineClear = true;
}, showTime);
}
}
public void clearLine() {
V2XServiceManager.getMoGoWarnPolylineManager().clearLine();
/**
* 场景如:车辆行驶正前方绘制红色区域(停止线继续前行的预警区域) TODO 需要实时给行人当前位置
*/
private void drawRedWarningLineFrontOfStopLine(V2XWarningEntity info, MogoLatLng
startLatLng, MogoLatLng mogoLatLng) {
if (info != null) {
IMogoPolyline polyLine = V2XServiceManager.getMoGoStopPolylineManager().getMogoStopPolyline();
MogoLatLng endLatlng = new MogoLatLng(mogoLatLng.lat, mogoLatLng.lon);
float distance = CoordinateUtils.calculateLineDistance(startLatLng.lon, startLatLng.lat, endLatlng.lon, endLatlng.lat);
MogoLatLng addMiddleLoc = Trigonometric.getNewLocation(startLatLng, distance / 2, mCloundWarningInfo.getAngle());
Log.d(TAG, "红色区域起始点 = " + startLatLng.lon + "," + startLatLng.lat +
"中间点坐标:" + addMiddleLoc.lon + "," + addMiddleLoc.lat
+ "终点" + endLatlng.lon + "," + endLatlng.lat);
if (polyLine != null) {
Log.d(V2XConst.LOG_NAME_WARN, "drawStopLine polyLine != null");
polyLine.setPoints(Arrays.asList(startLatLng, addMiddleLoc, endLatlng));
polyLine.setTransparency(0.5f);
} else {
DrawLineInfo lineInfo = new DrawLineInfo();
List locations = new ArrayList();
locations.add(startLatLng);
locations.add(addMiddleLoc);
locations.add(endLatlng);
lineInfo.setLocations(locations);
lineInfo.setHeading(info.heading);
Log.d(V2XConst.LOG_NAME_WARN, "drawStopLine width = " + info.getRoadwidth());
lineInfo.setWidth(info.getRoadwidth() * 14 + 5);
V2XServiceManager.getMoGoStopPolylineManager().drawStopPolyline(getContext(), lineInfo);
}
} else {
V2XServiceManager.getMoGoPersonWarnPolylineManager().clearLine();
V2XServiceManager.getMoGoStopPolylineManager().clearLine();
}
}
/**
* 补点后的停止线经纬度合集
*/
public void pointsBetween() {
try {
fillPoints.clear();
List stopLines = mCloundWarningInfo.getStopLines();
if (stopLines.size() > 1) {
MogoLatLng x = mCloundWarningInfo.getStopLines().get(0);
MogoLatLng y = mCloundWarningInfo.getStopLines().get(1);
//两点间的距离
float distance = CoordinateUtils.calculateLineDistance(x.lon, x.lat, y.lon, y.lat);
float average = distance / 3;
//两点间的角度
double angle = Trigonometric.getAngle(x.lon, x.lat, y.lon, y.lat);
//根据距离和角度获取下个点的经纬度
fillPoints.add(x);
for (int i = 1; i < 3; i++) {
MogoLatLng newLocation = Trigonometric.getNewLocation(x, average * i, angle);
fillPoints.add(newLocation);
}
fillPoints.add(y);
}
} catch (Exception e) {
e.printStackTrace();
}
}
/*
* 2D资源绘制停止线
* 停止线绘制
* */
private void handleStopLine() {
try {
if (mCloundWarningInfo != null) {
V2XServiceManager.getMarkerManager().removeMarkers(TYPE_MARKER_CLOUD_STOP_LINE_DATA);
for (int i = 0; i < fillPoints.size(); i++) {
V2XWarningEntity entity = new V2XWarningEntity();
MogoLatLng latLng = (MogoLatLng) fillPoints.get(i);
entity.setLat(latLng.lat);
entity.setLon(latLng.lon);
entity.heading = mCloundWarningInfo.heading;
V2XWarnDataDrawer.getInstance().renderStopLineData(entity);
}
}
//移动完成以后3s后消失
UiThreadHandler.postDelayed(() -> {
V2XServiceManager.getMarkerManager().removeMarkers(TYPE_MARKER_CLOUD_STOP_LINE_DATA);
}, mCloundWarningInfo.getShowTime());
} catch (Exception e) {
e.printStackTrace();
}
}
private MogoLatLng getMogoLat(MogoLatLng latlng) {
MogoLatLng newLocation = Trigonometric.getNewLocation(latlng, mCloundWarningInfo.getStopLineDistance(), mCloundWarningInfo.getAngle());
return newLocation;
}
/*
* 自车前方的点,在停止线上--通过自车位置与距离停止线之间的距离计算
* */
private MogoLatLng getMiddleLocationInStopLine() {
Log.d(TAG, "计算停止线上的某个点" + String.valueOf(carLocation.lat + "," + String.valueOf(carLocation.lon)));
if (carLocation.lat == 0 || carLocation.lon == 0) {
Log.d(TAG, "获取不到车的位置");
}
MogoLatLng newLocation = Trigonometric.getNewLocation(carLocation, mCloundWarningInfo.getStopLineDistance(), mCloundWarningInfo.getAngle());
return newLocation;
}
/**
* 自车为起点绘制(根据设计,前方行人/弱势交通参与者预警 getDirection() == ALERT_THE_FRONT_CRASH_WARNING_TOP自车与停止线之间为蓝色预警;其他侧方预警自车与预碰撞点之间显示红色预警)
*/
public void drawSelfCarLine(double lon, double lat, float bearing) {
if (!isSelfLineClear) {
IMogoPolyline mogoPolyline = V2XServiceManager.getMoGoWarnPolylineManager().getMogoWarnPolyline();
if (mCloundWarningInfo != null) {
MogoLatLng startLatlng = null;
MogoLatLng endLatlng = null;
MogoLatLng addMiddleLoc = null;
if (!isFirstLocation) {
carLocation = getMogoLat(new MogoLatLng(lat, lon));
isFirstLocation = true;
}
//绘制线的终点(在停止线上或者预碰撞点上)
endLatlng = new MogoLatLng(mCloundWarningInfo.getDirection() == ALERT_THE_FRONT_CRASH_WARNING_TOP ? middleLocationInStopLine.lat : mCloundWarningInfo.getCollisionLat(),
mCloundWarningInfo.getDirection() == ALERT_THE_FRONT_CRASH_WARNING_TOP ? middleLocationInStopLine.lon : mCloundWarningInfo.getCollisionLon());
//自车位置
startLatlng = new MogoLatLng(lat, lon);
float distance = CoordinateUtils.calculateLineDistance(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat);
//扩展点为了渐变色添加
addMiddleLoc = Trigonometric.getNewLocation(startLatlng, distance / 2, Trigonometric.getAngle(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat));
Log.d(TAG, "自车为起点绘制 自车;" + startLatlng.lon + "," + startLatlng.lat +
"中间扩展点" + addMiddleLoc.lon + "," + addMiddleLoc.lat + "终点:" + endLatlng.lon + "," + endLatlng.lat);
if (mogoPolyline != null) {
mogoPolyline.setPoints(Arrays.asList(startLatlng, addMiddleLoc, endLatlng));
mogoPolyline.setTransparency(0.5f);
} else {
DrawLineInfo info = new DrawLineInfo(); // 对象
Log.d(TAG, "安全区域的画线点为" + "起点:" + startLatlng + "中间点:" + addMiddleLoc + "终点:" + endLatlng);
List locations = new ArrayList();
locations.add(startLatlng);
locations.add(addMiddleLoc);
locations.add(endLatlng);
info.setLocations(locations);
info.setHeading(bearing);
info.setWidth(mCloundWarningInfo.getRoadwidth() * 14 + 5);
info.setDirection(mCloundWarningInfo.getDirection());
V2XServiceManager.getMoGoWarnPolylineManager().drawWarnPolyline(getContext(), info);
}
} else {
V2XServiceManager.getMoGoWarnPolylineManager().clearLine();
}
}
}
/**
* 侧方目标物与预碰撞点连线,并且更新数据 TODO 需要实时给行人当前位置
*/
private void drawOtherObjectLine(V2XWarningEntity info) {
if (info != null) {
IMogoPolyline polyLine = V2XServiceManager.getMoGoPersonWarnPolylineManager().getMogoPersonWarnPolyline();
MogoLatLng startLatlng = new MogoLatLng(info.getLat(), info.getLon());//识别物坐标
MogoLatLng endLatlng = new MogoLatLng(info.getCollisionLat(), info.getCollisionLon());//预碰撞点坐标
float distance = CoordinateUtils.calculateLineDistance(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat);//识别物到碰撞点之间的距离
MogoLatLng addMiddleLoc = Trigonometric.getNewLocation(startLatlng, distance / 2,
Trigonometric.getAngle(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat));//补点
if (polyLine != null) {
Log.d(V2XConst.LOG_NAME_WARN, "polyLine != null");
polyLine.setPoints(Arrays.asList(startLatlng, addMiddleLoc, endLatlng));
polyLine.setTransparency(0.5f);
} else {
DrawLineInfo lineInfo = new DrawLineInfo();
Log.d(TAG, "目标物与预碰撞点画线点为" + "起点:" + startLatlng + "中间点:" + addMiddleLoc + "终点:" + endLatlng);
List locations = new ArrayList();
locations.add(startLatlng);
locations.add(addMiddleLoc);
locations.add(endLatlng);
lineInfo.setLocations(locations);
lineInfo.setHeading(info.heading);
Log.d(V2XConst.LOG_NAME_WARN, "drawOtherObjectLine width = " + info.getRoadwidth());
lineInfo.setWidth(info.getRoadwidth() * 14 + 5);
V2XServiceManager.getMoGoPersonWarnPolylineManager().drawPersonWarnPolyline(getContext(), lineInfo);
//识别物到预碰撞点之间的箭头
addArrows(startLatlng, endLatlng);
}
} else {
Log.e(V2XConst.LOG_NAME_WARN, "info == null");
V2XServiceManager.getMoGoPersonWarnPolylineManager().clearLine();
}
}
//侧面目标物与碰撞点之间添加多个小箭头
private void addArrows(MogoLatLng startLatLng, MogoLatLng endLatLng) {
float distance = CoordinateUtils.calculateLineDistance(
startLatLng.lon, startLatLng.lat, endLatLng.lon, endLatLng.lat);
double rotate = Trigonometric.getAngle(startLatLng.lon, startLatLng.lat, endLatLng.lon, endLatLng.lat);
Log.d(TAG, "添加小箭头--目标物与预碰撞点之间的距离是" + String.valueOf(distance));
if (distance > 5) {
int count = (int) (distance / 5);
for (int i = 0; i < count; i++) {
MogoLatLng newLo = Trigonometric.getNewLocation(
startLatLng, 5 * (i + 1), Trigonometric.getAngle(startLatLng.lon, startLatLng.lat, endLatLng.lon, endLatLng.lat));
Log.d(TAG, "小箭头位置" + newLo);
V2XWarnDataDrawer.getInstance().drawerArrowsMarkerWithLocation(newLo, WARNING_ARROWS, 10, new Double(rotate).intValue());
}
}
//延迟3秒清理线
UiThreadHandler.postDelayed(() -> {
V2XServiceManager.getMarkerManager().removeMarkers(WARNING_ARROWS);
}, showTime);
}
/*
* 2D资源绘制停止线 暂时不需要
* */
private void drawStopLineWith2Resource() {
MogoLatLng carlo = mMarkerEntity.getCarLocation();
MogoLatLng carlo = mCloundWarningInfo.getCarLocation();
if (carlo == null) {
double lon = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLon();
double lat = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLat();
carlo = new MogoLatLng(lat, lon);
}
//自车行驶方向的前方*米的经纬度,该经纬度在停止线上
MogoLatLng drawStopLineLon = Trigonometric.getNewLocation(carlo, mMarkerEntity.getStopLineDistance(), mMarkerEntity.getAngle());
MogoLatLng drawStopLineLon = Trigonometric.getNewLocation(carlo, mCloundWarningInfo.getStopLineDistance(), mCloundWarningInfo.getAngle());
Log.d(TAG, "2D资源绘" + drawStopLineLon);
MogoMarkerOptions optionsRipple = new MogoMarkerOptions()
.latitude(drawStopLineLon.getLat())
@@ -115,6 +378,28 @@ public class V2XWarningMarker implements IV2XMarker {
stopLine.showInfoWindow();
UiThreadHandler.postDelayed(() -> {
stopLine.hideInfoWindow();
}, 8000);
}, showTime);
}
public void onCarLocationChanged2(Location latLng) {
carLocation = new MogoLatLng(latLng.getLatitude(), latLng.getLongitude());
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() && isSelfLineClear == false) {
//当行人经纬度交点 开始画线,否则清理
if (mCloundWarningInfo != null) {
mCloundWarningInfo.setCarLocation(new MogoLatLng(latLng.getLatitude(), latLng.getLongitude()));
}
drawSelfCarLine(latLng.getLongitude(), latLng.getLatitude(), latLng.getBearing());
}
Log.d(TAG, "车辆行驶轨迹" + String.valueOf(latLng.getLongitude()) + "," + String.valueOf(latLng.getLatitude()));
}
@Override
public void clearPOI() {
V2XServiceManager.getMarkerManager().removeMarkers(V2X_FRONT_WARNING_MARKER);
}
public void clearLine() {
V2XServiceManager.getMoGoWarnPolylineManager().clearLine();
}
}

View File

@@ -4,6 +4,7 @@ import android.content.Context;
import android.location.Location;
import android.os.Handler;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
@@ -127,4 +128,5 @@ public class V2XWarningWindow extends V2XBasWindow implements IV2XWindow {
.getMogoTopViewManager()
.removeView(this);
}
}

View File

@@ -7,6 +7,7 @@ import com.mogo.module.common.entity.V2XPushMessageEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.entity.V2XWarningEntity;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.entity.net.V2XOptimalRouteDataRes;
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes;
import com.mogo.utils.network.utils.GsonUtil;
@@ -158,11 +159,25 @@ public class TestOnLineCarUtils {
return null;
}
public static V2XMessageEntity<V2XWarningEntity> getV2XScenarioPushFrontWarningEventData() {
/**
* 测试数据
*/
public static V2XMessageEntity getV2XScenarioPushFrontWarningEventData(String adasResult) {
try {
int id = R.raw.scenario_warning_event_data_right;
switch (adasResult) {
case "left":
id = R.raw.scenario_warning_event_data_left;
break;
case "pedestrians":
id = R.raw.scenario_warning_event_data_pedestrians;
break;
default:
}
InputStream inputStream = V2XUtils.getApp()
.getResources()
.openRawResource(R.raw.scenario_warning_event_data_right);
.openRawResource(id);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int len = -1;
byte[] buffer = new byte[1024];
@@ -173,14 +188,10 @@ public class TestOnLineCarUtils {
// 加载数据源
V2XWarningEntity warningEntity = GsonUtil.objectFromJson(baos.toString(), V2XWarningEntity.class);
V2XMessageEntity<V2XWarningEntity> v2xMessageEntity = new V2XMessageEntity<>();
// 控制类型
v2xMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_TOP);
// 设置数据
v2xMessageEntity.setContent(warningEntity);
// 控制展示状态
v2xMessageEntity.setShowState(true);
return v2xMessageEntity;
V2XMessageEntity messageEntity = new V2XMessageEntity();
messageEntity.setType(warningEntity.getDirection());
messageEntity.setContent(warningEntity);
return messageEntity;
} catch (Exception e) {
e.printStackTrace();
}
@@ -454,4 +465,25 @@ public class TestOnLineCarUtils {
}
return null;
}
/**
* 自车求助测试数据
*/
public static V2XMessageEntity<Boolean> getV2XScenarioCarForHelpEventData() {
try {
V2XMessageEntity<Boolean> v2xMessageEntity = new V2XMessageEntity<>();
// 控制类型
v2xMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_CAR_FOR_HELP);
// 设置数据
v2xMessageEntity.setContent(true);
// 控制展示状态
v2xMessageEntity.setShowState(true);
return v2xMessageEntity;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@@ -2,5 +2,5 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#000000" />
<corners android:radius="@dimen/dp_20" />
<corners android:radius="@dimen/module_v2x_road_event_bg_radius" />
</shape>

View File

@@ -2,8 +2,9 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="@dimen/dp_822"
android:layout_width="@dimen/module_v2x_road_event_window_width_vr"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center">
<androidx.constraintlayout.widget.ConstraintLayout
@@ -222,14 +223,14 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_140"
android:layout_height="@dimen/module_v2x_road_event_height"
android:background="@drawable/bg_v2x_event_bg">
<com.mogo.service.imageloader.MogoImageView
android:id="@+id/iv_event"
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_100"
android:layout_marginLeft="@dimen/dp_30"
android:layout_width="@dimen/module_v2x_road_event_icon_width"
android:layout_height="@dimen/module_v2x_road_event_icon_height"
android:layout_marginLeft="@dimen/module_v2x_road_event_icon_margin_left"
android:scaleType="fitXY"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -252,18 +253,18 @@
android:id="@+id/tv_event"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/module_v2x_road_event_icon_margin_left"
android:layout_marginRight="@dimen/module_v2x_road_event_icon_margin_left"
android:maxWidth="@dimen/dp_480"
android:paddingLeft="@dimen/dp_40"
android:paddingRight="@dimen/dp_40"
android:textColor="@color/v2x_white_color"
android:textSize="@dimen/dp_32" />
android:textSize="@dimen/module_v2x_road_event_text_size" />
<ImageView
android:id="@+id/iv_play"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_6"
android:paddingLeft="@dimen/dp_42"
android:layout_marginLeft="@dimen/module_v2x_road_event_icon_margin_left"
android:layout_marginTop="@dimen/module_v2x_road_event_icon_play_margin_top"
android:src="@drawable/icon_play"
android:visibility="gone" />
</LinearLayout>
@@ -273,9 +274,9 @@
android:id="@+id/tv_line"
android:layout_width="@dimen/dp_0_5"
android:layout_height="@dimen/dp_70"
android:alpha="0.3"
android:background="@color/v2x_line_color"
android:visibility="gone"
android:alpha="0.3"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/tv_play"
app:layout_constraintStart_toEndOf="@+id/ll_event"
@@ -284,14 +285,12 @@
<TextView
android:id="@+id/tv_play"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_140"
android:layout_width="@dimen/module_v2x_road_event_height"
android:layout_height="@dimen/module_v2x_road_event_height"
android:gravity="center"
android:paddingLeft="@dimen/dp_40"
android:paddingRight="@dimen/dp_40"
android:text="播放"
android:textColor="@color/v2x_event_play_text"
android:textSize="@dimen/dp_30"
android:textSize="@dimen/module_v2x_road_event_text_play_text_size"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View File

@@ -2,23 +2,23 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="@dimen/dp_800"
android:layout_height="@dimen/dp_140"
android:layout_width="@dimen/module_v2x_fault_help_width"
android:layout_height="@dimen/module_v2x_fault_help_height"
android:layout_marginTop="@dimen/dp_8"
android:background="@drawable/bg_v2x_event_bg"
tools:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_140"
android:layout_height="@dimen/module_v2x_fault_help_height"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.mogo.service.imageloader.MogoImageView
android:id="@+id/ivFaultHelpHead"
android:layout_width="@dimen/dp_140"
android:layout_height="@dimen/dp_140"
android:layout_width="@dimen/module_v2x_fault_help_height"
android:layout_height="@dimen/module_v2x_fault_help_height"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/rlRoadEventList"
app:layout_constraintStart_toStartOf="parent"
@@ -30,12 +30,12 @@
<TextView
android:id="@+id/tvImgTextContent"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_35"
android:layout_width="@dimen/module_v2x_fault_help_img_content_width"
android:layout_height="@dimen/module_v2x_fault_help_img_content_height"
android:layout_marginTop="15dp"
android:background="@drawable/bg_v2x_event_type_orange_vr"
android:gravity="center"
android:paddingTop="@dimen/dp_2"
android:paddingTop="2dp"
android:paddingBottom="@dimen/dp_5"
android:text="求助"
android:textColor="@android:color/white"
@@ -50,9 +50,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_24"
android:layout_marginTop="@dimen/dp_27"
android:layout_marginTop="@dimen/module_v2x_fault_help_name_margin_top"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_40"
android:textSize="@dimen/module_v2x_fault_help_name_text_size"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@id/ivFaultHelpHead"
app:layout_constraintTop_toTopOf="parent"
@@ -65,10 +65,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_24"
android:layout_marginBottom="@dimen/dp_27"
android:layout_marginBottom="@dimen/module_v2x_fault_help_time_margin_bottom"
android:alpha="0.59"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_24"
android:textSize="@dimen/module_v2x_fault_help_time_text_size"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/ivFaultHelpHead"
tools:text="15:30发布求助信息" />
@@ -83,7 +83,7 @@
android:layout_marginRight="@dimen/dp_42"
android:gravity="center_vertical"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_42"
android:textSize="@dimen/module_v2x_fault_help_distance_text_size"
app:layout_constraintBottom_toBottomOf="@+id/ivFaultHelpEventCall"
app:layout_constraintEnd_toStartOf="@+id/ivFaultHelpEventCall"
app:layout_constraintTop_toTopOf="@+id/ivFaultHelpEventCall"
@@ -91,8 +91,8 @@
<ImageView
android:id="@+id/ivFaultHelpEventCall"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_width="@dimen/module_v2x_fault_help_event_call_width"
android:layout_height="@dimen/module_v2x_fault_help_event_call_width"
android:layout_marginRight="@dimen/dp_40"
android:src="@drawable/v2x_event_icon_tel_vr"
android:visibility="gone"
@@ -103,9 +103,9 @@
<ImageView
android:id="@+id/ivFaultHelpEventNavi"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_marginRight="@dimen/dp_40"
android:layout_width="@dimen/module_v2x_fault_help_event_call_width"
android:layout_height="@dimen/module_v2x_fault_help_event_call_width"
android:layout_marginRight="@dimen/module_v2x_fault_help_event_navi_margin_right"
android:src="@drawable/v2x_event_icon_daohang_vr"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View File

@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/dp_470"
android:layout_height="@dimen/dp_140"
android:layout_width="@dimen/module_v2n_tip_width"
android:layout_height="@dimen/module_v2n_tip_height"
android:layout_marginLeft="@dimen/dp_190"
android:background="@drawable/v2x_front_warning_bg"
android:layout_marginTop="@dimen/dp_20">
<ImageView
android:id="@+id/warning_type_image"
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_100"
android:layout_marginLeft="@dimen/dp_28"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/module_v2n_image_margin_left"
android:layout_marginTop="@dimen/dp_20"
android:src="@drawable/v2x_road_front_car_warning" />
@@ -21,7 +21,7 @@
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/dp_28"
android:maxWidth="@dimen/dp_100"
android:maxWidth="@dimen/module_v2n_tip_text_width"
android:text="1.2米"
android:textColor="@color/v2x_FF3036"
android:textSize="@dimen/dp_32" />
@@ -33,7 +33,7 @@
android:layout_alignEnd="@+id/warning_distance"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:layout_marginRight="@dimen/module_v2n_tip_text_margin_right"
android:layout_toRightOf="@+id/warning_type_image"
android:text="前车碰撞预警"
android:textColor="#FFFFFF"

View File

@@ -12,8 +12,8 @@
<ImageView
android:id="@+id/warning_type_image"
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_100"
android:layout_width="@dimen/module_v2x_event_warning_type_image_size"
android:layout_height="@dimen/module_v2x_event_warning_type_image_size"
android:src="@drawable/v2x_optimal_route_warning"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -28,7 +28,7 @@
android:layout_marginRight="@dimen/dp_20"
android:text="为您推荐最优路线"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_32"
android:textSize="@dimen/module_v2x_event_warning_type_text_size"
app:layout_constraintBottom_toBottomOf="@+id/warning_type_image"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/warning_type_image"

View File

@@ -5,10 +5,10 @@
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="@dimen/dp_640"
android:layout_height="@dimen/dp_140"
android:alpha="0.7"
android:layout_width="@dimen/module_v2x_car_for_help_width"
android:layout_height="@dimen/module_v2x_car_for_help_height"
android:layout_marginTop="@dimen/dp_8"
android:alpha="0.7"
android:background="@drawable/bg_v2x_event_bg"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -16,8 +16,8 @@
<ImageView
android:id="@+id/iv_event"
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_100"
android:layout_width="@dimen/module_v2x_car_for_help_icon_width"
android:layout_height="@dimen/module_v2x_car_for_help_icon_height"
android:layout_marginLeft="@dimen/dp_30"
android:scaleType="fitXY"
android:src="@drawable/icon_car_for_help"
@@ -29,19 +29,19 @@
android:id="@+id/tv_event"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="@dimen/dp_480"
android:maxWidth="@dimen/module_v2x_car_for_help_event_maxwidth"
android:paddingLeft="@dimen/dp_40"
android:paddingRight="@dimen/dp_40"
android:text="正在为您发起求助"
android:textColor="@color/v2x_white_color"
android:textSize="@dimen/dp_32"
android:textSize="@dimen/module_v2x_car_for_help_event_text_size"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/iv_event"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="@dimen/dp_0_5"
android:layout_height="@dimen/dp_70"
android:layout_height="@dimen/dp_72"
android:alpha="0.3"
android:background="@color/v2x_line_color"
app:layout_constraintBottom_toBottomOf="parent"
@@ -50,14 +50,12 @@
<TextView
android:id="@+id/tv_cancel"
android:layout_width="@dimen/dp_140"
android:layout_height="@dimen/dp_140"
android:layout_width="@dimen/module_v2x_car_for_help_height"
android:layout_height="@dimen/module_v2x_car_for_help_height"
android:gravity="center"
android:paddingLeft="@dimen/dp_40"
android:paddingRight="@dimen/dp_40"
android:text="取消"
android:textColor="@color/v2x_car_for_help_cancel"
android:textSize="@dimen/dp_30"
android:textSize="@dimen/module_v2x_car_for_help_cancel_text_size"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />

View File

@@ -2,14 +2,14 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="@dimen/dp_822"
android:layout_height="@dimen/dp_182"
android:layout_width="@dimen/module_v2x_road_event_window_width_vr"
android:layout_height="@dimen/module_v2x_road_event_window_height_vr"
android:layout_marginTop="@dimen/dp_8">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvRoadEventList"
android:layout_width="match_parent"
android:layout_height="@dimen/module_v2x_event_window_height_vr"
android:layout_height="@dimen/module_v2x_road_event_window_height_vr"
android:minHeight="@dimen/module_v2x_event_window_height"
android:orientation="horizontal"
android:overScrollMode="never"

View File

@@ -16,8 +16,8 @@
android:id="@+id/liveVideoClose"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginStart="@dimen/module_v2x_event_window_close_distance"
android:layout_marginTop="@dimen/module_v2x_event_window_close_distance"
android:clickable="true"
android:focusable="true"
android:visibility="gone"

View File

@@ -23,6 +23,6 @@
"stopLineDistance": 60,
"warningContent": "注意自行车",
"heading": 0,
"showTime": 8000,
"showTime": 5000,
"roadwidth": 4.0
}

View File

@@ -24,6 +24,6 @@
"stopLineDistance": 60,
"warningContent": "小心行人",
"heading": 0,
"showTime": 8000,
"showTime": 5000,
"roadwidth": 4.0
}

View File

@@ -23,6 +23,6 @@
"stopLineDistance": 60,
"warningContent": "注意摩托车",
"heading": 0,
"showTime": 8000,
"showTime": 5000,
"roadwidth": 4.0
}

View File

@@ -99,6 +99,11 @@
<dimen name="module_v2x_event_help_sub_title_text_size">14px</dimen>
<dimen name="module_v2x_event_help_distance_text_size">44px</dimen>
<dimen name="module_v2x_event_parking_text_size">19px</dimen>
<!--最优路线-->
<dimen name="module_v2x_event_warning_type_image_size">100px</dimen>
<dimen name="module_v2x_event_warning_type_text_size">32px</dimen>
<!--适配 V2X 弹窗 UI-->
<dimen name="module_v2x_event_panel_btn_x">572px</dimen>

View File

@@ -99,6 +99,11 @@
<dimen name="module_v2x_event_help_sub_title_text_size">14px</dimen>
<dimen name="module_v2x_event_help_distance_text_size">44px</dimen>
<dimen name="module_v2x_event_parking_text_size">19px</dimen>
<!--最优路线-->
<dimen name="module_v2x_event_warning_type_image_size">100px</dimen>
<dimen name="module_v2x_event_warning_type_text_size">32px</dimen>
<!--适配 V2X 弹窗 UI-->
<dimen name="module_v2x_event_panel_btn_x">572px</dimen>

View File

@@ -80,6 +80,11 @@
<dimen name="module_v2x_event_help_sub_title_text_size">26px</dimen>
<dimen name="module_v2x_event_help_distance_text_size">80px</dimen>
<dimen name="module_v2x_event_parking_text_size">34px</dimen>
<!--最优路线-->
<dimen name="module_v2x_event_warning_type_image_size">100px</dimen>
<dimen name="module_v2x_event_warning_type_text_size">32px</dimen>
<!--适配 V2X 弹窗 UI-->
<dimen name="module_v2x_event_panel_btn_x">940px</dimen>

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_v2x_road_event_window_width_vr">1100px</dimen>
<dimen name="module_v2x_road_event_window_height_vr">227px</dimen>
<dimen name="module_v2x_road_event_height">187px</dimen>
<dimen name="module_v2x_road_event_bg_radius">30px</dimen>
<dimen name="module_v2x_road_event_icon_width">133px</dimen>
<dimen name="module_v2x_road_event_icon_height">133px</dimen>
<dimen name="module_v2x_road_event_icon_margin_left">38px</dimen>
<dimen name="module_v2x_road_event_text_size">42px</dimen>
<dimen name="module_v2x_road_event_icon_play_margin_top">12px</dimen>
<dimen name="module_v2x_road_event_text_play_text_size">40px</dimen>
<dimen name="module_ext_top_view_no_link_width_in_vr_mode">778px</dimen>
<dimen name="module_v2x_event_see_live_window_height_vr">687px</dimen>
<dimen name="module_v2x_event_window_top_margin_vr">200px</dimen>
<dimen name="module_v2x_event_window_close_distance">10px</dimen>
<dimen name="module_v2x_event_window_height_vr_for_item">487px</dimen>
<dimen name="module_v2x_event_window_width_vr">778px</dimen>
<dimen name="module_v2x_fatigue_driving_window_height_ground">234px</dimen>
<dimen name="module_v2x_fault_help_width">1067px</dimen>
<dimen name="module_v2x_fault_help_height">187px</dimen>
<dimen name="module_v2x_fault_help_img_content_width">107px</dimen>
<dimen name="module_v2x_fault_help_img_content_height">47px</dimen>
<dimen name="module_v2x_fault_help_name_margin_top">35px</dimen>
<dimen name="module_v2x_fault_help_name_text_size">48px</dimen>
<dimen name="module_v2x_fault_help_time_margin_bottom">35px</dimen>
<dimen name="module_v2x_fault_help_time_text_size">36px</dimen>
<dimen name="module_v2x_fault_help_distance_text_size">64px</dimen>
<dimen name="module_v2x_fault_help_event_call_width">108px</dimen>
<dimen name="module_v2x_fault_help_event_navi_margin_right">53px</dimen>
<dimen name="module_v2x_car_for_help_window_height">200px</dimen>
<dimen name="module_v2x_car_for_help_width">854px</dimen>
<dimen name="module_v2x_car_for_help_height">187px</dimen>
<dimen name="module_v2x_car_for_help_icon_width">133px</dimen>
<dimen name="module_v2x_car_for_help_icon_height">133px</dimen>
<dimen name="module_v2x_car_for_help_event_maxwidth">480px</dimen>
<dimen name="module_v2x_car_for_help_event_text_size">42px</dimen>
<dimen name="module_v2x_car_for_help_cancel_text_size">40px</dimen>
<!--最优路线-->
<dimen name="module_v2x_event_warning_type_image_size">133px</dimen>
<dimen name="module_v2x_event_warning_type_text_size">42px</dimen>
</resources>

View File

@@ -17,6 +17,8 @@
<dimen name="module_v2x_event_see_live_window_height">670px</dimen>
<dimen name="module_v2x_event_see_live_window_height_vr">526px</dimen>
<dimen name="module_v2x_event_window_close_distance">20px</dimen>
<dimen name="module_v2x_event_icon_size">147px</dimen>
<dimen name="module_v2x_event_distance_text">60px</dimen>
<dimen name="module_v2x_event_distance_title">40px</dimen>
@@ -95,7 +97,8 @@
<!--适配 V2X 弹窗-VR-->
<dimen name="module_v2x_event_button_size_detail_vr">80px</dimen>
<dimen name="module_v2x_event_window_height_vr">182px</dimen>
<dimen name="module_v2x_road_event_window_width_vr">882px</dimen>
<dimen name="module_v2x_road_event_window_height_vr">182px</dimen>
<dimen name="module_v2x_event_button_size_vr">64px</dimen>
<dimen name="module_v2x_event_icon_size_vr">60px</dimen>
@@ -113,6 +116,11 @@
<dimen name="module_v2x_event_help_sub_title_text_size">26px</dimen>
<dimen name="module_v2x_event_help_distance_text_size">80px</dimen>
<dimen name="module_v2x_event_parking_text_size">34px</dimen>
<!--最优路线-->
<dimen name="module_v2x_event_warning_type_image_size">100px</dimen>
<dimen name="module_v2x_event_warning_type_text_size">32px</dimen>
<!--适配 V2X 弹窗 UI-->
<dimen name="module_v2x_event_panel_btn_x">940px</dimen>
@@ -128,4 +136,34 @@
<dimen name="v2x_driving_heigt">46px</dimen>
<dimen name="v2x_recommond_route_size">26px</dimen>
<dimen name="module_v2x_road_event_height">140px</dimen>
<dimen name="module_v2x_road_event_bg_radius">20px</dimen>
<dimen name="module_v2x_road_event_icon_width">100px</dimen>
<dimen name="module_v2x_road_event_icon_height">100px</dimen>
<dimen name="module_v2x_road_event_icon_margin_left">30px</dimen>
<dimen name="module_v2x_road_event_text_size">32px</dimen>
<dimen name="module_v2x_road_event_icon_play_margin_top">8px</dimen>
<dimen name="module_v2x_road_event_text_play_text_size">30px</dimen>
<dimen name="module_v2x_fault_help_width">800px</dimen>
<dimen name="module_v2x_fault_help_height">140px</dimen>
<dimen name="module_v2x_fault_help_img_content_width">80px</dimen>
<dimen name="module_v2x_fault_help_img_content_height">35px</dimen>
<dimen name="module_v2x_fault_help_name_margin_top">27px</dimen>
<dimen name="module_v2x_fault_help_name_text_size">40px</dimen>
<dimen name="module_v2x_fault_help_time_margin_bottom">27px</dimen>
<dimen name="module_v2x_fault_help_time_text_size">24px</dimen>
<dimen name="module_v2x_fault_help_distance_text_size">42px</dimen>
<dimen name="module_v2x_fault_help_event_call_width">80px</dimen>
<dimen name="module_v2x_fault_help_event_navi_margin_right">40px</dimen>
<dimen name="module_v2x_car_for_help_window_height">150px</dimen>
<dimen name="module_v2x_car_for_help_width">640px</dimen>
<dimen name="module_v2x_car_for_help_height">140px</dimen>
<dimen name="module_v2x_car_for_help_icon_width">100px</dimen>
<dimen name="module_v2x_car_for_help_icon_height">100px</dimen>
<dimen name="module_v2x_car_for_help_event_maxwidth">480px</dimen>
<dimen name="module_v2x_car_for_help_event_text_size">32px</dimen>
<dimen name="module_v2x_car_for_help_cancel_text_size">30px</dimen>
</resources>