[2.13.0-arhc-opt] merge

This commit is contained in:
zhongchao
2023-02-07 15:00:25 +08:00
parent ed71827687
commit a382fc36c1
66 changed files with 1116 additions and 1182 deletions

View File

@@ -186,11 +186,9 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
}
public void showOverviewFragment() {
CallerHmiManager.INSTANCE.showSmallFragment();
UiThreadHandler.postDelayed(new Runnable() {
@Override
public void run() {
CallerHmiManager.INSTANCE.hideSmallFragment();
}
},5000L);
}

View File

@@ -6,8 +6,8 @@ import android.view.LayoutInflater
import android.widget.LinearLayout
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.TrafficLightEnum
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.bus.passenger.R
import kotlinx.android.synthetic.main.bus_p_traffic_light_view.view.*

View File

@@ -26,6 +26,15 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<!--刹车、转向-->
<com.mogo.eagle.core.function.hmi.ui.vehicle.SteeringBrakeView
android:layout_width="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:day_light_mode="true"
android:layout_height="wrap_content"/>
<!--pnc行为决策-->
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
android:layout_width="wrap_content"

View File

@@ -5,32 +5,51 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_72">
<FrameLayout
android:id="@+id/fl_speed"
android:layout_width="@dimen/dp_616"
android:layout_height="@dimen/dp_320"
android:layout_marginLeft="@dimen/dp_13"
android:layout_marginTop="@dimen/dp_40"
android:visibility="visible"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent">
<FrameLayout
android:id="@+id/fl_speed"
android:layout_width="@dimen/dp_616"
android:layout_height="@dimen/dp_320"
android:layout_marginLeft="@dimen/dp_13"
android:layout_marginTop="@dimen/dp_40"
android:visibility="visible"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView
android:id="@+id/bus_arc"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent" />
</FrameLayout>
<!--V2X预警红色边框-->
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
android:id="@+id/flV2XWarningView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--刹车、转向-->
<com.mogo.eagle.core.function.hmi.ui.widget.SteeringWheelView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--Vip车辆标志-->
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
android:layout_width="@dimen/module_vip_width"
android:layout_height="@dimen/module_vip_height"
android:layout_marginStart="@dimen/dp_640"
android:layout_marginTop="@dimen/dp_80"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginStart="@dimen/dp_640"
android:layout_marginTop="@dimen/dp_80"/>
app:layout_constraintTop_toTopOf="parent" />
<!--pnc行为决策-->
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
@@ -77,7 +96,7 @@
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
tools:visibility="visible"/>
tools:visibility="visible" />
<!--消息盒子选择入口-->
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
@@ -87,8 +106,7 @@
android:layout_marginTop="15dp"
android:layout_marginEnd="25dp"
app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
/>
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon" />
<!--消息盒子打开视图-->
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView
android:id="@+id/viewDriverMsgBoxList"
@@ -143,12 +161,12 @@
android:id="@+id/module_mogo_och_autopilot_status"
android:layout_width="@dimen/module_mogo_och_autopilot_status_bg_width"
android:layout_height="@dimen/module_mogo_och_autopilot_status_bg_height"
app:layout_constraintTop_toBottomOf="@+id/fl_speed"
android:background="@drawable/bus_autopilot_status_bg"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginLeft="@dimen/dp_13"
android:background="@drawable/bus_autopilot_status_bg"
android:gravity="center"
tools:visibility="visible" >
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/fl_speed"
tools:visibility="visible">
<ImageView
android:id="@+id/bus_autopilot_btn_iv"
@@ -175,74 +193,74 @@
android:id="@+id/module_mogo_och_station_panel_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginLeft="@dimen/dp_13"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_autopilot_status"
app:layout_goneMarginTop="@dimen/module_mogo_och_station_panel_container_margin_top_no_call" />
<include
android:id="@+id/module_mogo_och_bus_test_bar"
layout="@layout/bus_test_bar_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout="@layout/bus_test_bar_view"
android:visibility="visible"
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_station_panel_container"
app:layout_constraintLeft_toLeftOf="@id/module_mogo_och_station_panel_container"
tools:visibility="visible"/>
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_station_panel_container"
tools:visibility="visible" />
<!--切换地图远近事件 @dimen/module_switch_map -->
<LinearLayout
android:id="@+id/bus_switch_model_layout"
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
app:layout_goneMarginBottom="@dimen/module_mogo_och_margin_bottom"
app:layout_goneMarginLeft="@dimen/module_mogo_och_margin_left"
android:background="@drawable/bus_switch_map_bg"
android:elevation="@dimen/bus_dp_10"
android:padding="@dimen/bus_dp_20"
app:layout_constraintBottom_toBottomOf="@+id/module_mogo_och_arrived_tv"
app:layout_constraintLeft_toRightOf="@+id/module_mogo_och_arrived_tv"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/bus_switch_model_layout"
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
android:background="@drawable/bus_switch_map_bg"
android:elevation="@dimen/bus_dp_10"
android:gravity="center"
android:orientation="horizontal"
android:padding="@dimen/bus_dp_20"
app:layout_constraintBottom_toBottomOf="@+id/module_mogo_och_arrived_tv"
app:layout_constraintLeft_toRightOf="@+id/module_mogo_och_arrived_tv"
app:layout_goneMarginBottom="@dimen/module_mogo_och_margin_bottom"
app:layout_goneMarginLeft="@dimen/module_mogo_och_margin_left">
<ImageView
android:id="@+id/bus_switch_model_icon"
android:layout_width="@dimen/dp_60"
android:layout_height="60dp" />
</LinearLayout>
<!-- <CheckedTextView-->
<!-- android:id="@+id/module_mogo_och_operation_status"-->
<!-- android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"-->
<!-- android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"-->
<!-- android:background="@drawable/bus_operation_status_bg"-->
<!-- android:elevation="@dimen/dp_10"-->
<!-- android:gravity="center"-->
<!-- android:text="出车"-->
<!-- android:textAlignment="center"-->
<!-- android:textColor="@color/bus_autopilot_text_color_selector"-->
<!-- android:textSize="@dimen/module_mogo_och_autopilot_status_text_size"-->
<!-- android:textStyle="bold"-->
<!-- android:layout_marginLeft="@dimen/module_mogo_och_margin_left"-->
<!-- android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintLeft_toLeftOf="parent"/>-->
<ImageView
android:id="@+id/bus_switch_model_icon"
android:layout_width="@dimen/dp_60"
android:layout_height="60dp" />
</LinearLayout>
<!-- <CheckedTextView-->
<!-- android:id="@+id/module_mogo_och_operation_status"-->
<!-- android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"-->
<!-- android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"-->
<!-- android:background="@drawable/bus_operation_status_bg"-->
<!-- android:elevation="@dimen/dp_10"-->
<!-- android:gravity="center"-->
<!-- android:text="出车"-->
<!-- android:textAlignment="center"-->
<!-- android:textColor="@color/bus_autopilot_text_color_selector"-->
<!-- android:textSize="@dimen/module_mogo_och_autopilot_status_text_size"-->
<!-- android:textStyle="bold"-->
<!-- android:layout_marginLeft="@dimen/module_mogo_och_margin_left"-->
<!-- android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintLeft_toLeftOf="parent"/>-->
<TextView
android:id="@+id/module_mogo_och_arrived_tv"
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
android:background="@drawable/bus_operation_status_bg_selector"
android:elevation="@dimen/dp_10"
android:text="@string/bus_arrived_str"
android:gravity="center"
android:text="@string/bus_arrived_str"
android:textColor="@color/bus_autopilot_text_color_selector"
android:textSize="@dimen/module_mogo_och_arrived_text_size"
android:textStyle="bold"
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"/>
app:layout_constraintLeft_toLeftOf="parent" />
<RelativeLayout
android:id="@+id/module_mogo_och_setting_layout"
@@ -254,6 +272,7 @@
android:elevation="@dimen/dp_10"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/bus_switch_model_layout">
<ImageView
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
@@ -287,8 +306,8 @@
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
android:elevation="@dimen/dp_10"
android:background="@drawable/bus_operation_status_bg_selector"
android:elevation="@dimen/dp_10"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_badcase_rl">

View File

@@ -16,7 +16,6 @@
<!--V2X预警红色边框-->
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
android:id="@+id/flV2XWarningView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
@@ -39,6 +38,13 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.mogo.eagle.core.function.hmi.ui.widget.SteeringWheelView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--Vip车辆标志-->
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
android:layout_width="@dimen/module_vip_width"

View File

@@ -10,7 +10,7 @@ import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.LimitingVelocityView_TAG
import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerViewLimitingVelocityListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
import com.mogo.och.sweeper.R
import kotlinx.android.synthetic.main.sweeper_limiting_speed.view.*
@@ -29,7 +29,7 @@ class SweeperLimitingVelocityView(
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerViewLimitingVelocityListenerManager.addListener(TAG, this)
CallerLimitingVelocityListenerManager.addListener(TAG, this)
CallerHmiViewControlListenerManager.addListener(LimitingVelocityView_TAG, this)
}
@@ -49,7 +49,7 @@ class SweeperLimitingVelocityView(
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerViewLimitingVelocityListenerManager.removeListener(TAG)
CallerLimitingVelocityListenerManager.removeListener(TAG)
CallerHmiViewControlListenerManager.removeListener(LimitingVelocityView_TAG)
}

View File

@@ -6,8 +6,8 @@ import android.view.LayoutInflater
import android.widget.LinearLayout
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.TrafficLightEnum
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.sweeper.R
import kotlinx.android.synthetic.main.sweeper_traffic_light_view.view.*

View File

@@ -5,33 +5,50 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_72">
<FrameLayout
android:id="@+id/fl_speed"
android:layout_width="@dimen/dp_616"
android:layout_height="@dimen/dp_320"
android:layout_marginLeft="@dimen/dp_13"
android:layout_marginTop="@dimen/dp_40"
android:visibility="visible"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.mogo.och.sweeper.view.SweeperTrafficDataView
android:id="@+id/sweeper_arc"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<FrameLayout
android:id="@+id/fl_speed"
android:layout_width="@dimen/dp_616"
android:layout_height="@dimen/dp_320"
android:layout_marginLeft="@dimen/dp_13"
android:layout_marginTop="@dimen/dp_40"
android:visibility="visible"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent">
</FrameLayout>
<com.mogo.och.sweeper.view.SweeperTrafficDataView
android:id="@+id/sweeper_arc"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
<!--V2X预警红色边框-->
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--刹车、转向-->
<com.mogo.eagle.core.function.hmi.ui.widget.SteeringWheelView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--Vip车辆标志-->
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
android:layout_width="@dimen/module_vip_width"
android:layout_height="@dimen/module_vip_height"
android:layout_marginStart="@dimen/dp_640"
android:layout_marginTop="@dimen/dp_80"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginStart="@dimen/dp_640"
android:layout_marginTop="@dimen/dp_80"/>
app:layout_constraintTop_toTopOf="parent" />
<!--pnc行为决策-->
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
@@ -76,12 +93,12 @@
android:id="@+id/module_mogo_och_autopilot_status"
android:layout_width="@dimen/module_mogo_och_autopilot_status_bg_width"
android:layout_height="@dimen/module_mogo_och_autopilot_status_bg_height"
app:layout_constraintTop_toBottomOf="@+id/fl_speed"
android:background="@drawable/sweeper_autopilot_status_bg"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginLeft="@dimen/dp_13"
android:background="@drawable/sweeper_autopilot_status_bg"
android:gravity="center"
tools:visibility="visible" >
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/fl_speed"
tools:visibility="visible">
<ImageView
android:id="@+id/sweeper_autopilot_btn_iv"
@@ -108,8 +125,8 @@
android:id="@+id/module_mogo_och_station_panel_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginLeft="@dimen/dp_13"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_autopilot_status"
app:layout_goneMarginTop="@dimen/module_mogo_och_station_panel_container_margin_top_no_call"
tools:visibility="visible" />
@@ -118,8 +135,8 @@
android:id="@+id/module_mogo_och_sweeper_operate_panel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_24"
android:layout_marginStart="@dimen/dp_8"
android:layout_marginTop="@dimen/dp_24"
app:layout_constraintLeft_toRightOf="@id/fl_speed"
app:layout_constraintTop_toTopOf="@id/fl_speed"
tools:background="#f00"
@@ -127,40 +144,43 @@
<include
android:id="@+id/module_mogo_och_sweeper_test_bar"
layout="@layout/sweeper_test_bar_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout="@layout/sweeper_test_bar_view"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_station_panel_container"
app:layout_constraintLeft_toLeftOf="@id/module_mogo_och_station_panel_container"
tools:visibility="visible"/>
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_station_panel_container"
tools:visibility="visible" />
<!--切换地图远近事件 @dimen/module_switch_map -->
<LinearLayout
android:id="@+id/sweeper_switch_model_layout"
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
android:background="@drawable/sweeper_switch_map_bg"
android:elevation="@dimen/sweeper_dp_10"
android:padding="@dimen/sweeper_dp_20"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/sweeper_switch_model_layout"
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
android:background="@drawable/sweeper_switch_map_bg"
android:elevation="@dimen/sweeper_dp_10"
android:gravity="center"
android:orientation="horizontal"
android:padding="@dimen/sweeper_dp_20"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent">
<ImageView
android:id="@+id/sweeper_switch_model_icon"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_centerInParent="true"
android:layout_gravity="center" />
</LinearLayout>
<ImageView
android:id="@+id/sweeper_switch_model_icon"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_centerInParent="true"
android:layout_gravity="center" />
</LinearLayout>
<CheckedTextView
android:id="@+id/module_mogo_och_operation_status"
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
android:background="@drawable/sweeper_operation_status_bg"
android:elevation="@dimen/dp_10"
android:gravity="center"
@@ -169,11 +189,9 @@
android:textColor="@color/sweeper_autopilot_text_color_selector"
android:textSize="@dimen/module_mogo_och_autopilot_status_text_size"
android:textStyle="bold"
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:visibility="gone"/>
app:layout_constraintLeft_toLeftOf="parent" />
<RelativeLayout
android:id="@+id/module_mogo_och_setting_layout"
@@ -185,6 +203,7 @@
android:elevation="@dimen/dp_10"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/sweeper_switch_model_layout">
<ImageView
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
@@ -203,12 +222,13 @@
android:elevation="@dimen/dp_10"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_setting_layout">
<ImageView
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:src="@drawable/bad_case_selector"/>
android:src="@drawable/bad_case_selector" />
</RelativeLayout>
<RelativeLayout
@@ -217,8 +237,8 @@
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
android:elevation="@dimen/dp_10"
android:background="@drawable/sweeper_operation_status_bg_selector"
android:elevation="@dimen/dp_10"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_badcase_rl">
@@ -246,8 +266,7 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:textSize="@dimen/module_mogo_och_slide_panel_textSize"
tools:visibility="visible"
/>
tools:visibility="visible" />
<Button
android:id="@+id/btnAutopilotDisable"
@@ -288,6 +307,7 @@
android:textSize="30sp"
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
app:layout_constraintTop_toBottomOf="@id/btnAutopilotRunning" />
<Button
android:id="@+id/btnAutopilotRoute"
android:layout_width="wrap_content"

View File

@@ -713,6 +713,11 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
*/
private final ILimitingVelocityListener limitingVelocityListener = new ILimitingVelocityListener(){
@Override
public void onUnion(int limitingVelocity, @NonNull DataSourceType sourceType) {
}
@Override
public void onLimitingVelocityChange(int limitingVelocity, DataSourceType dataSourceType) {
if (mVeloctityCallback != null){

View File

@@ -16,7 +16,6 @@ import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
import com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxBubbleView;
@@ -321,7 +320,6 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
}
if (showOrHideLefeMenu) {
OverlayLeftViewUtils.INSTANCE.dismissOverlayView(true);
CallerHmiManager.INSTANCE.hideSmallFragment();
}
}
}

View File

@@ -6,8 +6,8 @@ import android.view.LayoutInflater
import android.widget.LinearLayout
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.TrafficLightEnum
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.taxi.passenger.R
import kotlinx.android.synthetic.main.taxi_p_traffic_light_view.view.*

View File

@@ -27,6 +27,15 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--刹车、转向-->
<com.mogo.eagle.core.function.hmi.ui.vehicle.SteeringBrakeView
android:layout_width="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:day_light_mode="true"
android:layout_height="wrap_content"/>
<!--pnc行为决策-->
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
android:layout_width="wrap_content"

View File

@@ -80,6 +80,23 @@
</RelativeLayout>
<!--V2X预警红色边框-->
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--刹车、转向-->
<com.mogo.eagle.core.function.hmi.ui.widget.SteeringWheelView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--Vip车辆标志-->
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
android:layout_width="@dimen/module_vip_width"

View File

@@ -4,7 +4,7 @@ import androidx.test.core.app.ActivityScenario
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.hmi.ui.MoGoHmiFragment
import com.mogo.eagle.core.function.hmi.ui.MoGoHmiProvider
import com.mogo.eagle.core.function.main.MainLauncherActivity
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
@@ -121,15 +121,15 @@ class AutoPilotBadCaseTest {
delay(TimeUnit.HOURS.toMillis(2))
}
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiFragment = suspendCancellableCoroutine {
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiProvider = suspendCancellableCoroutine {
launch.onActivity { itx ->
val executor = Executors.newSingleThreadScheduledExecutor()
executor.scheduleAtFixedRate({
var find =
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
while (find == null) {
find =
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
}
while (!find.isResumed) {

View File

@@ -5,7 +5,7 @@ import androidx.test.core.app.ActivityScenario
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
import com.mogo.eagle.core.function.hmi.ui.MoGoHmiFragment
import com.mogo.eagle.core.function.hmi.ui.MoGoHmiProvider
import com.mogo.eagle.core.function.main.MainLauncherActivity
import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking
@@ -35,15 +35,15 @@ class MapDataCollectTest {
CallerMapDataCollectorManager.setIsInit()
delay(TimeUnit.HOURS.toMillis(1))
}
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiFragment = suspendCancellableCoroutine {
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiProvider = suspendCancellableCoroutine {
launch.onActivity { itx ->
val executor = Executors.newSingleThreadScheduledExecutor()
executor.scheduleAtFixedRate({
var find =
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
while (find == null) {
find =
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
}
while (!find.isResumed) {

View File

@@ -81,15 +81,15 @@ class ReminderTest {
delay(3000000)
}
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiFragment = suspendCancellableCoroutine {
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiProvider = suspendCancellableCoroutine {
launch.onActivity { itx ->
val executor = Executors.newSingleThreadScheduledExecutor()
executor.scheduleAtFixedRate({
var find =
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
while (find == null) {
find =
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
}
while (!find.isResumed) {
Thread.sleep(500)

View File

@@ -136,15 +136,15 @@ class RoadAITest {
}
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiFragment = suspendCancellableCoroutine {
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiProvider = suspendCancellableCoroutine {
launch.onActivity { itx ->
val executor = Executors.newSingleThreadScheduledExecutor()
executor.scheduleAtFixedRate({
var find =
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
while (find == null) {
find =
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
}
while (!find.isResumed) {
Thread.sleep(500)

View File

@@ -3,7 +3,7 @@ package com.mogo.functions.test
import androidx.test.core.app.ActivityScenario
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import com.mogo.eagle.core.function.hmi.ui.MoGoHmiFragment
import com.mogo.eagle.core.function.hmi.ui.MoGoHmiProvider
import com.mogo.eagle.core.function.main.MainLauncherActivity
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
import kotlinx.coroutines.Dispatchers
@@ -44,15 +44,15 @@ class TipToastLeakTest {
delay(TimeUnit.SECONDS.toMillis(2))
}
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiFragment = suspendCancellableCoroutine {
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiProvider = suspendCancellableCoroutine {
launch.onActivity { itx ->
val executor = Executors.newSingleThreadScheduledExecutor()
executor.scheduleAtFixedRate({
var find =
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
while (find == null) {
find =
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
}
while (!find.isResumed) {

View File

@@ -15,7 +15,6 @@ import com.mogo.eagle.function.biz.v2x.overview.OverViewDataManager
import com.mogo.eagle.function.biz.v2x.overview.db.OverviewDb
import com.mogo.eagle.function.biz.v2x.speedlimit.SpeedLimitDispatcher
import com.mogo.eagle.function.biz.v2x.trafficlight.core.MogoTrafficLightManager
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightDispatcher
import com.mogo.eagle.function.biz.v2x.vip.VipCarManager
@Route(path = MogoServicePaths.PATH_FUNC_BIZ)
@@ -31,8 +30,6 @@ class FuncBizProvider : IMoGoFuncBizProvider {
MogoTrafficLightManager.INSTANCE.initServer(context)
VipCarManager.INSTANCE.initServer(context)
TrafficLightDispatcher.INSTANCE.initServer(context) //todo 宏宇 放入dataCenter
SpeedLimitDispatcher.INSTANCE.initLimit(context) //todo 宏宇放入dataCenter
// RedLightWarningManager.INSTANCE.listenTrafficLight()
}
@@ -89,7 +86,6 @@ class FuncBizProvider : IMoGoFuncBizProvider {
cronTaskManager.release()
VipCarManager.INSTANCE.destroy()
TrafficLightDispatcher.INSTANCE.destroy()
// RedLightWarningManager.INSTANCE.onDestroy()
}
}

View File

@@ -13,14 +13,14 @@ import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.data.trafficlight.*
import com.mogo.eagle.core.data.trafficlight.TrafficLightStatusHelper.getCurrentRoadTrafficLight
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.api.vip.IMoGoVipSetListener
import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.api.v2x.IMoGoVipSetListener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.call.v2x.CallVipSetListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
import com.mogo.eagle.core.utilcode.util.LocationUtils

View File

@@ -8,7 +8,7 @@ import com.mogo.eagle.core.data.trafficlight.*
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_LOOP_SEARCH_CROSS_ROAD
@@ -75,7 +75,6 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
trafficLightNetWorkModel.requestTrafficLight(
it.latitude, it.longitude, it.heading, road, { result ->
trafficLightResult = result
// TrafficLightHMIManager.INSTANCE.updateTrafficLight(result)
CallerTrafficLightListenerManager.invokeTrafficLightStatus(result)
},
{ errorMsg ->

View File

@@ -19,13 +19,12 @@ import com.mogo.eagle.core.data.trafficlight.currentRoadTrafficLight
import com.mogo.eagle.core.data.trafficlight.isGreen
import com.mogo.eagle.core.data.trafficlight.isRed
import com.mogo.eagle.core.data.v2x.VipMessage
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.call.v2x.CallVipSetListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
import com.mogo.eagle.core.utilcode.util.ToastUtils

View File

@@ -5,6 +5,8 @@ import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.function.api.datacenter.IDataCenterProvider
import com.mogo.eagle.core.function.datacenter.location.MoGoLocationDispatcher
import com.mogo.eagle.core.function.datacenter.v2x.SpeedLimitDispatcher
import com.mogo.eagle.core.function.datacenter.v2x.TrafficLightDispatcher
@Route(path = MogoServicePaths.PATH_DATA_CENTER_MODULE)
class DataCenterProvider: IDataCenterProvider {
@@ -14,9 +16,15 @@ class DataCenterProvider: IDataCenterProvider {
override fun init(context: Context?) {
MoGoLocationDispatcher.initListener()
context?.let {
TrafficLightDispatcher.INSTANCE.initServer(it)
SpeedLimitDispatcher.INSTANCE.initLimit(it)
}
}
override fun onDestroy() {
TrafficLightDispatcher.INSTANCE.destroy()
SpeedLimitDispatcher.INSTANCE.destroy()
}
}

View File

@@ -1,9 +1,9 @@
package com.mogo.eagle.core.function.datacenter.autopilot.server
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
/**
* @author xiaoyuzhou

View File

@@ -9,7 +9,6 @@ import com.mogo.eagle.core.data.enums.WarningDirectionEnum
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningMapListener
import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningRsiListener
import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningRsmListener
@@ -21,13 +20,12 @@ import com.mogo.eagle.core.function.call.obu.CallerObuMapMathListenerManager
import com.mogo.eagle.core.function.call.obu.CallerObuWarningRsiListenerManager
import com.mogo.eagle.core.function.call.obu.CallerObuWarningRsmListenerManager
import com.mogo.eagle.core.function.call.obu.CallerObuWarningSpatListenerManager
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
import com.mogo.support.obu.ObuScene
import com.mogo.support.obu.constants.MogoObuConstants
import mogo.v2x.ObuWarningEvent.*
import kotlin.math.roundToInt
@@ -258,8 +256,6 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
when (status) {
// 添加
MogoObuConstants.STATUS.ADD -> {
//显示警告红边
CallerHmiManager.showWarning(direction)
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
@@ -275,13 +271,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
CallerHmiManager.warningV2X(
appId,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
object : IMoGoWarningStatusListener {
override fun onDismiss() {
// 关闭警告红边
CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL)
}
}
ttsContent, null, direction
)
// 更新数据,是否需要
@@ -297,7 +287,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
// 删除
MogoObuConstants.STATUS.DELETE -> {
// 关闭警告红边
// CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_NON)
// 更新数据,删除标牌?
// TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(rsiWarningData)
// ?.let {
@@ -345,24 +335,20 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
level = rsmWarningData.warningMsg.warningDataList[0].warningLevel
CallerLogger.d(
"${M_OBU}${TAG}",
"MogoObuDcCombineManager onMogoObuRsmWarning ---status---> ${rsmWarningData.status} --list status----> ${
rsmWarningData.warningMsg.warningDataList.get(
0
).status
"ObuDcCombineManager onObuRsmWarning ---status---> ${rsmWarningData.status} --list status----> ${
rsmWarningData.warningMsg.warningDataList[0].status
} --v2xType--- $v2xType ---alertContent = $alertContent ---ttsContent= $ttsContent"
)
when (rsmWarningData.warningMsg.warningDataList.get(0).status) {
when (rsmWarningData.warningMsg.warningDataList[0].status) {
MogoObuConstants.STATUS.ADD -> { // 添加
//显示警告红边
CallerHmiManager.showWarning(direction)
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
V2XMsg(
v2xType,
alertContent,
ttsContent
ttsContent,
)
).apply {
sourceType = DataSourceType.TELEMATIC
@@ -371,15 +357,9 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
CallerHmiManager.warningV2X(
v2xType,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
object : IMoGoWarningStatusListener {
override fun onDismiss() {
// 关闭警告红边
CallerHmiManager.dismissWarning(
WarningDirectionEnum.ALERT_WARNING_ALL
)
}
}
ttsContent,
null,
direction
)
// 更新数据 TODO
@@ -396,7 +376,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
// 删除
MogoObuConstants.STATUS.DELETE -> {
// 关闭警告红边
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL)
// 更新数据 TODO 由于obu通过域控需要转换单位这里临时转换后面3.0不需要转换
// TrafficDataConvertUtils.cvxPtcThreatIndInfo2TrafficData(rsmWarningData)?.let {
// // 事件结束,还原交通参与者颜色
@@ -451,8 +431,8 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
} --- data.speedMaxLimit = ${data.speedMaxLimit}"
)
when (data.status) {
MogoObuConstants.STATUS.ADD -> { // 添加
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
MogoObuConstants.STATUS.ADD -> { // 添加 TODO
CallerLimitingVelocityListenerManager.invokeUnion(
(data.speedMaxLimit * 0.02 * 3.6).roundToInt().toInt(),
DataSourceType.OBU
)
@@ -462,7 +442,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
}
MogoObuConstants.STATUS.DELETE -> { // 删除
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
CallerLimitingVelocityListenerManager.invokeUnion(
-1,
DataSourceType.OBU
)
@@ -637,7 +617,6 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
sourceType = DataSourceType.TELEMATIC
}
)
CallerHmiManager.warningV2X(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
alertContent,
@@ -651,40 +630,38 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
when (currentLight.light) {
// 灯光不可用
0 -> {
CallerTrafficLightListenerManager.showTrafficLight(
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(
TrafficLightEnum.BLACK,
-1,
DataSourceType.TELEMATIC
)
}
// 红灯
2, 3 -> {
CallerTrafficLightListenerManager.showTrafficLight(
val red = (currentLight.countDown / 10).toInt()
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(
TrafficLightEnum.RED,
red,
DataSourceType.TELEMATIC
)
val red = currentLight.countDown / 10
CallerTrafficLightListenerManager.changeCountdownRed(red.toInt())
}
// 绿灯
4, 5, 6 -> {
CallerTrafficLightListenerManager.showTrafficLight(
val green = (currentLight.countDown / 10).toInt()
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(
TrafficLightEnum.GREEN,
green,
DataSourceType.TELEMATIC
)
val green = currentLight.countDown / 10
CallerTrafficLightListenerManager.changeCountdownGreen(green.toInt())
}
// 黄灯
7, 8 -> {
CallerTrafficLightListenerManager.showTrafficLight(
val yellow = (currentLight.countDown / 10).toInt()
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(
TrafficLightEnum.YELLOW,
yellow,
DataSourceType.TELEMATIC
)
val yellow = currentLight.countDown / 10
CallerTrafficLightListenerManager.changeCountdownYellow(yellow.toInt())
}
}
}

View File

@@ -16,8 +16,8 @@ import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Defa
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.TooClose
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.call.obu.CallerObuConnectListenerManager
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.datacenter.obu.utils.TrafficDataConvertUtilsNew
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
@@ -410,12 +410,7 @@ class MogoPrivateObuNewManager private constructor() {
appId,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
object : IMoGoWarningStatusListener {
override fun onDismiss() {
// 关闭警告红边
CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL)
}
}
null, direction
)
// 更新数据
@@ -551,8 +546,6 @@ class MogoPrivateObuNewManager private constructor() {
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
return
}
//显示警告红边
CallerHmiManager.showWarning(direction)
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
@@ -570,14 +563,7 @@ class MogoPrivateObuNewManager private constructor() {
v2xType,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
object : IMoGoWarningStatusListener {
override fun onDismiss() {
// 关闭警告红边
CallerHmiManager.dismissWarning(
WarningDirectionEnum.ALERT_WARNING_ALL
)
}
}
null, direction
)
}
@@ -586,7 +572,7 @@ class MogoPrivateObuNewManager private constructor() {
MogoObuConstants.STATUS.DELETE -> { // 删除
// 关闭警告红边
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL)
//删除弱势交通元素
CallerMapUIServiceManager.getMarkerService()
?.removeCvxRvInfoIndInfo(data.participant.ptcId.toString())
@@ -612,7 +598,7 @@ class MogoPrivateObuNewManager private constructor() {
MogoObuConstants.STATUS.ADD -> { // 添加
UiThreadHandler.post {
if (data.speedMaxLimit > 0) {
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
CallerLimitingVelocityListenerManager.invokeUnion(
(data.speedMaxLimit * 3.6).roundToInt(), DataSourceType.OBU
)
}
@@ -624,7 +610,7 @@ class MogoPrivateObuNewManager private constructor() {
MogoObuConstants.STATUS.DELETE -> { // 删除
UiThreadHandler.post {
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
CallerLimitingVelocityListenerManager.invokeUnion(
-1,
DataSourceType.OBU
)
@@ -637,196 +623,367 @@ class MogoPrivateObuNewManager private constructor() {
}
/**
* 获取消息的方位 车辆相关
*/
private fun getMessageDirection(targetClassification: Int): WarningDirectionEnum {
// CallerLogger.d("$M_OBU${TAG_MOGO_NEW_OBU}", "预警红边:预警方向->$targetClassification")
return when (targetClassification) {
MogoObuConstants.VEH_TARGET_POSITION.AHEAD_IN_LANE,
MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_TOP //正前方
/**
* 获取消息的方位 车辆相关
*/
private fun getMessageDirection(targetClassification: Int): WarningDirectionEnum {
// CallerLogger.d("$M_OBU${TAG_MOGO_NEW_OBU}", "预警红边:预警方向->$targetClassification")
return when (targetClassification) {
MogoObuConstants.VEH_TARGET_POSITION.AHEAD_IN_LANE,
MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_TOP //正前方
MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_BOTTOM //正后方
MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_BOTTOM //正后方
MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_RIGHT -> WarningDirectionEnum.ALERT_WARNING_RIGHT //正右方
MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_RIGHT -> WarningDirectionEnum.ALERT_WARNING_RIGHT //正右方
MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_LEFT -> WarningDirectionEnum.ALERT_WARNING_LEFT //正左方
MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_LEFT -> WarningDirectionEnum.ALERT_WARNING_LEFT //正左方
MogoObuConstants.VEH_TARGET_POSITION.AHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_LEFT,
MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_LEFT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAR_LEFT
-> WarningDirectionEnum.ALERT_WARNING_TOP_LEFT //左前方
MogoObuConstants.VEH_TARGET_POSITION.AHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_LEFT,
MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_LEFT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAR_LEFT
-> WarningDirectionEnum.ALERT_WARNING_TOP_LEFT //左前方
MogoObuConstants.VEH_TARGET_POSITION.AHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_RIGHT,
MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAT_RIGHT
-> WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT //右前方
MogoObuConstants.VEH_TARGET_POSITION.AHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_RIGHT,
MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAT_RIGHT
-> WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT //右前方
MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_LEFT,
-> WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT //左后方
MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_LEFT,
-> WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT //左后方
MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_RIGHT,
-> WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT //右后方
MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_RIGHT,
-> WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT //右后方
MogoObuConstants.VEH_TARGET_POSITION.UNCLASSIFIED -> WarningDirectionEnum.ALERT_WARNING_NON //未知
else -> WarningDirectionEnum.ALERT_WARNING_ALL
MogoObuConstants.VEH_TARGET_POSITION.UNCLASSIFIED -> WarningDirectionEnum.ALERT_WARNING_NON //未知
else -> WarningDirectionEnum.ALERT_WARNING_ALL
}
}
/**
* 构造对应展示数据和场景 根据obu的场景add change delete确定是否展示
*
* @param appId 使用WarningTypeEnum获取icon、提示内容、tts内容 TODO 添加事件频繁播报拦截
*
* @see com.mogo.module.common.enums.EventTypeEnum
*/
private fun handleSdkObu(
appId: String,
direction: WarningDirectionEnum,
status: Int,
level: Int,
info: MogoObuRvWarningData
) {
// 这里排除需要特殊定制的语音及文案外,其余的都可以使用 EventTypeEnumNew 提供的
var alertContent: String = ""
var ttsContent: String = ""
var changeVisualAngle = false
when (appId) {
//交叉路口碰撞预警
MogoObuConstants.V2X_WARNING_TYPE.FCW.toString() -> {
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
}
//交叉路口碰撞预警
MogoObuConstants.V2X_WARNING_TYPE.ICW.toString() -> {
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType)
}
//左转辅助预警
MogoObuConstants.V2X_WARNING_TYPE.LTA.toString() -> {
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType)
}
//盲区预警
MogoObuConstants.V2X_WARNING_TYPE.BSW.toString() -> {
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType)
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType)
if (
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
) { //左后
changeVisualAngle = true
ttsContent = String.format(ttsContent, "")
alertContent = String.format(alertContent, "")
} else if (
direction == WarningDirectionEnum.ALERT_WARNING_RIGHT ||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT ||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT
) { //右后
changeVisualAngle = true
ttsContent = String.format(ttsContent, "")
alertContent = String.format(alertContent, "")
}
}
// 变道预警,注意左后车辆/注意右后车辆
MogoObuConstants.V2X_WARNING_TYPE.LCW.toString() -> {
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType)
if (
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
) {
ttsContent = String.format(ttsContent, "")
alertContent = String.format(alertContent, "")
} else if (
direction == WarningDirectionEnum.ALERT_WARNING_RIGHT ||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT ||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT
) {
ttsContent = String.format(ttsContent, "")
alertContent = String.format(alertContent, "")
}
}
//逆向超车预警
MogoObuConstants.V2X_WARNING_TYPE.DNPW.toString() -> {
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType)
}
//紧急制动预警
MogoObuConstants.V2X_WARNING_TYPE.EBW.toString() -> {
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType)
}
//异常车辆提醒
MogoObuConstants.V2X_WARNING_TYPE.AVW.toString() -> {
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType)
alertContent = String.format(alertContent, direction.desc)
ttsContent = String.format(ttsContent, direction.desc)
}
//车辆失控预警
MogoObuConstants.V2X_WARNING_TYPE.CLW.toString() -> {
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType)
alertContent = String.format(alertContent, direction.desc)
ttsContent = String.format(ttsContent, direction.desc)
}
//车辆失控预警
MogoObuConstants.V2X_WARNING_TYPE.EVW.toString() -> {
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
}
// 这里处理固定的提示信息,包括了<紧急车辆提醒>
else -> { //TODO
// ttsContent = EventTypeEnumNew.getWarningTts(appId.toString())
// alertContent = EventTypeEnumNew.getWarningContent(appId.toString())
}
}
/**
* 构造对应展示数据和场景 根据obu的场景add change delete确定是否展示
*
* @param appId 使用WarningTypeEnum获取icon、提示内容、tts内容 TODO 添加事件频繁播报拦截
*
* @see com.mogo.module.common.enums.EventTypeEnum
*/
private fun handleSdkObu(
appId: String,
direction: WarningDirectionEnum,
status: Int,
level: Int,
info: MogoObuRvWarningData
) {
// 这里排除需要特殊定制的语音及文案外,其余的都可以使用 EventTypeEnumNew 提供的
var alertContent: String = ""
var ttsContent: String = ""
var changeVisualAngle = false
when (appId) {
//交叉路口碰撞预警
MogoObuConstants.V2X_WARNING_TYPE.FCW.toString() -> {
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
}
when (status) {
// 添加,更新 add的时候可能级别是2
MogoObuConstants.STATUS.ADD,
MogoObuConstants.STATUS.UPDATE -> {
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"new handleSdkObu appId2 = $appId --- level = $level ---ttsContent = $ttsContent --- alertContent = $alertContent --- direction = $direction"
)
if (level == 2 || level == 3) {
//不显示弹框,其它保留
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
V2XMsg(
appId,
alertContent,
ttsContent
)
).apply {
sourceType = DataSourceType.OBU
}
)
CallerHmiManager.warningV2X(
appId,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
object : IMoGoWarningStatusListener {
override fun onShow() {
super.onShow()
if (changeVisualAngle) {
CallerVisualAngleManager.changeVisualAngle(TooClose)
}
}
//交叉路口碰撞预警
MogoObuConstants.V2X_WARNING_TYPE.ICW.toString() -> {
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType)
override fun onDismiss() {
if (changeVisualAngle) {
CallerVisualAngleManager.changeVisualAngle(Default())
}
}
}, direction
)
}
//左转辅助预警
MogoObuConstants.V2X_WARNING_TYPE.LTA.toString() -> {
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType)
}
//盲区预警
MogoObuConstants.V2X_WARNING_TYPE.BSW.toString() -> {
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType)
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType)
if (
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
) { //左后
changeVisualAngle = true
ttsContent = String.format(ttsContent, "")
alertContent = String.format(alertContent, "")
} else if (
direction == WarningDirectionEnum.ALERT_WARNING_RIGHT ||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT ||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT
) { //右后
changeVisualAngle = true
ttsContent = String.format(ttsContent, "")
alertContent = String.format(alertContent, "")
}
}
// 变道预警,注意左后车辆/注意右后车辆
MogoObuConstants.V2X_WARNING_TYPE.LCW.toString() -> {
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType)
if (
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
) {
ttsContent = String.format(ttsContent, "")
alertContent = String.format(alertContent, "")
} else if (
direction == WarningDirectionEnum.ALERT_WARNING_RIGHT ||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT ||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT
) {
ttsContent = String.format(ttsContent, "")
alertContent = String.format(alertContent, "")
}
}
//逆向超车预警
MogoObuConstants.V2X_WARNING_TYPE.DNPW.toString() -> {
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType)
}
//紧急制动预警
MogoObuConstants.V2X_WARNING_TYPE.EBW.toString() -> {
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType)
}
//异常车辆提醒
MogoObuConstants.V2X_WARNING_TYPE.AVW.toString() -> {
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType)
alertContent = String.format(alertContent, direction.desc)
ttsContent = String.format(ttsContent, direction.desc)
}
//车辆失控预警
MogoObuConstants.V2X_WARNING_TYPE.CLW.toString() -> {
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType)
alertContent = String.format(alertContent, direction.desc)
ttsContent = String.format(ttsContent, direction.desc)
}
//车辆失控预警
MogoObuConstants.V2X_WARNING_TYPE.EVW.toString() -> {
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
}
// 这里处理固定的提示信息,包括了<紧急车辆提醒>
else -> { //TODO
// ttsContent = EventTypeEnumNew.getWarningTts(appId.toString())
// alertContent = EventTypeEnumNew.getWarningContent(appId.toString())
//更新周边车辆进行预警颜色变换,车辆实时移动和变色 UUID不需要匹配了
TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let {
CallerMapUIServiceManager.getMarkerService()
?.updateITrafficThreatLevelInfo(it)
}
}
// 删除
MogoObuConstants.STATUS.DELETE -> {
// 关闭警告红边
CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL)
//更新周边车辆进行预警颜色变换,车辆实时移动和变色
TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let {
it.threatLevel = 0x01
CallerMapUIServiceManager.getMarkerService()
?.updateITrafficThreatLevelInfo(it)
}
}
}
}
when (status) {
// 添加,更新 add的时候可能级别是2
MogoObuConstants.STATUS.ADD,
MogoObuConstants.STATUS.UPDATE -> {
/**
* 处理红绿灯
*/
private fun handlerTrafficLight(appId: Int, status: Int, lights: List<SpatLight>) {
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"handlerTrafficLight --- status = $status ---lights.size = ${lights.size} ---lights = $lights ---appId = $appId"
)
when (status) {
// 添加
MogoObuConstants.STATUS.ADD,
MogoObuConstants.STATUS.UPDATE
-> {
if (lights != null && lights.isNotEmpty()) {
changeTrafficLightStatus(appId, lights)
}
}
// 删除
MogoObuConstants.STATUS.DELETE -> {
// 移除顶部弹窗
CallerTrafficLightListenerManager.disableTrafficLight()
isShowGreenWave = false
isShowRunRedLight = false
// lightCountDownRed = 1
// lightCountDownGreen = 1
// lightCountDownYellow = 1
}
}
}
private var isShowGreenWave = false
private var isShowRunRedLight = false
/**
* 修改红绿灯
*/
@Synchronized
private fun changeTrafficLightStatus(
appId: Int,
lights: List<SpatLight>
) {
var ttsContent = ""
var alertContent = ""
//这里需要根据真实数据确定 index 取值方式
val currentLight = lights[0]
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"changeTrafficLightStatus currentLight = $currentLight ----currentLight.light = ${currentLight.light} ---currentLight.phase = ${currentLight.phaseId} ---appId = $appId --countDown = ${currentLight.countDown.toInt()}"
)
// 闯红灯预警,绿波通行和闯红灯是互斥的
when (appId) {
0 -> {//不可用 V2I_RLVW_VIOLATION_TYPE_UNAVAILABLE 无效
}
1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次
if (!isShowRunRedLight) {
isShowRunRedLight = true
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"new handleSdkObu appId2 = $appId --- level = $level ---ttsContent = $ttsContent --- alertContent = $alertContent --- direction = $direction"
"changeTrafficLightStatus 闯红灯 --------> "
)
if (level == 2 || level == 3) {
//不显示弹框,其它保留
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
V2XMsg(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
alertContent,
ttsContent
)
).apply {
sourceType = DataSourceType.OBU
}
)
CallerHmiManager.warningV2X(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
alertContent,
ttsContent// 只有第一次才tts防止更新的时候不断的提醒
)
}
}
2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次 100m的时候
if (!isShowGreenWave) {
isShowGreenWave = true
var minSpeedTemp = Math.round(currentLight.suggestMinSpeed * 3.6)
var maxSpeedTemp = Math.round(currentLight.suggestMaxSpeed * 3.6)
if (minSpeedTemp == maxSpeedTemp) {
minSpeedTemp -= 5
}
val adviceSpeed = "$minSpeedTemp - $maxSpeedTemp"
val adviceSpeedTts = "$minSpeedTemp$maxSpeedTemp"
// val adviceSpeed =
// "${Math.round(currentLight.suggestMinSpeed*3.6)} - ${Math.round(currentLight.suggestMaxSpeed*3.6)}"
// val adviceSpeedTts =
// "${Math.round(currentLight.suggestMinSpeed*3.6)} 到 ${Math.round(currentLight.suggestMaxSpeed*3.6)}"
ttsContent =
String.format(
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
adviceSpeedTts
)
alertContent =
String.format(
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
adviceSpeed
)
val maxSpeed = currentLight.suggestMaxSpeed
if (maxSpeed > 0) {
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
V2XMsg(
appId,
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
alertContent,
ttsContent
)
@@ -835,205 +992,34 @@ class MogoPrivateObuNewManager private constructor() {
}
)
CallerHmiManager.warningV2X(
appId,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
object : IMoGoWarningStatusListener {
override fun onShow() {
super.onShow()
if (changeVisualAngle) {
CallerVisualAngleManager.changeVisualAngle(TooClose)
}
}
override fun onDismiss() {
// 关闭警告红边
CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL)
if (changeVisualAngle) {
CallerVisualAngleManager.changeVisualAngle(Default())
}
}
}
)
//显示警告红边
CallerHmiManager.showWarning(direction)
}
//更新周边车辆进行预警颜色变换,车辆实时移动和变色 UUID不需要匹配了
TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let {
CallerMapUIServiceManager.getMarkerService()
?.updateITrafficThreatLevelInfo(it)
}
}
// 删除
MogoObuConstants.STATUS.DELETE -> {
// 关闭警告红边
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
// 移除顶部弹窗
// CallerHmiManager.disableWarningV2X((appId + direction.direction))
//更新周边车辆进行预警颜色变换,车辆实时移动和变色
TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let {
it.threatLevel = 0x01
CallerMapUIServiceManager.getMarkerService()
?.updateITrafficThreatLevelInfo(it)
}
}
}
}
/**
* 处理红绿灯
*/
private fun handlerTrafficLight(appId: Int, status: Int, lights: List<SpatLight>) {
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"handlerTrafficLight --- status = $status ---lights.size = ${lights.size} ---lights = $lights ---appId = $appId"
)
when (status) {
// 添加
MogoObuConstants.STATUS.ADD,
MogoObuConstants.STATUS.UPDATE
-> {
if (lights != null && lights.isNotEmpty()) {
changeTrafficLightStatus(appId, lights)
}
}
// 删除
MogoObuConstants.STATUS.DELETE -> {
// 移除顶部弹窗
CallerTrafficLightListenerManager.disableTrafficLight()
isShowGreenWave = false
isShowRunRedLight = false
}
}
}
private var isYellowLight = false
private var isShowGreenWave = false
private var isShowRunRedLight = false
/**
* 修改红绿灯
*/
@Synchronized
private fun changeTrafficLightStatus(
appId: Int,
lights: List<SpatLight>
) {
var ttsContent = ""
var alertContent = ""
//这里需要根据真实数据确定 index 取值方式
val currentLight = lights[0]
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"changeTrafficLightStatus currentLight = $currentLight ----currentLight.light = ${currentLight.light} ---currentLight.phase = ${currentLight.phaseId} ---appId = $appId --countDown = ${currentLight.countDown.toInt()}"
)
// 闯红灯预警,绿波通行和闯红灯是互斥的
when (appId) {
0 -> {//不可用 V2I_RLVW_VIOLATION_TYPE_UNAVAILABLE 无效
}
1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次
if (!isShowRunRedLight) {
isShowRunRedLight = true
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"changeTrafficLightStatus 闯红灯 --------> "
)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
V2XMsg(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
alertContent,
ttsContent
)
).apply {
sourceType = DataSourceType.OBU
}
)
CallerHmiManager.warningV2X(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
alertContent,
ttsContent// 只有第一次才tts防止更新的时候不断的提醒
)
}
}
2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次 100m的时候
if (!isShowGreenWave) {
isShowGreenWave = true
var minSpeedTemp = Math.round(currentLight.suggestMinSpeed * 3.6)
var maxSpeedTemp = Math.round(currentLight.suggestMaxSpeed * 3.6)
if (minSpeedTemp == maxSpeedTemp) {
minSpeedTemp -= 5
}
val adviceSpeed = "$minSpeedTemp - $maxSpeedTemp"
val adviceSpeedTts = "$minSpeedTemp$maxSpeedTemp"
ttsContent =
String.format(
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
adviceSpeedTts
)
alertContent =
String.format(
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
adviceSpeed
)
val maxSpeed = currentLight.suggestMaxSpeed
if (maxSpeed > 0) {
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
V2XMsg(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
alertContent,
ttsContent
)
).apply {
sourceType = DataSourceType.OBU
}
)
CallerHmiManager.warningV2X(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
alertContent,
ttsContent// 只有第一次才tts防止更新的时候不断的提醒
)
}
}
}
}
when (currentLight.light) {
// 灯光不可用
0 -> {
CallerTrafficLightListenerManager.invokeObuTrafficLightStatus(TrafficLightEnum.BLACK)
}
// 红灯
2, 3 -> {
CallerTrafficLightListenerManager.invokeObuTrafficLightStatus(TrafficLightEnum.RED)
}
// 绿灯
4, 5, 6 -> {
CallerTrafficLightListenerManager.invokeObuTrafficLightStatus(TrafficLightEnum.GREEN)
}
// 黄灯
7, 8 -> {
CallerTrafficLightListenerManager.invokeObuTrafficLightStatus(TrafficLightEnum.YELLOW)
}
}
}
when (currentLight.light) {
// 灯光不可用
0 -> {
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(TrafficLightEnum.BLACK,-1,DataSourceType.OBU)
}
// 红灯
2, 3 -> {
val red = currentLight.countDown.toInt()
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(TrafficLightEnum.RED,red,DataSourceType.OBU)
}
// 绿灯
4, 5, 6 -> {
val green = currentLight.countDown.toInt()
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(TrafficLightEnum.GREEN,green,DataSourceType.OBU)
}
// 黄灯
7, 8 -> {
val yellow = currentLight.countDown.toInt()
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(TrafficLightEnum.YELLOW,yellow,DataSourceType.OBU)
}
}
}

View File

@@ -1,12 +1,9 @@
package com.mogo.eagle.function.biz.v2x.speedlimit
package com.mogo.eagle.core.function.datacenter.v2x
import android.content.Context
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerViewLimitingVelocityListenerManager
import com.zhjt.service_biz.BizConfig
/**
* @author lixiaopeng
@@ -35,11 +32,12 @@ class SpeedLimitDispatcher : ILimitingVelocityListener {
* 地图限速数据
*/
// @BizConfig(FuncBizConfig.V2I, "", FuncBizConfig.BIZ_SLW) //todo arrow 重新考虑放的位置
override fun onLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
override fun onUnion(limitingVelocity: Int, sourceType: DataSourceType) {
super.onUnion(limitingVelocity, sourceType)
when (sourceType) { // obu 优先级高于 map体现链路能力
DataSourceType.OBU -> {
hasObuStatus = limitingVelocity > 0
CallerViewLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
limitingVelocity,
sourceType
)
@@ -47,7 +45,7 @@ class SpeedLimitDispatcher : ILimitingVelocityListener {
}
DataSourceType.MAP -> {
if (!hasObuStatus) {
CallerViewLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
limitingVelocity,
sourceType
)

View File

@@ -1,4 +1,4 @@
package com.mogo.eagle.function.biz.v2x.trafficlight.core
package com.mogo.eagle.core.function.datacenter.v2x
import android.content.Context
import android.os.Handler
@@ -6,12 +6,31 @@ import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.TrafficLightEnum
import com.mogo.eagle.core.data.trafficlight.*
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import perception.TrafficLightOuterClass
import perception.TrafficLightOuterClass.TrafficLight
fun TrafficLightStatus.convert(): TrafficLightEnum {
return when {
this.isGreen() || this.isFlashGreen() -> TrafficLightEnum.GREEN
this.isYellow() -> TrafficLightEnum.YELLOW
this.isRed() -> TrafficLightEnum.RED
else -> TrafficLightEnum.BLACK
}
}
fun TrafficLight.convert(): TrafficLightEnum {
return when (this.state) {
TrafficLightOuterClass.LightState.STATE_GREEN -> TrafficLightEnum.GREEN
TrafficLightOuterClass.LightState.STATE_YELLOW -> TrafficLightEnum.YELLOW
TrafficLightOuterClass.LightState.STATE_RED -> TrafficLightEnum.RED
TrafficLightOuterClass.LightState.STATE_OFF -> TrafficLightEnum.BLACK
else -> TrafficLightEnum.BLACK
}
}
/**
* @author XuXinChao
* @description 对多个红绿灯信号来源进行统一调度AI云工控机OBU
@@ -38,7 +57,7 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
fun initServer(context: Context) {
mContext = context
//注册监听AI云获取红绿灯状态
//注册监听AI云.OBU路侧获取红绿灯状态
CallerTrafficLightListenerManager.addListener(TAG, this)
//注册监听工控机感知红绿灯
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
@@ -66,39 +85,8 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
//隐藏红绿灯显示
CallerTrafficLightListenerManager.disableTrafficLight()
} else {
when (light.state) {
TrafficLightOuterClass.LightState.STATE_RED -> {
//红灯
CallerTrafficLightListenerManager.showTrafficLight(
TrafficLightEnum.RED,
DataSourceType.TELEMATIC
)
CallerTrafficLightListenerManager.changeCountdownRed(0)
}
TrafficLightOuterClass.LightState.STATE_YELLOW -> {
//黄灯
CallerTrafficLightListenerManager.showTrafficLight(
TrafficLightEnum.YELLOW,
DataSourceType.TELEMATIC
)
CallerTrafficLightListenerManager.changeCountdownYellow(0)
}
TrafficLightOuterClass.LightState.STATE_GREEN -> {
//绿灯
CallerTrafficLightListenerManager.showTrafficLight(
TrafficLightEnum.GREEN,
DataSourceType.TELEMATIC
)
CallerTrafficLightListenerManager.changeCountdownGreen(0)
}
TrafficLightOuterClass.LightState.STATE_OFF -> {
//黑灯,隐藏红绿灯显示
CallerTrafficLightListenerManager.disableTrafficLight()
}
else -> {}
}
onTrafficLightPlusSource(light.convert(), 0, DataSourceType.TELEMATIC)
}
}
}
}
@@ -109,8 +97,8 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
*/
override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) {
if (!hasObuLightStatus) {
updateTrafficLight(trafficLightResult)
hasAiLightStatus = true
updateTrafficLight(trafficLightResult)
}
}
@@ -140,10 +128,38 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
/**
* obu 红绿灯数据
*/
override fun onObuTrafficLightStatus(light: TrafficLightEnum) {
super.onObuTrafficLightStatus(light)
hasObuLightStatus = true
CallerTrafficLightListenerManager.showTrafficLight(light, DataSourceType.OBU)
override fun onTrafficLightPlusSource(
light: TrafficLightEnum,
remain: Int,
lightSource: DataSourceType
) {
super.onTrafficLightPlusSource(light, remain, lightSource)
if (lightSource == DataSourceType.OBU) {
hasObuLightStatus = true //todo 会存在优先级高的数据没有回调,导致没有数据出现
}
CallerTrafficLightListenerManager.showTrafficLight(light, lightSource)
if (remain == -1) {
CallerTrafficLightListenerManager.disableTrafficLightCountDown()
return
}
when (light) {
TrafficLightEnum.GREEN -> {
CallerTrafficLightListenerManager.changeCountdownGreen(remain)
}
TrafficLightEnum.RED -> {
CallerTrafficLightListenerManager.changeCountdownRed(remain)
}
TrafficLightEnum.YELLOW -> {
CallerTrafficLightListenerManager.changeCountdownYellow(remain)
}
TrafficLightEnum.BLACK -> {
CallerTrafficLightListenerManager.disableTrafficLightCountDown()
}
}
}
private fun updateTrafficLight(trafficLightResult: TrafficLightResult) {
@@ -154,25 +170,13 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
} else {
it.remain
}
when {
it.isGreen() || it.isFlashGreen() -> {
CallerTrafficLightListenerManager.showTrafficLight(TrafficLightEnum.GREEN, DataSourceType.AICLOUD)
CallerTrafficLightListenerManager.changeCountdownGreen(remain)
}
it.isYellow() -> {
CallerTrafficLightListenerManager.showTrafficLight(TrafficLightEnum.YELLOW, DataSourceType.AICLOUD)
CallerTrafficLightListenerManager.changeCountdownYellow(remain)
}
it.isRed() -> {
CallerTrafficLightListenerManager.showTrafficLight(TrafficLightEnum.RED, DataSourceType.AICLOUD)
CallerTrafficLightListenerManager.changeCountdownRed(remain)
}
}
onTrafficLightPlusSource(it.convert(), remain, DataSourceType.AICLOUD)
}
}
fun destroy() {
//取消注册监听AI云获取红绿灯状态
//取消注册监听AI云.OBU,路侧获取红绿灯状态
CallerTrafficLightListenerManager.removeListener(TAG)
//取消注册监听工控机感知红绿灯
CallerAutopilotIdentifyListenerManager.removeListener(TAG)

View File

@@ -7,7 +7,7 @@ import android.view.View
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.LimitingVelocityView_TAG
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerViewLimitingVelocityListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
import com.mogo.eagle.core.function.hmi.WaringConst
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
@@ -61,7 +61,7 @@ class V2XLimitingVelocityBroadcastReceiver : BroadcastReceiver() {
* @param limitingVelocitySpeed 限速速度
*/
private fun dispatchShowWaring(limitingVelocitySpeed: Int) {
CallerViewLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(limitingVelocitySpeed,DataSourceType.MAP)
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(limitingVelocitySpeed,DataSourceType.MAP)
}
/**

View File

@@ -5,7 +5,7 @@ import android.content.Context
import android.content.Intent
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.TrafficLightEnum
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.hmi.WaringConst
/**

View File

@@ -14,7 +14,7 @@ import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.call.v2x.CallerViewLimitingVelocityListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
/**
* V2X 预警广播接收。用于跨应用,跨进程,内部也可以通过这种方式弹出预警提示框
@@ -77,7 +77,7 @@ class V2XWarningBroadcastReceiver : BroadcastReceiver() {
ttsContent: String?,
) {
if (EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType == v2xType.toString()) {
CallerViewLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(1,DataSourceType.MAP)
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(1,DataSourceType.MAP)
}
if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) {
Log.d("MsgBox-V2XWarningBR", "alertContent或ttsContent为空!")

View File

@@ -1,13 +0,0 @@
package com.mogo.eagle.core.function.hmi.ui
import com.mogo.commons.mvp.Presenter
/**
* @author xiaoyuzhou
* @date 2021/8/3 3:55 下午
*/
class HmiPresenter(view: MoGoHmiContract.View?) :
Presenter<MoGoHmiContract.View?>(view) {
}

View File

@@ -1,19 +0,0 @@
package com.mogo.eagle.core.function.hmi.ui
import com.mogo.commons.mvp.IView
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
/**
*@author xiaoyuzhou
*@date 2021/8/4 3:38 下午
*/
interface MoGoHmiContract {
interface View : IView {
}
}

View File

@@ -3,18 +3,15 @@ package com.mogo.eagle.core.function.hmi.ui
import android.content.Context
import android.text.TextUtils
import android.view.ViewGroup
import androidx.lifecycle.ProcessLifecycleOwner
import androidx.lifecycle.lifecycleScope
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.mogo.commons.context.ContextHolderUtil
import com.mogo.commons.mvp.BaseFragment
import com.mogo.commons.mvp.MvpFragment
import com.mogo.commons.voice.AIAssist
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_FRAGMENT_HMI
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_RTS
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I
import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean
@@ -26,10 +23,8 @@ import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoHmiProvider
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.call.v2x.CallerV2XWarningListenerManager
import com.mogo.eagle.core.function.hmi.ui.camera.RoadVideoDialog
import com.mogo.eagle.core.function.hmi.ui.notice.DispatchDialogManager
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeCheckDialog
@@ -42,15 +37,12 @@ import com.mogo.eagle.core.function.hmi.ui.tools.ModifyBindingCarDialog
import com.mogo.eagle.core.function.hmi.ui.tools.ToBindingCarDialog
import com.mogo.eagle.core.function.hmi.ui.tools.UpgradeAppDialog
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
import com.mogo.eagle.core.function.main.DisplayEffectsHelper
import com.mogo.eagle.core.utilcode.kotlin.safeCancel
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.zhjt.service_biz.BizConfig
import kotlinx.android.synthetic.main.fragment_hmi.*
import kotlinx.coroutines.*
import java.util.concurrent.atomic.AtomicReference
@@ -59,36 +51,19 @@ import java.util.concurrent.atomic.AtomicReference
* @date 2021/8/3 2:40 下午
* 预警图层
*/
@Route(path = MoGoFragmentPaths.PATH_FRAGMENT_HMI)
class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
IMoGoHmiProvider,
MoGoHmiContract.View {
@Route(path = PATH_FRAGMENT_HMI)
class MoGoHmiProvider : IMoGoHmiProvider {
companion object {
private const val TAG = "MoGoHmiFragment"
private const val TAG = "MoGoHmiProvider"
}
private val lastSpeakJob by lazy { AtomicReference<Job>() }
private var lastShowV2XJob: Job? = null
private var context: Context? = null
override fun initViews() {
}
override fun showIPCReportWindow(
errorReportList: ArrayList<ReportEntity>,
warningReportList: ArrayList<ReportEntity>,
reportLevel: Int
) {
ThreadUtils.runOnUiThread {
if (reportLevel == 1) {
IPCReportWindow.show(
requireContext(),
errorReportList,
warningReportList,
reportLevel
)
}
}
override fun init(context: Context?) {
this.context = context
}
override fun setStatusBarDarkOrLight(light: Boolean) {
@@ -97,28 +72,19 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
override fun updateStatusBarRightView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
CallerHmiViewControlListenerManager.updateStatusBarRightView(
StatusBarView.TAG,
insert,
tag,
viewGroup
StatusBarView.TAG, insert, tag, viewGroup
)
}
override fun updateStatusBarLeftView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
CallerHmiViewControlListenerManager.updateStatusBarLeftView(
StatusBarView.TAG,
insert,
tag,
viewGroup
StatusBarView.TAG, insert, tag, viewGroup
)
}
override fun updateStatusBarDownloadView(insert: Boolean, tag: String, progress: Int) {
CallerHmiViewControlListenerManager.updateStatusBarDownloadView(
StatusBarView.TAG,
insert,
tag,
progress
StatusBarView.TAG, insert, tag, progress
)
}
@@ -126,23 +92,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
CallerHmiViewControlListenerManager.updateMfStatus(StatusBarView.TAG, tag, status)
}
override fun getLayoutId(): Int {
return R.layout.fragment_hmi
}
override fun getTagName(): String {
return TAG
}
override fun createPresenter(): HmiPresenter {
return HmiPresenter(this)
}
override fun displayEffects() {
DisplayEffectsHelper.getInstance().display()
}
/** todo----------------------------------------------- **/
/**
* 不展示顶部弹窗其它保留
*/
@@ -152,32 +101,31 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
alertContent: CharSequence?,
ttsContent: String?,
listener: IMoGoWarningStatusListener?,
playTts: Boolean,
direction: WarningDirectionEnum,
expireTime: Long
) {
val playTTS =
playTts && !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
activity?.let {
val warningContent = alertContent
?: EventTypeEnumNew.getWarningContent(v2xType)
val playTTS = !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
context?.let {
val warningContent = alertContent ?: EventTypeEnumNew.getWarningContent(v2xType)
if (warningContent.isEmpty()) {
CallerLogger.e("$M_HMI$TAG", "Show warningContent is null or empty!")
return
}
listener?.onShow()
CallerV2XWarningListenerManager.show(v2xType, direction, expireTime)
CallerLogger.d(
"$M_HMI$TAG",
"--- show v2x dialog 1 ---: info -> v2x-type: $v2xType : expireTime: $expireTime"
)
lastShowV2XJob?.safeCancel()
lifecycleScope.launch {
ProcessLifecycleOwner.get().lifecycleScope.launch(Dispatchers.Main) {
delay(expireTime)
}.also { itx ->
lastShowV2XJob = itx
}.invokeOnCompletion {
listener?.onDismiss()
dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL)
CallerV2XWarningListenerManager.dismiss()
}
if (ttsContent != null && !TextUtils.isEmpty(ttsContent) && playTTS) {
@@ -185,7 +133,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
if (last != null && !last.isCompleted) {
return
}
lifecycleScope.launch(Dispatchers.Default) {
ProcessLifecycleOwner.get().lifecycleScope.launch(Dispatchers.Main) {
speak(it, ttsContent)
}.also { itx ->
lastSpeakJob.set(itx)
@@ -217,38 +165,35 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
}
}
override fun showWarning(direction: WarningDirectionEnum) {
CallerLogger.d(TAG, "showWarning====")
flV2XWarningView?.showWarning(direction)
}
override fun showWarning(direction: WarningDirectionEnum, closeTime: Long) {
flV2XWarningView?.showWarning(direction, closeTime)
override fun showWarning(v2xType: String, direction: WarningDirectionEnum, expireTime: Long) {
CallerV2XWarningListenerManager.show(v2xType, direction, expireTime)
}
override fun dismissWarning(direction: WarningDirectionEnum) {
flV2XWarningView?.dismissWarning(direction)
CallerV2XWarningListenerManager.dismiss(direction)
}
/** todo----------------------------------------------- **/
override fun showDispatchDialog(msgData: DispatchAdasAutoPilotLocReceiverBean) {
context?.let {
DispatchDialogManager.getInstance(it).showDialog(msgData)
ThreadUtils.runOnUiThread {
context?.let {
DispatchDialogManager.getInstance(it).showDialog(msgData)
}
}
}
override fun dismissDispatchDialog() {
context?.let {
DispatchDialogManager.getInstance(it).releaseDialog()
ThreadUtils.runOnUiThread {
context?.let {
DispatchDialogManager.getInstance(it).releaseDialog()
}
}
}
override fun showNoticeForTrafficWithData(trafficStylePushData: NoticeTrafficStylePushData?) {
trafficStylePushData?.let {
override fun showNoticeForTrafficWithData(pushData: NoticeTrafficStylePushData?) {
pushData?.let {
ThreadUtils.runOnUiThread {
context?.let { it ->
NoticeTrafficDialog.show(it, trafficStylePushData)
NoticeTrafficDialog.show(it, pushData)
}
}
}
@@ -289,18 +234,32 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
}
}
override fun showToBindingcarDialog() {
override fun showToBindingCarDialog() {
if (ContextHolderUtil.getContext() != null) {
ToBindingCarDialog.show(ContextHolderUtil.getContext())
}
}
override fun showModifyBindingcarDialog() {
override fun showModifyBindingCarDialog() {
if (ContextHolderUtil.getContext() != null) {
ModifyBindingCarDialog.show(ContextHolderUtil.getContext())
}
}
override fun showIPCReportWindow(
errorReportList: ArrayList<ReportEntity>,
warningReportList: ArrayList<ReportEntity>,
reportLevel: Int
) {
ThreadUtils.runOnUiThread {
context?.let {
if (reportLevel == 1) {
IPCReportWindow.show(it, errorReportList, warningReportList, reportLevel)
}
}
}
}
override fun showUpgradeDialog(
name: String,
url: String,
@@ -310,8 +269,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
) {
if (ContextHolderUtil.getContext() != null) {
UpgradeAppDialog.show(
ContextHolderUtil.getContext(),
name, url, title, content, installType
ContextHolderUtil.getContext(), name, url, title, content, installType
)
}
}
@@ -330,47 +288,4 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
}
}
override fun setSnBinding(isOpen: Boolean) {
HmiBuildConfig.isShowSnBindingView = isOpen
}
override fun setObuWeaknessTraffic(isOpen: Boolean) {
HmiBuildConfig.isShowObuWeaknessTrafficView = isOpen
}
override fun setCloudWeaknessTraffic(isOpen: Boolean) {
HmiBuildConfig.isShowCloudWeaknessTrafficView = isOpen
}
override fun showSmallFragment() {
// // 加载全览模式图层
// val fragmentOverview = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_OVERVIEW)
// .navigation() as BaseFragment
// activity?.supportFragmentManager?.beginTransaction()
// ?.setCustomAnimations(R.anim.slide_in, R.anim.fade_out)?.apply {
// if (!fragmentOverview.isAdded) {
// add(
// R.id.module_main_id_smp_fragment,
// fragmentOverview,
// fragmentOverview.tagName
// )
// } else {
// show(fragmentOverview)
// }.commitAllowingStateLoss()
// }
// CallerDevaToolsManager.hideStatusBar()
}
override fun hideSmallFragment() {
// val fragmentOverview = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_OVERVIEW)
// .navigation() as BaseFragment
// activity?.supportFragmentManager?.beginTransaction()
// ?.setCustomAnimations(R.anim.slide_in, R.anim.fade_out)?.apply {
// if (fragmentOverview.isVisible) {
// hide(fragmentOverview)
// }
// }
// ?.commitAllowingStateLoss()
}
}

View File

@@ -1053,33 +1053,23 @@ internal class DebugSettingView @JvmOverloads constructor(
* sn绑定控制
*/
tbOpenSnBinding.setOnCheckedChangeListener { _, isChecked ->
if (!isChecked) {
CallerHmiManager.setSnBinding(true)
} else {
CallerHmiManager.setSnBinding(false)
}
HmiBuildConfig.isShowSnBindingView = !isChecked
}
/**
* obu弱势交通控制
*/
tbObuWeaknessTraffic.setOnCheckedChangeListener { _, isChecked ->
if (!isChecked) { //默认开启
CallerHmiManager.setObuWeaknessTraffic(true)
} else {
CallerHmiManager.setObuWeaknessTraffic(false)
}
// 默认开启
HmiBuildConfig.isShowObuWeaknessTrafficView = !isChecked
}
/**
* 云端弱势交通控制
*/
tbCloudWeaknessTraffic.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) { //默认关闭
CallerHmiManager.setCloudWeaknessTraffic(true)
} else {
CallerHmiManager.setCloudWeaknessTraffic(false)
}
// 默认关闭
HmiBuildConfig.isShowObuWeaknessTrafficView = isChecked
}
/**

View File

@@ -20,7 +20,7 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.eagle.core.function.business.routeoverlay.RouteStrategy
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import kotlinx.android.synthetic.main.view_sop_setting.view.*
@@ -81,11 +81,8 @@ internal class SOPSettingView @JvmOverloads constructor(
*/
tbObuWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowObuWeaknessTrafficView
tbObuWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
if (!isChecked) { //默认开启
CallerHmiManager.setObuWeaknessTraffic(true)
} else {
CallerHmiManager.setObuWeaknessTraffic(false)
}
// 默认开启
HmiBuildConfig.isShowObuWeaknessTrafficView = !isChecked
}
/**
@@ -93,18 +90,15 @@ internal class SOPSettingView @JvmOverloads constructor(
*/
tbCloudWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowCloudWeaknessTrafficView
tbCloudWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) { //默认关闭
CallerHmiManager.setCloudWeaknessTraffic(true)
} else {
CallerHmiManager.setCloudWeaknessTraffic(false)
}
// 默认关闭
HmiBuildConfig.isShowCloudWeaknessTrafficView = isChecked
}
/**
* 限速数据来源开关
*/
tbRoadLimitSpeedSop.setOnCheckedChangeListener { _, isChecked ->
//默认关闭
// 默认关闭
HmiBuildConfig.isShowObuLimitSpeedView = isChecked
}
@@ -112,7 +106,7 @@ internal class SOPSettingView @JvmOverloads constructor(
* obu V2V开关
*/
tbObuV2vView.setOnCheckedChangeListener { _, isChecked ->
//默认关闭
// 默认关闭
HmiBuildConfig.isShowObuV2vView = isChecked
}
@@ -120,7 +114,7 @@ internal class SOPSettingView @JvmOverloads constructor(
* obu V2i开关
*/
tbObuV2iView.setOnCheckedChangeListener { _, isChecked ->
//默认关闭
// 默认关闭
HmiBuildConfig.isShowObuV2iView = isChecked
}
@@ -128,7 +122,7 @@ internal class SOPSettingView @JvmOverloads constructor(
* obu 数据通过dc 传输V2i事件 开关 TODO pm确定下开关功能 HmiBuildConfig.isShowObuToDcV2iView
*/
tbObuToDcView.setOnCheckedChangeListener { _, isChecked ->
//默认开启
// 默认开启
HmiBuildConfig.isShowObuToDcV2iView = !isChecked
// Log.d("liyz", "HmiBuildConfig.isShowObuToDcV2iView = " + HmiBuildConfig.isShowObuToDcV2iView)
}

View File

@@ -15,10 +15,10 @@ import com.mogo.eagle.core.data.trafficlight.isRed
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningActionsListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener.Companion.STATUS_AUTOPILOT_RUNNING
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.zhjt.service_biz.BizConfig

View File

@@ -10,7 +10,7 @@ import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.LimitingVelocityView_TAG
import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerViewLimitingVelocityListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
import com.mogo.eagle.core.function.hmi.R
import kotlinx.android.synthetic.main.view_limiting_speed_vr.view.*
@@ -32,7 +32,7 @@ class LimitingVelocityView constructor(
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerViewLimitingVelocityListenerManager.addListener(TAG, this)
CallerLimitingVelocityListenerManager.addListener(TAG, this)
CallerHmiViewControlListenerManager.addListener(LimitingVelocityView_TAG, this)
}
@@ -54,7 +54,7 @@ class LimitingVelocityView constructor(
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerViewLimitingVelocityListenerManager.removeListener(TAG)
CallerLimitingVelocityListenerManager.removeListener(TAG)
CallerHmiViewControlListenerManager.removeListener(LimitingVelocityView_TAG)
}

View File

@@ -13,9 +13,9 @@ import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.TrafficLightEnum
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.TrafficLightView_TAG
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler

View File

@@ -0,0 +1,71 @@
package com.mogo.eagle.core.function.hmi.ui.widget
import android.animation.AnimatorSet
import android.animation.ObjectAnimator
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
import com.mogo.eagle.core.function.api.v2x.IV2XEventListener
import com.mogo.eagle.core.function.call.v2x.CallerV2XWarningListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import kotlinx.android.synthetic.main.view_v2x_warning_fog.view.*
class V2XFogEventView(context: Context, attrs: AttributeSet?, defStyleAttr: Int) :
ConstraintLayout(context, attrs, defStyleAttr), IV2XEventListener {
companion object {
private const val TAG = "V2XFogEventView"
}
private val animatorSet = AnimatorSet()
init {
LayoutInflater.from(context).inflate(R.layout.view_v2x_warning_fog, this, true)
val animator1 = ObjectAnimator.ofFloat(iv_wu1, "alpha", 0f, 1f, 0f)
val animator2 = ObjectAnimator.ofFloat(iv_wu1, "translationX", -500f, 100f, 300f)
val animator3 = ObjectAnimator.ofFloat(iv_wu1, "scaleX", 1f, 1.5f, 2f)
val animator4 = ObjectAnimator.ofFloat(iv_wu1, "scaleY", 1f, 1.5f, 2f)
val animator5 = ObjectAnimator.ofFloat(iv_wu2, "alpha", 0f, 1f, 0f)
val animator6 = ObjectAnimator.ofFloat(iv_wu2, "translationX", 500f, -100f, -300f)
val animator7 = ObjectAnimator.ofFloat(iv_wu2, "scaleX", 1f, 1.5f, 2f)
val animator8 = ObjectAnimator.ofFloat(iv_wu2, "scaleY", 1f, 1.5f, 2f)
animatorSet.playTogether(
animator1,
animator2,
animator3,
animator4,
animator5,
animator6,
animator7,
animator8
)
animatorSet.duration = 5000
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerV2XWarningListenerManager.addListener(TAG, this)
}
override fun show(v2xType: String, direction: WarningDirectionEnum, time: Long) {
ThreadUtils.runOnUiThread {
if(v2xType == EventTypeEnumNew.FOURS_FOG.poiType){
animatorSet.start()
}
}
}
override fun dismiss(direction: WarningDirectionEnum) {
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerV2XWarningListenerManager.removeListener(TAG)
}
}

View File

@@ -8,26 +8,26 @@ import android.view.animation.AlphaAnimation
import android.view.animation.Animation
import android.view.animation.LinearInterpolator
import android.widget.RelativeLayout
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
import com.mogo.eagle.core.data.enums.WarningDirectionEnum.*
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.function.api.v2x.IV2XEventListener
import com.mogo.eagle.core.function.call.v2x.CallerV2XWarningListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import kotlinx.android.synthetic.main.module_hmi_warning_v2x.view.*
import kotlinx.android.synthetic.main.view_v2x_warning.view.*
/**
*@author xiaoyuzhou
*@date 2021/9/10 7:44 下午
*/
class V2XWarningView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : RelativeLayout(context, attrs, defStyleAttr) {
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : RelativeLayout(context, attrs, defStyleAttr), IV2XEventListener {
companion object {
private const val ALL_CLOSE_TIMER = 10000L
private const val ALL_CLOSE_TIMER = 5000L
private const val TAG = "V2XWarningView"
}
@@ -36,24 +36,43 @@ class V2XWarningView @JvmOverloads constructor(
}
init {
LayoutInflater.from(context).inflate(R.layout.module_hmi_warning_v2x, this, true)
LayoutInflater.from(context).inflate(R.layout.view_v2x_warning, this, true)
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerV2XWarningListenerManager.addListener(TAG, this)
}
override fun show(v2xType: String, direction: WarningDirectionEnum, time: Long) {
ThreadUtils.runOnUiThread {
if (direction != ALERT_WARNING_NON) {
showWarning(direction)
}
}
}
override fun dismiss(direction: WarningDirectionEnum) {
ThreadUtils.runOnUiThread {
dismissWarning(direction)
}
}
/**
* 展示指定方位上的红框预警
* @param direction
* @see WarningDirectionEnum
* @param closeTime 倒计时
*/
fun showWarning(direction: WarningDirectionEnum, closeTime: Long = ALL_CLOSE_TIMER) {
private fun showWarning(direction: WarningDirectionEnum, time: Long = ALL_CLOSE_TIMER) {
UiThreadHandler.post {
// 如果传入的不是关闭显示,则设置倒计时,定时关闭红框警示
if (direction != ALERT_WARNING_NON) {
removeCallbacks(closeWarningTask)
postDelayed(closeWarningTask, closeTime)
postDelayed(closeWarningTask, time)
}
when (direction) {
ALERT_WARNING_NON ->{
ALERT_WARNING_NON -> {
// nothing
}
ALERT_WARNING_TOP -> {
@@ -156,7 +175,7 @@ class V2XWarningView @JvmOverloads constructor(
}
}
fun dismissWarning(direction: WarningDirectionEnum) {
private fun dismissWarning(direction: WarningDirectionEnum) {
if (direction == ALERT_WARNING_NON) {
return
}
@@ -202,4 +221,10 @@ class V2XWarningView @JvmOverloads constructor(
}
clearAnimation()
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerV2XWarningListenerManager.removeListener(TAG)
}
}

View File

@@ -5,8 +5,8 @@ import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.function.api.vip.IMoGoVipSetListener
import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager
import com.mogo.eagle.core.function.api.v2x.IMoGoVipSetListener
import com.mogo.eagle.core.function.call.v2x.CallVipSetListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.ThreadUtils

View File

@@ -40,6 +40,7 @@ import com.mogo.eagle.core.data.constants.MoGoFragmentPaths;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.call.startup.CallerStartUpManager;
import com.mogo.eagle.core.function.hmi.R;
@@ -119,6 +120,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
mConnectInfoRV = findViewById(R.id.rvConnectInfo);
initConnectInfoRV();
FloatingViewHandler.init(mFloatingLayout);
CallerHmiManager.INSTANCE.init(this);
//申请悬浮窗权限
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
@@ -168,8 +170,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
mPresenter.postLoadModuleMsg();
// 监听网络状态
NetworkUtils.listenNetStrength(this);
// 浓雾预警
DisplayEffectsHelper.getInstance().init(clSpecialEffect);
mPresenter.checkPermission(this);
@@ -329,9 +329,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
@Override
public void loadFunctionFragment() {
CallerLogger.INSTANCE.d(M_HMI + TAG, "loadFunctionFragment……");
// 加载 HMI 图层
BaseFragment fragmentHdMap = (BaseFragment) ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_HMI).navigation();
addFragment(fragmentHdMap, fragmentHdMap.getTagName(), R.id.module_main_id_waring_fragment);
// 加载 小地图 图层
BaseFragment fragmentSmpMap = (BaseFragment) ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_SMP).navigation();
addFragment(fragmentSmpMap, fragmentSmpMap.getTagName(), R.id.module_main_id_smp_fragment);

View File

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<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:id="@+id/clHmiContainer"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--V2X预警红色边框-->
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
android:id="@+id/flV2XWarningView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -37,12 +37,6 @@
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<!--HMI 预警视图 OBU、云端下发、自车感知、自车策略-->
<FrameLayout
android:id="@+id/module_main_id_waring_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<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="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_wu1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:alpha="0"
android:src="@drawable/wu1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/iv_wu2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:alpha="0"
android:src="@drawable/wu2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintRight_toRightOf="parent"
tools:ignore="ContentDescription" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -58,7 +58,7 @@ public class SpeedLimitDataManager implements IMoGoChassisLocationGCJ02Listener
int speedLimit = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), (float) mLocation.getHeading());
UiThreadHandler.post(() -> {
if (speedLimit > 0) {
CallerLimitingVelocityListenerManager.INSTANCE.invokeOnLimitingVelocityChange(speedLimit, DataSourceType.MAP);
CallerLimitingVelocityListenerManager.INSTANCE.invokeUnion(speedLimit, DataSourceType.MAP);
}
});
}

View File

@@ -156,7 +156,6 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback,
val v2XMessageEntity = V2XMessageEntity<V2XRoadEventEntity>()
v2XMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING
v2XMessageEntity.content = v2XRoadEventEntity
v2XMessageEntity.isShowState = true
V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity)
}
}

View File

@@ -1,7 +1,6 @@
package com.mogo.eagle.core.function.v2x.events.scenario.scene.road;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.context.ContextHolderUtil;
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
import com.mogo.eagle.core.data.enums.WarningDirectionEnum;
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay;
@@ -46,18 +45,15 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
Logger.d(TAG, "v2XMessageEntity:" + GsonUtil.jsonFromObject(v2XMessageEntity));
V2XRoadEventEntity v2XRoadEventEntity = v2XMessageEntity.getContent();
if (v2XRoadEventEntity != null) {
if (v2XMessageEntity.isShowState()) {
if (!isSameScenario(v2XMessageEntity)) {
// 更新要提醒的数据
setV2XMessageEntity(v2XMessageEntity);
show();
} else {
// 更新要提醒的数据
setV2XMessageEntity(v2XMessageEntity);
}
if (!isSameScenario(v2XMessageEntity)) {
// 更新要提醒的数据
setV2XMessageEntity(v2XMessageEntity);
show();
} else {
close();
// 更新要提醒的数据
setV2XMessageEntity(v2XMessageEntity);
}
}
} catch (Exception e) {
e.printStackTrace();
@@ -70,16 +66,12 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
if (getV2XMessageEntity() != null && getV2XMessageEntity().getContent() != null) {
//只展示不播报 不广播
V2XMessageEntity<V2XRoadEventEntity> entity = getV2XMessageEntity();
boolean onlyShow = entity.isOnlyShow();
if (!onlyShow) {
// 设置TTS
V2XRoadEventEntity content = entity.getContent();
if (content != null && !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType())
&& !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_JINGZHI.getPoiType())
&& !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU.getPoiType())
&& !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION.getPoiType())) {
content.getTts(false);
}
V2XRoadEventEntity content = entity.getContent();
if (content != null && !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType())
&& !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_JINGZHI.getPoiType())
&& !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU.getPoiType())
&& !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION.getPoiType())) {
content.getTts(false);
}
showWindow();
}
@@ -101,7 +93,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
}
String poiType = content.getPoiType();
if (EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType().equals(poiType) ||
EventTypeEnumNew. TYPE_SOCKET_ROAD_JINGZHI.getPoiType().equals(poiType) ||
EventTypeEnumNew.TYPE_SOCKET_ROAD_JINGZHI.getPoiType().equals(poiType) ||
EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION.getPoiType().equals(poiType) ||
EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU.getPoiType().equals(poiType)) {
MarkerExploreWay noveltyInfo = content.getNoveltyInfo();
@@ -134,7 +126,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
)
);
CallerHmiManager.INSTANCE.warningV2X(poiType, alarmText,
ttsText, this, !entity.isOnlyShow(),
ttsText, this,WarningDirectionEnum.ALERT_WARNING_TOP,
TimeUnit.SECONDS.toMillis(5));
}
}
@@ -161,19 +153,13 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
if (isNeedChangeAngle()) {
CallerVisualAngleManager.INSTANCE.changeVisualAngle(CallerVisualAngleManager.Scene.RoadEvent.INSTANCE);
}
CallerHmiManager.INSTANCE.showWarning(WarningDirectionEnum.ALERT_WARNING_TOP, TimeUnit.HOURS.toMillis(1));
V2XMessageEntity<V2XRoadEventEntity> entity = getV2XMessageEntity();
if (entity != null) {
V2XRoadEventEntity content = entity.getContent();
if (content != null) {
if (entity.isNeedAddLine() && !EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION.getPoiType().equals(content.getPoiType()) ) {
if (entity.isNeedAddLine() && !EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION.getPoiType().equals(content.getPoiType())) {
drawPOI();
}
MarkerExploreWay noveltyInfo = content.getNoveltyInfo();
if (noveltyInfo != null && EventTypeEnumNew.FOURS_FOG.getPoiType().equals(content.getNoveltyInfo().getPoiType())) {
CallerHmiManager.INSTANCE.displayEffects();
}
}
}
}

View File

@@ -65,7 +65,6 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoChas
if (mMarkerEntity != null) {
CallerLogger.INSTANCE.d(M_V2X + TAG, "----- show --- 2 --:\n" + mMarkerEntity);
int v2xType = getV2XTypeForFrontWarning(mMarkerEntity);
V2XMessageEntity entity = getV2XMessageEntity();
if (v2xType != 0) {
if (getAlertContentForFrontWarning(mMarkerEntity).toString() == null
|| getAlertContentForFrontWarning(mMarkerEntity).toString().isEmpty()
@@ -82,8 +81,8 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoChas
);
CallerHmiManager.INSTANCE.warningV2X(v2xType + "",
getAlertContentForFrontWarning(mMarkerEntity), mMarkerEntity.getTts(),
this, !entity.isOnlyShow(),
TimeUnit.SECONDS.toMillis(3));
this,getDirection(),
TimeUnit.SECONDS.toMillis(5));
}
}
}
@@ -134,9 +133,7 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoChas
sV2XWarningMarker.onCarLocationChanged2(gnssInfo);
}
@Override
public void onShow() {
//预警蒙层
private WarningDirectionEnum getDirection(){
WarningDirectionEnum warningDirectionEnum = WarningDirectionEnum.ALERT_WARNING_ALL;
switch (mMarkerEntity.getDirection()) {
case 0:
@@ -155,8 +152,13 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoChas
warningDirectionEnum = WarningDirectionEnum.ALERT_WARNING_RIGHT;
break;
}
CallerHmiManager.INSTANCE.showWarning(warningDirectionEnum, TimeUnit.HOURS.toMillis(1));
mDirection = warningDirectionEnum;
return warningDirectionEnum;
}
@Override
public void onShow() {
//预警蒙层
drawPOI();
}

View File

@@ -35,8 +35,6 @@ public class TestOnLineCarUtils {
entity.setPoiType("100061");
entity.setExpireTime(20000);
V2XMessageEntity<V2XRoadEventEntity> body = new V2XMessageEntity<>();
body.setOnlyShow(false);
body.setShowState(true);
body.setContent(entity);
body.setType(ALERT_ROAD_WARNING);
return body;
@@ -66,8 +64,6 @@ public class TestOnLineCarUtils {
v2xMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_EVENT_UGC_WARNING);
// 设置数据
v2xMessageEntity.setContent(v2xRoadEventEntity);
// 控制展示状态
v2xMessageEntity.setShowState(true);
return v2xMessageEntity;
} catch (Exception e) {
e.printStackTrace();
@@ -138,8 +134,6 @@ public class TestOnLineCarUtils {
v2xMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_VR_SHOW);
// 设置数据
v2xMessageEntity.setContent(v2xRoadEventEntity);
// 控制展示状态
v2xMessageEntity.setShowState(true);
return v2xMessageEntity;
} catch (Exception e) {
e.printStackTrace();
@@ -158,8 +152,6 @@ public class TestOnLineCarUtils {
v2xMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_CAR_FOR_HELP);
// 设置数据
v2xMessageEntity.setContent(true);
// 控制展示状态
v2xMessageEntity.setShowState(true);
return v2xMessageEntity;
} catch (Exception e) {
e.printStackTrace();

View File

@@ -15,13 +15,6 @@ public class MoGoFragmentPaths {
@Deprecated
public static final String PATH_FRAGMENT_MAP = "/hd_map_ui/";
/**
* HMI Fragment
*/
@Keep
@Deprecated
public static final String PATH_FRAGMENT_HMI = "/hmi_ui/";
/**
* 小地图 Fragment
*/

View File

@@ -60,6 +60,12 @@ public class MogoServicePaths {
@Keep
public static final String PATH_DEVA_TOOLS = "/deva/tools";
/**
* HMI Fragment
*/
@Keep
public static final String PATH_FRAGMENT_HMI = "/hmi_ui/";
/**
* 地图数据更新输助类
*/

View File

@@ -27,12 +27,6 @@ public class V2XMessageEntity<T> implements Serializable {
@MessageType
int type;
/**
* 是否展示对话框
* true-展示false-不展示
*/
boolean showState;
/**
* 是否需要判断重复事件
* true-判断false-不判断
@@ -40,9 +34,6 @@ public class V2XMessageEntity<T> implements Serializable {
*/
boolean isNeedCompareSameScenario = true;
//是否播报tts
private boolean onlyShow = false;
//本机与事件是否连线
private boolean needAddLine = true;
@@ -59,14 +50,6 @@ public class V2XMessageEntity<T> implements Serializable {
this.type = type;
}
public boolean isShowState() {
return showState;
}
public void setShowState(boolean showState) {
this.showState = showState;
}
public boolean isNeedCompareSameScenario() {
return isNeedCompareSameScenario;
}
@@ -97,14 +80,6 @@ public class V2XMessageEntity<T> implements Serializable {
return Objects.hash(type, content);
}
public boolean isOnlyShow() {
return onlyShow;
}
public void setOnlyShow(boolean onlyShow) {
this.onlyShow = onlyShow;
}
public boolean isNeedAddLine() {
return needAddLine;
}
@@ -202,9 +177,7 @@ public class V2XMessageEntity<T> implements Serializable {
public String toString() {
return "V2XMessageEntity{" +
"type=" + type +
", showState=" + showState +
", isNeedCompareSameScenario=" + isNeedCompareSameScenario +
", onlyShow=" + onlyShow +
", needAddLine=" + needAddLine +
", content=" + content +
'}';

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.core.function.api.hmi.warning
import android.view.ViewGroup
import com.alibaba.android.arouter.facade.template.IProvider
import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
@@ -13,47 +14,19 @@ import com.mogo.eagle.core.data.report.ReportEntity
* @author xiaoyuzhou
* @date 2021/8/2 7:36 下午
*/
interface IMoGoHmiProvider {
/**
* 浓雾预警
*/
fun displayEffects()
/**
* 控制sn绑定功能
*/
fun setSnBinding(isOpen: Boolean)
/**
* 控制展示obu的弱势交通
*/
fun setObuWeaknessTraffic(isOpen: Boolean)
/**
* 控制展示云端的弱势交通
*/
fun setCloudWeaknessTraffic(isOpen: Boolean)
interface IMoGoHmiProvider :IProvider{
/**
* 不展示顶部弹窗,其它保留
*/
fun warningV2X(v2xType: String, alertContent: CharSequence?, ttsContent: String?, listener: IMoGoWarningStatusListener?, playTts: Boolean, expireTime: Long)
fun warningV2X(v2xType: String, alertContent: CharSequence?, ttsContent: String?, listener: IMoGoWarningStatusListener?, direction: WarningDirectionEnum, expireTime: Long)
/**
* 展示指定方位上的红框预警
* @param direction
* @see WarningDirectionEnum
*/
fun showWarning(direction: WarningDirectionEnum)
/**
* 展示指定方位上的红框预警
* @param direction
* @see WarningDirectionEnum
* @param closeTime 倒计时
*/
fun showWarning(direction: WarningDirectionEnum, closeTime: Long)
fun showWarning(v2xType: String ,direction: WarningDirectionEnum, expireTime: Long)
/**
* 主动消失边框预警
@@ -74,30 +47,35 @@ interface IMoGoHmiProvider {
*/
fun showNoticeNormalData(normalData: NoticeNormalData?)
/**
* 路侧直播,超视距感知
*/
fun startRoadCameraLive(flvUrl: String)
/**
* 超视距感知关闭
*/
fun showNoSignView()
/**
* 展示工具栏
*/
fun showToolsView()
fun hideToolsView()
/**
* 加载全览模式图层
* 关闭工具栏
*/
fun showSmallFragment()
fun hideSmallFragment()
fun hideToolsView()
/**
* 展示绑定车辆弹框
*/
fun showToBindingcarDialog()
fun showToBindingCarDialog()
/**
* 展示修改绑定车辆弹框
*/
fun showModifyBindingcarDialog()
fun showModifyBindingCarDialog()
/**
* 展示升级app弹框
@@ -122,8 +100,21 @@ interface IMoGoHmiProvider {
*/
fun showIPCReportWindow(errorReportList: ArrayList<ReportEntity>,warningReportList: ArrayList<ReportEntity>,reportLevel: Int)
/**
* 道路视频 放入指定url
*/
fun showVideoDialog(infList: List<Infrastructure>)
/**
* 调度弹窗展示
*/
fun showDispatchDialog(msgData: DispatchAdasAutoPilotLocReceiverBean)
/**
* 隐藏调度弹窗
*/
fun dismissDispatchDialog()
/**
* 设置状态栏暗夜或明亮模式
* 默认 light
@@ -150,14 +141,4 @@ interface IMoGoHmiProvider {
*/
fun updateMfStatus(tag: String, status: Boolean)
/**
* 调度弹窗展示
*/
fun showDispatchDialog(msgData: DispatchAdasAutoPilotLocReceiverBean)
/**
* 隐藏调度弹窗
*/
fun dismissDispatchDialog()
}

View File

@@ -6,5 +6,8 @@ import com.mogo.eagle.core.data.enums.DataSourceType
* 限速信息回掉
*/
interface ILimitingVelocityListener {
fun onLimitingVelocityChange(limitingVelocity: Int,sourceType: DataSourceType)
fun onUnion(limitingVelocity: Int,sourceType: DataSourceType){}
fun onLimitingVelocityChange(limitingVelocity: Int,sourceType: DataSourceType){}
}

View File

@@ -1,4 +1,4 @@
package com.mogo.eagle.core.function.api.trafficlight
package com.mogo.eagle.core.function.api.v2x
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.TrafficLightEnum
@@ -28,7 +28,7 @@ interface IMoGoTrafficLightListener {
/**
* obu红绿灯状态
*/
fun onObuTrafficLightStatus(light: TrafficLightEnum){}
fun onTrafficLightPlusSource(light: TrafficLightEnum, remain:Int = -1, lightSource: DataSourceType){}
/**
* 展示红绿灯预警

View File

@@ -1,4 +1,4 @@
package com.mogo.eagle.core.function.api.vip
package com.mogo.eagle.core.function.api.v2x
interface IMoGoVipSetListener {

View File

@@ -0,0 +1,10 @@
package com.mogo.eagle.core.function.api.v2x
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
interface IV2XEventListener {
fun show(v2xType: String, direction: WarningDirectionEnum, time: Long)
fun dismiss(direction: WarningDirectionEnum)
}

View File

@@ -1,9 +1,10 @@
package com.mogo.eagle.core.function.call.hmi
import android.content.Context
import android.view.ViewGroup
import com.alibaba.android.arouter.launcher.ARouter
import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
import com.mogo.eagle.core.data.map.Infrastructure
@@ -18,38 +19,15 @@ import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
* @date 2021/9/17 3:59 下午
*
* HMI 调用者管理这里对外及其他模块提供功能的调用用啥写啥不要过度设计不允许直接将Provider暴露出去
*
*/
object CallerHmiManager {
private val waringProviderApi
get() = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_HMI)
private val hmiProviderApi
get() = ARouter.getInstance().build(MogoServicePaths.PATH_FRAGMENT_HMI)
.navigation() as? IMoGoHmiProvider
/**
* 浓雾预警
*/
fun displayEffects() {
waringProviderApi?.displayEffects()
}
/**
* 控制显示sn绑定弹框
*/
fun setSnBinding(isOpen: Boolean) {
waringProviderApi?.setSnBinding(isOpen)
}
/**
* 是否展示obu的弱势交通
*/
fun setObuWeaknessTraffic(isOpen: Boolean) {
waringProviderApi?.setObuWeaknessTraffic(isOpen)
}
/**
* 是否展示云端的弱势交通
*/
fun setCloudWeaknessTraffic(isOpen: Boolean) {
waringProviderApi?.setCloudWeaknessTraffic(isOpen)
fun init(context:Context){
hmiProviderApi?.init(context)
}
/**
@@ -60,15 +38,15 @@ object CallerHmiManager {
alertContent: CharSequence?,
ttsContent: String?,
listenerIMoGo: IMoGoWarningStatusListener? = null,
playTts: Boolean = true,
direction: WarningDirectionEnum = WarningDirectionEnum.ALERT_WARNING_NON,
expireTime: Long = 5000L,
) {
waringProviderApi?.warningV2X(
hmiProviderApi?.warningV2X(
v2xType,
alertContent,
ttsContent,
listenerIMoGo,
playTts,
direction,
expireTime
)
}
@@ -78,25 +56,15 @@ object CallerHmiManager {
* @param direction
* @see WarningDirectionEnum
*/
fun showWarning(direction: WarningDirectionEnum) {
waringProviderApi?.showWarning(direction)
}
/**
* 展示指定方位上的红框预警
* @param direction
* @see WarningDirectionEnum
* @param closeTime 倒计时
*/
fun showWarning(direction: WarningDirectionEnum, closeTime: Long) {
waringProviderApi?.showWarning(direction, closeTime)
fun showWarning(v2xType: String, direction: WarningDirectionEnum, expireTime: Long) {
hmiProviderApi?.showWarning(v2xType, direction, expireTime)
}
/**
* 主动消失边框预警
*/
fun dismissWarning(direction: WarningDirectionEnum) {
waringProviderApi?.dismissWarning(direction)
hmiProviderApi?.dismissWarning(direction)
}
/**
@@ -104,31 +72,61 @@ object CallerHmiManager {
* @param trafficStylePushData
*/
fun showTrafficBanner(trafficStylePushData: NoticeTrafficStylePushData?) {
waringProviderApi?.showNoticeForTrafficWithData(trafficStylePushData)
hmiProviderApi?.showNoticeForTrafficWithData(trafficStylePushData)
}
/**
* 普通公告弹窗
*/
fun showNoticeNormalData(noticeNormal: NoticeNormalData) {
waringProviderApi?.showNoticeNormalData(noticeNormal)
hmiProviderApi?.showNoticeNormalData(noticeNormal)
}
/**
* 开启道路视频直播
*/
fun startRoadCameraLive(flvUrl: String) {
waringProviderApi?.startRoadCameraLive(flvUrl)
hmiProviderApi?.startRoadCameraLive(flvUrl)
}
/**
* 超视距感知关闭
*/
fun showNoSignalView() {
hmiProviderApi?.showNoSignView()
}
/**
* 展示工具栏
*/
fun showToolsView() {
hmiProviderApi?.showToolsView()
}
/**
* 关闭工具栏
*/
fun hideToolsView() {
hmiProviderApi?.hideToolsView()
}
/**
* 展示绑定车辆弹框
*/
fun showBindingCarDialog() {
waringProviderApi?.showToBindingcarDialog()
hmiProviderApi?.showToBindingCarDialog()
}
/**
* 展示修改绑定车辆弹框
*/
fun showModifyBindingCarDialog() {
waringProviderApi?.showModifyBindingcarDialog()
hmiProviderApi?.showModifyBindingCarDialog()
}
/**
* 展示升级app弹框
*/
fun showUpgradeDialog(
name: String,
url: String,
@@ -136,41 +134,35 @@ object CallerHmiManager {
content: String,
installType: String
) {
waringProviderApi?.showUpgradeDialog(name, url, title, content, installType)
hmiProviderApi?.showUpgradeDialog(name, url, title, content, installType)
}
/**
* 呈现工控机升级确认框
*/
fun showAdUpgradeDialog(images: List<String>, padSn: String, releaseId: String) {
waringProviderApi?.showAdUpgradeDialog(images, padSn, releaseId)
hmiProviderApi?.showAdUpgradeDialog(images, padSn, releaseId)
}
/**
* 更新工控机下载、升级状态
*/
fun showAdUpgradeStatus(ipcUpgradeStateInfo: IPCUpgradeStateInfo) {
waringProviderApi?.showAdUpgradeStatus(ipcUpgradeStateInfo)
hmiProviderApi?.showAdUpgradeStatus(ipcUpgradeStateInfo)
}
fun showNoSignalView() {
waringProviderApi?.showNoSignView()
/**
* 调度弹窗展示
*/
fun showDispatchDialog(msgData: DispatchAdasAutoPilotLocReceiverBean) {
hmiProviderApi?.showDispatchDialog(msgData)
}
fun showToolsView() {
waringProviderApi?.showToolsView()
}
fun hideToolsView() {
waringProviderApi?.hideToolsView()
}
fun showSmallFragment() {
waringProviderApi?.showSmallFragment()
}
fun hideSmallFragment() {
waringProviderApi?.hideSmallFragment()
/**
* 隐藏调度弹窗
*/
fun dismissDispatchDialog() {
hmiProviderApi?.dismissDispatchDialog()
}
/**
@@ -184,11 +176,11 @@ object CallerHmiManager {
warningReportList: ArrayList<ReportEntity>,
reportLevel: Int
) {
waringProviderApi?.showIPCReportWindow(errorReportList, warningReportList, reportLevel)
hmiProviderApi?.showIPCReportWindow(errorReportList, warningReportList, reportLevel)
}
fun showVideoDialog(infList: List<Infrastructure>) {
waringProviderApi?.showVideoDialog(infList)
hmiProviderApi?.showVideoDialog(infList)
}
/**
@@ -196,49 +188,35 @@ object CallerHmiManager {
* 默认 light
*/
fun setStatusBarDarkOrLight(light: Boolean = true) {
waringProviderApi?.setStatusBarDarkOrLight(light)
hmiProviderApi?.setStatusBarDarkOrLight(light)
}
/**
* 更新(添加/删除)状态栏右侧元素
*/
fun updateStatusBarRightView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
waringProviderApi?.updateStatusBarRightView(insert, tag, viewGroup)
hmiProviderApi?.updateStatusBarRightView(insert, tag, viewGroup)
}
/**
* 更新(添加/删除)状态栏左侧元素
*/
fun updateStatusBarLeftView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
waringProviderApi?.updateStatusBarLeftView(insert, tag, viewGroup)
hmiProviderApi?.updateStatusBarLeftView(insert, tag, viewGroup)
}
/**
* 更新(添加/删除)状态栏右侧元素
*/
fun updateStatusBarDownloadView(insert: Boolean, tag: String, progress: Int) {
waringProviderApi?.updateStatusBarDownloadView(insert, tag, progress)
hmiProviderApi?.updateStatusBarDownloadView(insert, tag, progress)
}
/**
* 更新魔方的链接状态
*/
fun updateMfStatusView(tag: String, status: Boolean) {
waringProviderApi?.updateMfStatus(tag, status)
}
/**
* 调度弹窗展示
*/
fun showDispatchDialog(msgData: DispatchAdasAutoPilotLocReceiverBean) {
waringProviderApi?.showDispatchDialog(msgData)
}
/**
* 隐藏调度弹窗
*/
fun dismissDispatchDialog(){
waringProviderApi?.dismissDispatchDialog()
hmiProviderApi?.updateMfStatus(tag, status)
}
}

View File

@@ -1,6 +1,6 @@
package com.mogo.eagle.core.function.call.vip
package com.mogo.eagle.core.function.call.v2x
import com.mogo.eagle.core.function.api.vip.IMoGoVipSetListener
import com.mogo.eagle.core.function.api.v2x.IMoGoVipSetListener
import com.mogo.eagle.core.function.call.base.CallerBase
object CallVipSetListenerManager : CallerBase<IMoGoVipSetListener>() {
@@ -12,7 +12,7 @@ object CallVipSetListenerManager : CallerBase<IMoGoVipSetListener>() {
}
fun invokeVipSetStatus(vipStatus: Boolean) {
this.vipSet = vipStatus
vipSet = vipStatus
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value

View File

@@ -16,9 +16,16 @@ object CallerLimitingVelocityListenerManager : CallerBase<ILimitingVelocityListe
listener.onLimitingVelocityChange(mCurrentLimitingVelocity, sourceType)
}
fun invokeOnLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
fun invokeUnion(limitingVelocity: Int, sourceType: DataSourceType){
this.mCurrentLimitingVelocity = limitingVelocity
this.sourceType = sourceType
M_LISTENERS.forEach {
val listener = it.value
listener.onUnion(limitingVelocity, sourceType)
}
}
fun invokeOnLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
M_LISTENERS.forEach {
val listener = it.value
listener.onLimitingVelocityChange(limitingVelocity, sourceType)

View File

@@ -1,9 +1,9 @@
package com.mogo.eagle.core.function.call.trafficlight
package com.mogo.eagle.core.function.call.v2x
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.TrafficLightEnum
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.call.base.CallerBase
object CallerTrafficLightListenerManager : CallerBase<IMoGoTrafficLightListener>() {
@@ -17,7 +17,7 @@ object CallerTrafficLightListenerManager : CallerBase<IMoGoTrafficLightListener>
}
fun invokeTrafficLightStatus(trafficLightResult: TrafficLightResult) {
this.trafficLightResult = trafficLightResult
CallerTrafficLightListenerManager.trafficLightResult = trafficLightResult
M_LISTENERS.forEach {
val listener = it.value
listener.onTrafficLightStatus(trafficLightResult)
@@ -38,10 +38,10 @@ object CallerTrafficLightListenerManager : CallerBase<IMoGoTrafficLightListener>
}
}
fun invokeObuTrafficLightStatus(light: TrafficLightEnum) {
fun invokeTrafficLightPlusSource(light: TrafficLightEnum, remain:Int = -1, lightSource: DataSourceType) {
M_LISTENERS.forEach {
val listener = it.value
listener.onObuTrafficLightStatus(light)
listener.onTrafficLightPlusSource(light ,remain, lightSource)
}
}

View File

@@ -0,0 +1,22 @@
package com.mogo.eagle.core.function.call.v2x
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
import com.mogo.eagle.core.function.api.v2x.IV2XEventListener
import com.mogo.eagle.core.function.call.base.CallerBase
object CallerV2XWarningListenerManager : CallerBase<IV2XEventListener>() {
fun show(v2xType: String, direction: WarningDirectionEnum, time: Long) {
M_LISTENERS.forEach {
val listener = it.value
listener.show(v2xType, direction, time)
}
}
fun dismiss(direction: WarningDirectionEnum = WarningDirectionEnum.ALERT_WARNING_ALL) {
M_LISTENERS.forEach {
val listener = it.value
listener.dismiss(direction)
}
}
}

View File

@@ -1,28 +0,0 @@
package com.mogo.eagle.core.function.call.v2x
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
import com.mogo.eagle.core.function.call.base.CallerBase
/**
* 限速信息监听
*/
object CallerViewLimitingVelocityListenerManager : CallerBase<ILimitingVelocityListener>() {
private var mCurrentLimitingVelocity = 0
private var sourceType = DataSourceType.DEFAULT
override fun doSomeAfterAddListener(tag: String, listener: ILimitingVelocityListener) {
listener.onLimitingVelocityChange(mCurrentLimitingVelocity, sourceType)
}
fun invokeOnLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
this.mCurrentLimitingVelocity = limitingVelocity
this.sourceType = sourceType
M_LISTENERS.forEach {
val listener = it.value
listener.onLimitingVelocityChange(limitingVelocity, sourceType)
}
}
}