Merge remote-tracking branch 'origin/dev_arch_opt_3.0' into dev_arch_opt_3.0
# Conflicts: # OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/MogoOCHBusPassenger.java # OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/BusProvider.java # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/SweeperProvider.java # OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/TaxiProvider.java
This commit is contained in:
@@ -52,6 +52,8 @@ dependencies {
|
|||||||
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||||
implementation rootProject.ext.dependencies.amapnavi3dmap
|
implementation rootProject.ext.dependencies.amapnavi3dmap
|
||||||
implementation project(":OCH:mogo-och-common-module")
|
implementation project(":OCH:mogo-och-common-module")
|
||||||
|
compileOnly project(":libraries:mogo-map")
|
||||||
|
|
||||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||||
implementation rootProject.ext.dependencies.mogo_core_function_v2x
|
implementation rootProject.ext.dependencies.mogo_core_function_v2x
|
||||||
}else {
|
}else {
|
||||||
|
|||||||
@@ -8,9 +8,6 @@ import androidx.fragment.app.Fragment;
|
|||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
|
||||||
import com.mogo.commons.module.status.MogoStatusManager;
|
|
||||||
import com.mogo.commons.module.status.StatusDescriptor;
|
|
||||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
|
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||||
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
|
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
|
||||||
@@ -25,7 +22,7 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
* Created on 2022/3/29
|
* Created on 2022/3/29
|
||||||
*/
|
*/
|
||||||
@Route(path = BusPassengerConst.PATH)
|
@Route(path = BusPassengerConst.PATH)
|
||||||
public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener {
|
public class MogoOCHBusPassenger implements IMogoOCH {
|
||||||
private static final String TAG = MogoOCHBusPassenger.class.getSimpleName();
|
private static final String TAG = MogoOCHBusPassenger.class.getSimpleName();
|
||||||
|
|
||||||
private FragmentActivity mActivity;
|
private FragmentActivity mActivity;
|
||||||
@@ -42,8 +39,7 @@ public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener
|
|||||||
public Fragment createCoverage(@Nullable FragmentActivity activity, @Nullable Integer containerId) {
|
public Fragment createCoverage(@Nullable FragmentActivity activity, @Nullable Integer containerId) {
|
||||||
this.mActivity = activity;
|
this.mActivity = activity;
|
||||||
this.mContainerId = containerId;
|
this.mContainerId = containerId;
|
||||||
|
showFragment();
|
||||||
// UiThreadHandler.post(() -> stepIntoVrMode());
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,18 +58,6 @@ public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Context context) {
|
public void init(Context context) {
|
||||||
MogoStatusManager.getInstance().registerStatusChangedListener("OchBus",StatusDescriptor.VR_MODE, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
|
||||||
if (descriptor == StatusDescriptor.VR_MODE) {
|
|
||||||
if (isTrue){
|
|
||||||
showFragment();
|
|
||||||
}else {
|
|
||||||
hideFragment();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import android.widget.FrameLayout;
|
|||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.core.widget.ContentLoadingProgressBar;
|
import androidx.core.widget.ContentLoadingProgressBar;
|
||||||
|
|
||||||
import com.mogo.commons.mvp.IView;
|
import com.mogo.commons.mvp.IView;
|
||||||
@@ -15,14 +16,13 @@ import com.mogo.commons.mvp.MvpFragment;
|
|||||||
|
|
||||||
import com.mogo.commons.mvp.Presenter;
|
import com.mogo.commons.mvp.Presenter;
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
|
||||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
||||||
|
import com.mogo.eagle.core.function.view.MapBizView;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||||
import com.mogo.och.bus.passenger.R;
|
import com.mogo.och.bus.passenger.R;
|
||||||
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
|
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
|
||||||
import com.mogo.och.common.module.utils.NumberFormatUtil;
|
import com.mogo.och.common.module.utils.NumberFormatUtil;
|
||||||
import com.mogo.och.common.module.wigets.OCHBorderShadowLayout;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created on 2022/3/31
|
* Created on 2022/3/31
|
||||||
@@ -32,6 +32,7 @@ import com.mogo.och.common.module.wigets.OCHBorderShadowLayout;
|
|||||||
public abstract class BusPassengerBaseFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> {
|
public abstract class BusPassengerBaseFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> {
|
||||||
private static final String TAG = BusPassengerBaseFragment.class.getSimpleName();
|
private static final String TAG = BusPassengerBaseFragment.class.getSimpleName();
|
||||||
|
|
||||||
|
private MapBizView mapBizView;
|
||||||
private TextView mCurrentArriveStation;
|
private TextView mCurrentArriveStation;
|
||||||
private TextView mCurrentArriveStationTitle;
|
private TextView mCurrentArriveStationTitle;
|
||||||
private TextView mCurrentArriveTip;
|
private TextView mCurrentArriveTip;
|
||||||
@@ -56,12 +57,12 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
|
|||||||
return TAG;
|
return TAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initViews() {
|
protected void initViews() {
|
||||||
//隐藏小地图
|
//隐藏小地图
|
||||||
CallerSmpManager.INSTANCE.hidePanel();
|
CallerSmpManager.INSTANCE.hidePanel();
|
||||||
|
|
||||||
|
mapBizView = findViewById(R.id.mapBizView);
|
||||||
mCurrentArriveStation = findViewById(R.id.bus_p_cur_station_name);
|
mCurrentArriveStation = findViewById(R.id.bus_p_cur_station_name);
|
||||||
mCurrentArriveStationTitle = findViewById(R.id.bus_p_cur_station_title);
|
mCurrentArriveStationTitle = findViewById(R.id.bus_p_cur_station_title);
|
||||||
mCurrentArriveTip = findViewById(R.id.bus_p_cur_station_tip);
|
mCurrentArriveTip = findViewById(R.id.bus_p_cur_station_tip);
|
||||||
@@ -83,6 +84,37 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
|
|||||||
@Override
|
@Override
|
||||||
protected void initViews(Bundle savedInstanceState) {
|
protected void initViews(Bundle savedInstanceState) {
|
||||||
super.initViews(savedInstanceState);
|
super.initViews(savedInstanceState);
|
||||||
|
mapBizView.onCreate(savedInstanceState);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
mapBizView.onResume();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||||
|
super.onSaveInstanceState(outState);
|
||||||
|
mapBizView.onSaveInstanceState(outState);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLowMemory() {
|
||||||
|
super.onLowMemory();
|
||||||
|
mapBizView.onLowMemory();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
mapBizView.onPause();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroyView() {
|
||||||
|
mapBizView.onDestroy();
|
||||||
|
super.onDestroyView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -186,11 +218,9 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void showOverviewFragment() {
|
public void showOverviewFragment() {
|
||||||
CallerHmiManager.INSTANCE.showSmallFragment();
|
|
||||||
UiThreadHandler.postDelayed(new Runnable() {
|
UiThreadHandler.postDelayed(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
CallerHmiManager.INSTANCE.hideSmallFragment();
|
|
||||||
}
|
}
|
||||||
},5000L);
|
},5000L);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import android.view.LayoutInflater
|
|||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||||
import com.mogo.eagle.core.data.enums.TrafficLightEnum
|
import com.mogo.eagle.core.data.enums.TrafficLightEnum
|
||||||
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.trafficlight.CallerTrafficLightListenerManager
|
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||||
import com.mogo.och.bus.passenger.R
|
import com.mogo.och.bus.passenger.R
|
||||||
import kotlinx.android.synthetic.main.bus_p_traffic_light_view.view.*
|
import kotlinx.android.synthetic.main.bus_p_traffic_light_view.view.*
|
||||||
|
|||||||
@@ -4,6 +4,14 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.mogo.eagle.core.function.view.MapBizView
|
||||||
|
android:id="@+id/mapBizView"
|
||||||
|
android:layout_width="@dimen/dp_1860"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||||
|
|
||||||
<com.mogo.eagle.core.function.hmi.ui.widget.SteeringWheelView
|
<com.mogo.eagle.core.function.hmi.ui.widget.SteeringWheelView
|
||||||
android:id="@+id/steering_wheel"
|
android:id="@+id/steering_wheel"
|
||||||
android:layout_width="@dimen/dp_490"
|
android:layout_width="@dimen/dp_490"
|
||||||
@@ -26,6 +34,20 @@
|
|||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"/>
|
app:layout_constraintTop_toTopOf="parent"/>
|
||||||
|
|
||||||
|
<!--浓雾预警动画-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.widget.V2XFogEventView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_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行为决策-->
|
<!--pnc行为决策-->
|
||||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@@ -51,11 +51,12 @@ dependencies {
|
|||||||
|
|
||||||
implementation rootProject.ext.dependencies.rxjava
|
implementation rootProject.ext.dependencies.rxjava
|
||||||
implementation rootProject.ext.dependencies.rxandroid
|
implementation rootProject.ext.dependencies.rxandroid
|
||||||
|
implementation rootProject.ext.dependencies.androidxrecyclerview
|
||||||
compileOnly rootProject.ext.dependencies.recyclerviewadapterhelper
|
compileOnly rootProject.ext.dependencies.recyclerviewadapterhelper
|
||||||
|
|
||||||
implementation project(":OCH:mogo-och-common-module")
|
implementation project(":OCH:mogo-och-common-module")
|
||||||
|
compileOnly project(":libraries:mogo-map")
|
||||||
|
|
||||||
implementation rootProject.ext.dependencies.androidxrecyclerview
|
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||||
@@ -10,9 +10,7 @@ import androidx.fragment.app.FragmentActivity;
|
|||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
|
|
||||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||||
import com.mogo.commons.module.status.MogoStatusManager;
|
|
||||||
import com.mogo.commons.module.status.StatusDescriptor;
|
|
||||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
|
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||||
import com.mogo.och.bus.constant.BusConst;
|
import com.mogo.och.bus.constant.BusConst;
|
||||||
@@ -45,8 +43,6 @@ public class BusProvider implements IMogoOCH {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Context context) {
|
public void init(Context context) {
|
||||||
MogoStatusManager.getInstance().registerStatusChangedListener("OchBus"
|
|
||||||
, StatusDescriptor.VR_MODE, statusChangedListener);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showFragment() {
|
private void showFragment() {
|
||||||
@@ -76,22 +72,6 @@ public class BusProvider implements IMogoOCH {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private final IMogoStatusChangedListener statusChangedListener = (descriptor, isTrue) -> {
|
|
||||||
if (descriptor == StatusDescriptor.VR_MODE) {
|
|
||||||
// 进入vr模式默认显示网约车小巴fragment
|
|
||||||
if (isTrue) {
|
|
||||||
showFragment();
|
|
||||||
} else {
|
|
||||||
hideFragment();
|
|
||||||
}
|
|
||||||
} else if (MogoStatusManager.getInstance().isVrMode()) {
|
|
||||||
// topView进行展示时推出网约车界面,但是不隐藏整个fragment
|
|
||||||
if (busFragment != null && isTrue) {
|
|
||||||
busFragment.hideOchBus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createCoverage(FragmentActivity activity, int containerId) {
|
public void createCoverage(FragmentActivity activity, int containerId) {
|
||||||
|
|
||||||
@@ -106,19 +86,15 @@ public class BusProvider implements IMogoOCH {
|
|||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public Fragment createCoverage(@Nullable FragmentActivity fragmentActivity, @Nullable Integer integer) {
|
public Fragment createCoverage(@Nullable FragmentActivity fragmentActivity, @Nullable Integer integer) {
|
||||||
|
|
||||||
this.containerId = integer;
|
this.containerId = integer;
|
||||||
this.activity = fragmentActivity;
|
this.activity = fragmentActivity;
|
||||||
|
showFragment();
|
||||||
// UiThreadHandler.postDelayed(this::stepIntoVrMode, 5_000L );
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
//若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
|
//若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
|
||||||
MogoStatusManager.getInstance().unregisterStatusChangedListener("OchBus"
|
|
||||||
, StatusDescriptor.VR_MODE, statusChangedListener);
|
|
||||||
if (activity == null) return;
|
if (activity == null) return;
|
||||||
activity.finish();
|
activity.finish();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView;
|
|||||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView;
|
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView;
|
||||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView;
|
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView;
|
||||||
import com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView;
|
import com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView;
|
||||||
|
import com.mogo.eagle.core.function.view.MapBizView;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
||||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||||
@@ -72,6 +73,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
|||||||
protected RelativeLayout mBadcaseBtn;
|
protected RelativeLayout mBadcaseBtn;
|
||||||
protected RelativeLayout mAICollectBtn;
|
protected RelativeLayout mAICollectBtn;
|
||||||
private FrameLayout flStationPanelContainer;
|
private FrameLayout flStationPanelContainer;
|
||||||
|
private MapBizView mapBizView;
|
||||||
private Group groupTestPanel;
|
private Group groupTestPanel;
|
||||||
private TrafficDataView mTrafficDataView;
|
private TrafficDataView mTrafficDataView;
|
||||||
// private BusTrafficLightView mTrafficLightView;
|
// private BusTrafficLightView mTrafficLightView;
|
||||||
@@ -106,6 +108,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initViews() {
|
protected void initViews() {
|
||||||
|
mapBizView = findViewById(R.id.mapBizView);
|
||||||
groupTestPanel = findViewById(R.id.groupTestPanel);
|
groupTestPanel = findViewById(R.id.groupTestPanel);
|
||||||
slidePanelView = findViewById(R.id.module_mogo_och_slide_panel);
|
slidePanelView = findViewById(R.id.module_mogo_och_slide_panel);
|
||||||
ctvAutopilotStatus = findViewById(R.id.module_mogo_och_autopilot_status);
|
ctvAutopilotStatus = findViewById(R.id.module_mogo_och_autopilot_status);
|
||||||
@@ -220,6 +223,18 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initViews(Bundle savedInstanceState) {
|
||||||
|
super.initViews(savedInstanceState);
|
||||||
|
mapBizView.onCreate(savedInstanceState);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
mapBizView.onResume();
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container
|
||||||
@@ -247,14 +262,32 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
|||||||
BDRouteDataTestUtils.converToRouteData();
|
BDRouteDataTestUtils.converToRouteData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||||
|
super.onSaveInstanceState(outState);
|
||||||
|
mapBizView.onSaveInstanceState(outState);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLowMemory() {
|
||||||
|
super.onLowMemory();
|
||||||
|
mapBizView.onLowMemory();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
mapBizView.onPause();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
|
mapBizView.onDestroy();
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
|
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
|
||||||
EventBus.getDefault().unregister(this);
|
EventBus.getDefault().unregister(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAutopilotRecordResult(@Nullable RecordPanelOuterClass.RecordPanel recordPanel) {
|
public void onAutopilotRecordResult(@Nullable RecordPanelOuterClass.RecordPanel recordPanel) {
|
||||||
// if (!HmiBuildConfig.isShowBadCaseView && recordPanel != null && recordPanel.getType() == 1 && recordPanel.getStat() == 100) {
|
// if (!HmiBuildConfig.isShowBadCaseView && recordPanel != null && recordPanel.getType() == 1 && recordPanel.getStat() == 100) {
|
||||||
@@ -266,7 +299,6 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
|||||||
public void onAutopilotRecordConfig(@NonNull MessagePad.RecordDataConfig config) {
|
public void onAutopilotRecordConfig(@NonNull MessagePad.RecordDataConfig config) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测试到站
|
* 测试到站
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import com.mogo.eagle.core.data.map.CenterLine;
|
|||||||
import com.mogo.eagle.core.data.temp.EventLogout;
|
import com.mogo.eagle.core.data.temp.EventLogout;
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
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.autopilot.CallerAutoPilotStatusListenerManager;
|
||||||
import com.mogo.eagle.core.function.call.map.CallerHDMapManager;
|
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||||
@@ -471,7 +470,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
|||||||
.latitude(lat)
|
.latitude(lat)
|
||||||
.longitude(longi);
|
.longitude(longi);
|
||||||
IMogoMarker marker = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerManager(AbsMogoApplication.getApp())).addMarker(uuid, options);
|
IMogoMarker marker = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerManager(AbsMogoApplication.getApp())).addMarker(uuid, options);
|
||||||
CenterLine centerLine = CallerHDMapManager.INSTANCE.getCenterLineInfo(
|
CenterLine centerLine = CallerMapUIServiceManager.INSTANCE.getMapUIController().getCenterLineInfo(
|
||||||
longi,lat,-1);
|
longi,lat,-1);
|
||||||
if (null != centerLine && marker != null) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致 地图未初始化会返回空
|
if (null != centerLine && marker != null) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致 地图未初始化会返回空
|
||||||
marker.setRotateAngle(centerLine.getAngle().floatValue());
|
marker.setRotateAngle(centerLine.getAngle().floatValue());
|
||||||
|
|||||||
@@ -5,32 +5,60 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="@dimen/dp_72">
|
android:layout_marginTop="@dimen/dp_72">
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/fl_speed"
|
<com.mogo.eagle.core.function.view.MapBizView
|
||||||
android:layout_width="@dimen/dp_616"
|
android:id="@+id/mapBizView"
|
||||||
android:layout_height="@dimen/dp_320"
|
android:layout_width="match_parent"
|
||||||
android:layout_marginLeft="@dimen/dp_13"
|
android:layout_height="match_parent"/>
|
||||||
android:layout_marginTop="@dimen/dp_40"
|
|
||||||
android:visibility="visible"
|
<FrameLayout
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
android:id="@+id/fl_speed"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
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
|
<com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView
|
||||||
android:id="@+id/bus_arc"
|
android:id="@+id/bus_arc"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"/>
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
<!--浓雾预警动画-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.widget.V2XFogEventView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
<!--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.vehicle.SteeringBrakeView
|
||||||
|
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车辆标志-->
|
<!--Vip车辆标志-->
|
||||||
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
||||||
android:layout_width="@dimen/module_vip_width"
|
android:layout_width="@dimen/module_vip_width"
|
||||||
android:layout_height="@dimen/module_vip_height"
|
android:layout_height="@dimen/module_vip_height"
|
||||||
|
android:layout_marginStart="@dimen/dp_640"
|
||||||
|
android:layout_marginTop="@dimen/dp_80"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
android:layout_marginStart="@dimen/dp_640"
|
|
||||||
android:layout_marginTop="@dimen/dp_80"/>
|
|
||||||
|
|
||||||
<!--pnc行为决策-->
|
<!--pnc行为决策-->
|
||||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
||||||
@@ -77,7 +105,7 @@
|
|||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
|
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
|
||||||
tools:visibility="visible"/>
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<!--消息盒子选择入口-->
|
<!--消息盒子选择入口-->
|
||||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
|
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
|
||||||
@@ -87,8 +115,7 @@
|
|||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
android:layout_marginEnd="25dp"
|
android:layout_marginEnd="25dp"
|
||||||
app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"
|
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
|
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView
|
||||||
android:id="@+id/viewDriverMsgBoxList"
|
android:id="@+id/viewDriverMsgBoxList"
|
||||||
@@ -143,12 +170,12 @@
|
|||||||
android:id="@+id/module_mogo_och_autopilot_status"
|
android:id="@+id/module_mogo_och_autopilot_status"
|
||||||
android:layout_width="@dimen/module_mogo_och_autopilot_status_bg_width"
|
android:layout_width="@dimen/module_mogo_och_autopilot_status_bg_width"
|
||||||
android:layout_height="@dimen/module_mogo_och_autopilot_status_bg_height"
|
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:layout_marginLeft="@dimen/dp_13"
|
||||||
|
android:background="@drawable/bus_autopilot_status_bg"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
tools:visibility="visible" >
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/fl_speed"
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/bus_autopilot_btn_iv"
|
android:id="@+id/bus_autopilot_btn_iv"
|
||||||
@@ -175,74 +202,74 @@
|
|||||||
android:id="@+id/module_mogo_och_station_panel_container"
|
android:id="@+id/module_mogo_och_station_panel_container"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
android:layout_marginLeft="@dimen/dp_13"
|
android:layout_marginLeft="@dimen/dp_13"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_autopilot_status"
|
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_autopilot_status"
|
||||||
app:layout_goneMarginTop="@dimen/module_mogo_och_station_panel_container_margin_top_no_call" />
|
app:layout_goneMarginTop="@dimen/module_mogo_och_station_panel_container_margin_top_no_call" />
|
||||||
|
|
||||||
<include
|
<include
|
||||||
android:id="@+id/module_mogo_och_bus_test_bar"
|
android:id="@+id/module_mogo_och_bus_test_bar"
|
||||||
|
layout="@layout/bus_test_bar_view"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
layout="@layout/bus_test_bar_view"
|
|
||||||
android:visibility="visible"
|
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"
|
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 -->
|
<!--切换地图远近事件 @dimen/module_switch_map -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/bus_switch_model_layout"
|
android:id="@+id/bus_switch_model_layout"
|
||||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||||
app:layout_goneMarginBottom="@dimen/module_mogo_och_margin_bottom"
|
android:background="@drawable/bus_switch_map_bg"
|
||||||
app:layout_goneMarginLeft="@dimen/module_mogo_och_margin_left"
|
android:elevation="@dimen/bus_dp_10"
|
||||||
android:background="@drawable/bus_switch_map_bg"
|
android:gravity="center"
|
||||||
android:elevation="@dimen/bus_dp_10"
|
android:orientation="horizontal"
|
||||||
android:padding="@dimen/bus_dp_20"
|
android:padding="@dimen/bus_dp_20"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/module_mogo_och_arrived_tv"
|
app:layout_constraintBottom_toBottomOf="@+id/module_mogo_och_arrived_tv"
|
||||||
app:layout_constraintLeft_toRightOf="@+id/module_mogo_och_arrived_tv"
|
app:layout_constraintLeft_toRightOf="@+id/module_mogo_och_arrived_tv"
|
||||||
android:gravity="center"
|
app:layout_goneMarginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||||
android:orientation="horizontal">
|
app:layout_goneMarginLeft="@dimen/module_mogo_och_margin_left">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/bus_switch_model_icon"
|
android:id="@+id/bus_switch_model_icon"
|
||||||
android:layout_width="@dimen/dp_60"
|
android:layout_width="@dimen/dp_60"
|
||||||
android:layout_height="60dp" />
|
android:layout_height="60dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<!-- <CheckedTextView-->
|
<!-- <CheckedTextView-->
|
||||||
<!-- android:id="@+id/module_mogo_och_operation_status"-->
|
<!-- android:id="@+id/module_mogo_och_operation_status"-->
|
||||||
<!-- android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"-->
|
<!-- android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"-->
|
||||||
<!-- android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"-->
|
<!-- android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"-->
|
||||||
<!-- android:background="@drawable/bus_operation_status_bg"-->
|
<!-- android:background="@drawable/bus_operation_status_bg"-->
|
||||||
<!-- android:elevation="@dimen/dp_10"-->
|
<!-- android:elevation="@dimen/dp_10"-->
|
||||||
<!-- android:gravity="center"-->
|
<!-- android:gravity="center"-->
|
||||||
<!-- android:text="出车"-->
|
<!-- android:text="出车"-->
|
||||||
<!-- android:textAlignment="center"-->
|
<!-- android:textAlignment="center"-->
|
||||||
<!-- android:textColor="@color/bus_autopilot_text_color_selector"-->
|
<!-- android:textColor="@color/bus_autopilot_text_color_selector"-->
|
||||||
<!-- android:textSize="@dimen/module_mogo_och_autopilot_status_text_size"-->
|
<!-- android:textSize="@dimen/module_mogo_och_autopilot_status_text_size"-->
|
||||||
<!-- android:textStyle="bold"-->
|
<!-- android:textStyle="bold"-->
|
||||||
<!-- android:layout_marginLeft="@dimen/module_mogo_och_margin_left"-->
|
<!-- android:layout_marginLeft="@dimen/module_mogo_och_margin_left"-->
|
||||||
<!-- android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"-->
|
<!-- android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"-->
|
||||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||||
<!-- app:layout_constraintLeft_toLeftOf="parent"/>-->
|
<!-- app:layout_constraintLeft_toLeftOf="parent"/>-->
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/module_mogo_och_arrived_tv"
|
android:id="@+id/module_mogo_och_arrived_tv"
|
||||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
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:background="@drawable/bus_operation_status_bg_selector"
|
||||||
android:elevation="@dimen/dp_10"
|
android:elevation="@dimen/dp_10"
|
||||||
android:text="@string/bus_arrived_str"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
android:text="@string/bus_arrived_str"
|
||||||
android:textColor="@color/bus_autopilot_text_color_selector"
|
android:textColor="@color/bus_autopilot_text_color_selector"
|
||||||
android:textSize="@dimen/module_mogo_och_arrived_text_size"
|
android:textSize="@dimen/module_mogo_och_arrived_text_size"
|
||||||
android:textStyle="bold"
|
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_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
app:layout_constraintLeft_toLeftOf="parent" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/module_mogo_och_setting_layout"
|
android:id="@+id/module_mogo_och_setting_layout"
|
||||||
@@ -254,6 +281,7 @@
|
|||||||
android:elevation="@dimen/dp_10"
|
android:elevation="@dimen/dp_10"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintLeft_toRightOf="@id/bus_switch_model_layout">
|
app:layout_constraintLeft_toRightOf="@id/bus_switch_model_layout">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="@dimen/dp_80"
|
android:layout_width="@dimen/dp_80"
|
||||||
android:layout_height="@dimen/dp_80"
|
android:layout_height="@dimen/dp_80"
|
||||||
@@ -287,8 +315,8 @@
|
|||||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||||
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||||
android:elevation="@dimen/dp_10"
|
|
||||||
android:background="@drawable/bus_operation_status_bg_selector"
|
android:background="@drawable/bus_operation_status_bg_selector"
|
||||||
|
android:elevation="@dimen/dp_10"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_badcase_rl">
|
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_badcase_rl">
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ dependencies {
|
|||||||
api project(':core:mogo-core-function-call')
|
api project(':core:mogo-core-function-call')
|
||||||
implementation project(':core:function-impl:mogo-core-function-v2x')
|
implementation project(':core:function-impl:mogo-core-function-v2x')
|
||||||
api project(':core:function-impl:mogo-core-function-hmi')
|
api project(':core:function-impl:mogo-core-function-hmi')
|
||||||
|
api project(':core:function-impl:mogo-core-function-map')
|
||||||
}
|
}
|
||||||
|
|
||||||
implementation project(':libraries:mogo-adas')
|
implementation project(':libraries:mogo-adas')
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
<!--V2X预警红色边框-->
|
<!--V2X预警红色边框-->
|
||||||
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
|
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
|
||||||
android:id="@+id/flV2XWarningView"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -39,6 +38,13 @@
|
|||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="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车辆标志-->
|
<!--Vip车辆标志-->
|
||||||
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
||||||
android:layout_width="@dimen/module_vip_width"
|
android:layout_width="@dimen/module_vip_width"
|
||||||
|
|||||||
@@ -51,10 +51,11 @@ dependencies {
|
|||||||
|
|
||||||
implementation rootProject.ext.dependencies.rxjava
|
implementation rootProject.ext.dependencies.rxjava
|
||||||
implementation rootProject.ext.dependencies.rxandroid
|
implementation rootProject.ext.dependencies.rxandroid
|
||||||
|
implementation rootProject.ext.dependencies.androidxrecyclerview
|
||||||
|
|
||||||
implementation project(":OCH:mogo-och-common-module")
|
implementation project(":OCH:mogo-och-common-module")
|
||||||
|
compileOnly project(":libraries:mogo-map")
|
||||||
|
|
||||||
implementation rootProject.ext.dependencies.androidxrecyclerview
|
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.mogo.och.sweeper;
|
package com.mogo.och.sweeper;
|
||||||
|
|
||||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
@@ -8,10 +7,6 @@ import androidx.fragment.app.Fragment;
|
|||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
|
||||||
import com.mogo.commons.module.status.MogoStatusManager;
|
|
||||||
import com.mogo.commons.module.status.StatusDescriptor;
|
|
||||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
|
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||||
import com.mogo.och.sweeper.constant.SweeperConst;
|
import com.mogo.och.sweeper.constant.SweeperConst;
|
||||||
import com.mogo.och.sweeper.fragment.SweeperFragment;
|
import com.mogo.och.sweeper.fragment.SweeperFragment;
|
||||||
@@ -33,18 +28,8 @@ public class SweeperProvider implements IMogoOCH {
|
|||||||
private int containerId;
|
private int containerId;
|
||||||
private FragmentActivity activity;
|
private FragmentActivity activity;
|
||||||
|
|
||||||
/**
|
|
||||||
* 进入鹰眼模式,设置手势缩放地图失效
|
|
||||||
*/
|
|
||||||
private void stepIntoVrMode(){
|
|
||||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "进入vr模式" );
|
|
||||||
CallerMoGoUiSettingManager.INSTANCE.stepInNightMode();//夜间模式 状态栏字体颜色变黑
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Context context) {
|
public void init(Context context) {
|
||||||
MogoStatusManager.getInstance().registerStatusChangedListener("OchSweeper"
|
|
||||||
, StatusDescriptor.VR_MODE, statusChangedListener);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showFragment() {
|
private void showFragment() {
|
||||||
@@ -66,22 +51,6 @@ public class SweeperProvider implements IMogoOCH {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private final IMogoStatusChangedListener statusChangedListener = (descriptor, isTrue) -> {
|
|
||||||
if (descriptor == StatusDescriptor.VR_MODE) {
|
|
||||||
// 进入vr模式默认显示网约车小巴fragment
|
|
||||||
if (isTrue) {
|
|
||||||
showFragment();
|
|
||||||
} else {
|
|
||||||
hideFragment();
|
|
||||||
}
|
|
||||||
} else if (MogoStatusManager.getInstance().isVrMode()) {
|
|
||||||
// topView进行展示时推出网约车界面,但是不隐藏整个fragment
|
|
||||||
if (sweeperFragment != null && isTrue) {
|
|
||||||
sweeperFragment.hideOchSweeper();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createCoverage(FragmentActivity activity, int containerId) {
|
public void createCoverage(FragmentActivity activity, int containerId) {
|
||||||
|
|
||||||
@@ -96,11 +65,9 @@ public class SweeperProvider implements IMogoOCH {
|
|||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public Fragment createCoverage(@Nullable FragmentActivity fragmentActivity, @Nullable Integer integer) {
|
public Fragment createCoverage(@Nullable FragmentActivity fragmentActivity, @Nullable Integer integer) {
|
||||||
|
|
||||||
this.containerId = integer;
|
this.containerId = integer;
|
||||||
this.activity = fragmentActivity;
|
this.activity = fragmentActivity;
|
||||||
|
showFragment();
|
||||||
// UiThreadHandler.postDelayed(this::stepIntoVrMode, 5_000L );
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import static com.mogo.och.sweeper.constant.SweeperConst.TIMER_START_AUTOPILOT_I
|
|||||||
|
|
||||||
import android.animation.ObjectAnimator;
|
import android.animation.ObjectAnimator;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.animation.LinearInterpolator;
|
import android.view.animation.LinearInterpolator;
|
||||||
@@ -31,6 +32,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListener
|
|||||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
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.hmi.CallerHmiManager;
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||||
|
import com.mogo.eagle.core.function.view.MapBizView;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
||||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||||
@@ -71,6 +73,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
|||||||
protected RelativeLayout mAICollectBtn;
|
protected RelativeLayout mAICollectBtn;
|
||||||
public boolean isOperationStatus;//false-收车,true-出车
|
public boolean isOperationStatus;//false-收车,true-出车
|
||||||
private FrameLayout flStationPanelContainer;
|
private FrameLayout flStationPanelContainer;
|
||||||
|
private MapBizView mapBizView;
|
||||||
private Group groupTestPanel;
|
private Group groupTestPanel;
|
||||||
private FrameLayout flSpeed;
|
private FrameLayout flSpeed;
|
||||||
// private BusArcView mouduleArc;
|
// private BusArcView mouduleArc;
|
||||||
@@ -105,6 +108,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initViews() {
|
protected void initViews() {
|
||||||
|
mapBizView = findViewById(R.id.mapBizView);
|
||||||
groupTestPanel = findViewById(R.id.groupTestPanel);
|
groupTestPanel = findViewById(R.id.groupTestPanel);
|
||||||
slidePanelView = findViewById(R.id.module_mogo_och_slide_panel);
|
slidePanelView = findViewById(R.id.module_mogo_och_slide_panel);
|
||||||
ctvAutopilotStatus = findViewById(R.id.module_mogo_och_autopilot_status);
|
ctvAutopilotStatus = findViewById(R.id.module_mogo_och_autopilot_status);
|
||||||
@@ -235,17 +239,41 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initViews(Bundle savedInstanceState) {
|
||||||
|
super.initViews(savedInstanceState);
|
||||||
|
mapBizView.onCreate(savedInstanceState);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
mapBizView.onResume();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||||
|
super.onSaveInstanceState(outState);
|
||||||
|
mapBizView.onSaveInstanceState(outState);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLowMemory() {
|
||||||
|
super.onLowMemory();
|
||||||
|
mapBizView.onLowMemory();
|
||||||
|
}
|
||||||
|
|
||||||
private void debugArrivedRoute() {
|
private void debugArrivedRoute() {
|
||||||
BDRouteDataTestUtils.converToRouteData();
|
BDRouteDataTestUtils.converToRouteData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
|
mapBizView.onDestroy();
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
|
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAutopilotRecordResult(@Nullable RecordPanelOuterClass.RecordPanel recordPanel) {
|
public void onAutopilotRecordResult(@Nullable RecordPanelOuterClass.RecordPanel recordPanel) {
|
||||||
// if (!HmiBuildConfig.isShowBadCaseView && recordPanel != null && recordPanel.getType() == 1 && recordPanel.getStat() == 100) {
|
// if (!HmiBuildConfig.isShowBadCaseView && recordPanel != null && recordPanel.getType() == 1 && recordPanel.getStat() == 100) {
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import com.mogo.commons.voice.AIAssist;
|
|||||||
import com.mogo.eagle.core.data.map.CenterLine;
|
import com.mogo.eagle.core.data.map.CenterLine;
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
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.autopilot.CallerAutoPilotStatusListenerManager;
|
||||||
import com.mogo.eagle.core.function.call.map.CallerHDMapManager;
|
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||||
@@ -356,7 +355,7 @@ public class SweeperFragment extends BaseSweeperTabFragment<SweeperFragment, Swe
|
|||||||
.latitude(lat)
|
.latitude(lat)
|
||||||
.longitude(longi);
|
.longitude(longi);
|
||||||
IMogoMarker marker = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerManager(AbsMogoApplication.getApp())).addMarker(uuid, options);
|
IMogoMarker marker = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerManager(AbsMogoApplication.getApp())).addMarker(uuid, options);
|
||||||
CenterLine centerLine = CallerHDMapManager.INSTANCE.getCenterLineInfo(
|
CenterLine centerLine = CallerMapUIServiceManager.INSTANCE.getMapUIController().getCenterLineInfo(
|
||||||
longi, lat, -1);
|
longi, lat, -1);
|
||||||
if (null != centerLine) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致
|
if (null != centerLine) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致
|
||||||
marker.setRotateAngle(centerLine.getAngle().floatValue());
|
marker.setRotateAngle(centerLine.getAngle().floatValue());
|
||||||
|
|||||||
@@ -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.hmi.view.IViewControlListener.Companion.LimitingVelocityView_TAG
|
||||||
import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
|
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.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 com.mogo.och.sweeper.R
|
||||||
import kotlinx.android.synthetic.main.sweeper_limiting_speed.view.*
|
import kotlinx.android.synthetic.main.sweeper_limiting_speed.view.*
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ class SweeperLimitingVelocityView(
|
|||||||
|
|
||||||
override fun onAttachedToWindow() {
|
override fun onAttachedToWindow() {
|
||||||
super.onAttachedToWindow()
|
super.onAttachedToWindow()
|
||||||
CallerViewLimitingVelocityListenerManager.addListener(TAG, this)
|
CallerLimitingVelocityListenerManager.addListener(TAG, this)
|
||||||
CallerHmiViewControlListenerManager.addListener(LimitingVelocityView_TAG, this)
|
CallerHmiViewControlListenerManager.addListener(LimitingVelocityView_TAG, this)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ class SweeperLimitingVelocityView(
|
|||||||
|
|
||||||
override fun onDetachedFromWindow() {
|
override fun onDetachedFromWindow() {
|
||||||
super.onDetachedFromWindow()
|
super.onDetachedFromWindow()
|
||||||
CallerViewLimitingVelocityListenerManager.removeListener(TAG)
|
CallerLimitingVelocityListenerManager.removeListener(TAG)
|
||||||
CallerHmiViewControlListenerManager.removeListener(LimitingVelocityView_TAG)
|
CallerHmiViewControlListenerManager.removeListener(LimitingVelocityView_TAG)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import android.view.LayoutInflater
|
|||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||||
import com.mogo.eagle.core.data.enums.TrafficLightEnum
|
import com.mogo.eagle.core.data.enums.TrafficLightEnum
|
||||||
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.trafficlight.CallerTrafficLightListenerManager
|
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||||
import com.mogo.och.sweeper.R
|
import com.mogo.och.sweeper.R
|
||||||
import kotlinx.android.synthetic.main.sweeper_traffic_light_view.view.*
|
import kotlinx.android.synthetic.main.sweeper_traffic_light_view.view.*
|
||||||
|
|||||||
@@ -5,33 +5,55 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="@dimen/dp_72">
|
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
|
<com.mogo.eagle.core.function.view.MapBizView
|
||||||
android:id="@+id/sweeper_arc"
|
android:id="@+id/mapBizView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
</FrameLayout>
|
<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>
|
||||||
|
|
||||||
|
<!--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.vehicle.SteeringBrakeView
|
||||||
|
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车辆标志-->
|
<!--Vip车辆标志-->
|
||||||
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
||||||
android:layout_width="@dimen/module_vip_width"
|
android:layout_width="@dimen/module_vip_width"
|
||||||
android:layout_height="@dimen/module_vip_height"
|
android:layout_height="@dimen/module_vip_height"
|
||||||
|
android:layout_marginStart="@dimen/dp_640"
|
||||||
|
android:layout_marginTop="@dimen/dp_80"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
android:layout_marginStart="@dimen/dp_640"
|
|
||||||
android:layout_marginTop="@dimen/dp_80"/>
|
|
||||||
|
|
||||||
<!--pnc行为决策-->
|
<!--pnc行为决策-->
|
||||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
||||||
@@ -76,12 +98,12 @@
|
|||||||
android:id="@+id/module_mogo_och_autopilot_status"
|
android:id="@+id/module_mogo_och_autopilot_status"
|
||||||
android:layout_width="@dimen/module_mogo_och_autopilot_status_bg_width"
|
android:layout_width="@dimen/module_mogo_och_autopilot_status_bg_width"
|
||||||
android:layout_height="@dimen/module_mogo_och_autopilot_status_bg_height"
|
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:layout_marginLeft="@dimen/dp_13"
|
||||||
|
android:background="@drawable/sweeper_autopilot_status_bg"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
tools:visibility="visible" >
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/fl_speed"
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/sweeper_autopilot_btn_iv"
|
android:id="@+id/sweeper_autopilot_btn_iv"
|
||||||
@@ -108,8 +130,8 @@
|
|||||||
android:id="@+id/module_mogo_och_station_panel_container"
|
android:id="@+id/module_mogo_och_station_panel_container"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
android:layout_marginLeft="@dimen/dp_13"
|
android:layout_marginLeft="@dimen/dp_13"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_autopilot_status"
|
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_autopilot_status"
|
||||||
app:layout_goneMarginTop="@dimen/module_mogo_och_station_panel_container_margin_top_no_call"
|
app:layout_goneMarginTop="@dimen/module_mogo_och_station_panel_container_margin_top_no_call"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
@@ -118,8 +140,8 @@
|
|||||||
android:id="@+id/module_mogo_och_sweeper_operate_panel"
|
android:id="@+id/module_mogo_och_sweeper_operate_panel"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_24"
|
|
||||||
android:layout_marginStart="@dimen/dp_8"
|
android:layout_marginStart="@dimen/dp_8"
|
||||||
|
android:layout_marginTop="@dimen/dp_24"
|
||||||
app:layout_constraintLeft_toRightOf="@id/fl_speed"
|
app:layout_constraintLeft_toRightOf="@id/fl_speed"
|
||||||
app:layout_constraintTop_toTopOf="@id/fl_speed"
|
app:layout_constraintTop_toTopOf="@id/fl_speed"
|
||||||
tools:background="#f00"
|
tools:background="#f00"
|
||||||
@@ -127,40 +149,43 @@
|
|||||||
|
|
||||||
<include
|
<include
|
||||||
android:id="@+id/module_mogo_och_sweeper_test_bar"
|
android:id="@+id/module_mogo_och_sweeper_test_bar"
|
||||||
|
layout="@layout/sweeper_test_bar_view"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
layout="@layout/sweeper_test_bar_view"
|
|
||||||
android:visibility="gone"
|
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"
|
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 -->
|
<!--切换地图远近事件 @dimen/module_switch_map -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/sweeper_switch_model_layout"
|
android:id="@+id/sweeper_switch_model_layout"
|
||||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||||
android:background="@drawable/sweeper_switch_map_bg"
|
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||||
android:elevation="@dimen/sweeper_dp_10"
|
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||||
android:padding="@dimen/sweeper_dp_20"
|
android:background="@drawable/sweeper_switch_map_bg"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
android:elevation="@dimen/sweeper_dp_10"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
android:gravity="center"
|
||||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
android:orientation="horizontal"
|
||||||
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
android:padding="@dimen/sweeper_dp_20"
|
||||||
android:gravity="center"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:orientation="horizontal">
|
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
|
<CheckedTextView
|
||||||
android:id="@+id/module_mogo_och_operation_status"
|
android:id="@+id/module_mogo_och_operation_status"
|
||||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
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:background="@drawable/sweeper_operation_status_bg"
|
||||||
android:elevation="@dimen/dp_10"
|
android:elevation="@dimen/dp_10"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
@@ -169,11 +194,9 @@
|
|||||||
android:textColor="@color/sweeper_autopilot_text_color_selector"
|
android:textColor="@color/sweeper_autopilot_text_color_selector"
|
||||||
android:textSize="@dimen/module_mogo_och_autopilot_status_text_size"
|
android:textSize="@dimen/module_mogo_och_autopilot_status_text_size"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
android:visibility="gone"
|
||||||
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent" />
|
||||||
android:visibility="gone"/>
|
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/module_mogo_och_setting_layout"
|
android:id="@+id/module_mogo_och_setting_layout"
|
||||||
@@ -185,6 +208,7 @@
|
|||||||
android:elevation="@dimen/dp_10"
|
android:elevation="@dimen/dp_10"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintLeft_toRightOf="@id/sweeper_switch_model_layout">
|
app:layout_constraintLeft_toRightOf="@id/sweeper_switch_model_layout">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="@dimen/dp_80"
|
android:layout_width="@dimen/dp_80"
|
||||||
android:layout_height="@dimen/dp_80"
|
android:layout_height="@dimen/dp_80"
|
||||||
@@ -203,12 +227,13 @@
|
|||||||
android:elevation="@dimen/dp_10"
|
android:elevation="@dimen/dp_10"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_setting_layout">
|
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_setting_layout">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="@dimen/dp_80"
|
android:layout_width="@dimen/dp_80"
|
||||||
android:layout_height="@dimen/dp_80"
|
android:layout_height="@dimen/dp_80"
|
||||||
android:layout_centerInParent="true"
|
android:layout_centerInParent="true"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:src="@drawable/bad_case_selector"/>
|
android:src="@drawable/bad_case_selector" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
@@ -217,8 +242,8 @@
|
|||||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||||
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||||
android:elevation="@dimen/dp_10"
|
|
||||||
android:background="@drawable/sweeper_operation_status_bg_selector"
|
android:background="@drawable/sweeper_operation_status_bg_selector"
|
||||||
|
android:elevation="@dimen/dp_10"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_badcase_rl">
|
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_badcase_rl">
|
||||||
|
|
||||||
@@ -246,8 +271,7 @@
|
|||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:textSize="@dimen/module_mogo_och_slide_panel_textSize"
|
app:textSize="@dimen/module_mogo_och_slide_panel_textSize"
|
||||||
tools:visibility="visible"
|
tools:visibility="visible" />
|
||||||
/>
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btnAutopilotDisable"
|
android:id="@+id/btnAutopilotDisable"
|
||||||
@@ -288,6 +312,7 @@
|
|||||||
android:textSize="30sp"
|
android:textSize="30sp"
|
||||||
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
|
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
|
||||||
app:layout_constraintTop_toBottomOf="@id/btnAutopilotRunning" />
|
app:layout_constraintTop_toBottomOf="@id/btnAutopilotRunning" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btnAutopilotRoute"
|
android:id="@+id/btnAutopilotRoute"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ dependencies {
|
|||||||
implementation rootProject.ext.dependencies.amapsearch
|
implementation rootProject.ext.dependencies.amapsearch
|
||||||
|
|
||||||
implementation project(":OCH:mogo-och-common-module")
|
implementation project(":OCH:mogo-och-common-module")
|
||||||
|
compileOnly project(":libraries:mogo-map")
|
||||||
|
|
||||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||||
implementation rootProject.ext.dependencies.mogo_core_function_v2x
|
implementation rootProject.ext.dependencies.mogo_core_function_v2x
|
||||||
}else {
|
}else {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public
|
|||||||
* 网约车-出租车-乘客端
|
* 网约车-出租车-乘客端
|
||||||
*/
|
*/
|
||||||
@Route(path = TaxiPassengerConst.PATH)
|
@Route(path = TaxiPassengerConst.PATH)
|
||||||
class MogoOCHTaxiPassenger implements IMogoOCH, IMogoStatusChangedListener {
|
class MogoOCHTaxiPassenger implements IMogoOCH {
|
||||||
|
|
||||||
private static final String TAG = "MogoOCHTaxiPassenger";
|
private static final String TAG = "MogoOCHTaxiPassenger";
|
||||||
private TaxiPassengerBaseFragment ochTaxiPassengerFragment;
|
private TaxiPassengerBaseFragment ochTaxiPassengerFragment;
|
||||||
@@ -37,7 +37,6 @@ class MogoOCHTaxiPassenger implements IMogoOCH, IMogoStatusChangedListener {
|
|||||||
@Override
|
@Override
|
||||||
public void init(Context context) {
|
public void init(Context context) {
|
||||||
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "init");
|
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "init");
|
||||||
MogoStatusManager.getInstance().registerStatusChangedListener("ochTaxi", StatusDescriptor.VR_MODE, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,17 +64,6 @@ class MogoOCHTaxiPassenger implements IMogoOCH, IMogoStatusChangedListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
|
||||||
if (descriptor == StatusDescriptor.VR_MODE) {
|
|
||||||
if (isTrue) {
|
|
||||||
showFragment();
|
|
||||||
} else {
|
|
||||||
hideFragment();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createCoverage(FragmentActivity activity, int containerId) {
|
public void createCoverage(FragmentActivity activity, int containerId) {
|
||||||
|
|
||||||
@@ -92,15 +80,13 @@ class MogoOCHTaxiPassenger implements IMogoOCH, IMogoStatusChangedListener {
|
|||||||
public Fragment createCoverage(@Nullable FragmentActivity fragmentActivity, @Nullable Integer integer) {
|
public Fragment createCoverage(@Nullable FragmentActivity fragmentActivity, @Nullable Integer integer) {
|
||||||
this.mActivity = fragmentActivity;
|
this.mActivity = fragmentActivity;
|
||||||
this.mContainerId = integer;
|
this.mContainerId = integer;
|
||||||
|
showFragment();
|
||||||
// UiThreadHandler.postDelayed(() -> stepIntoVrMode(), 5_000L);
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
// 若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
|
// 若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
|
||||||
MogoStatusManager.getInstance().unregisterStatusChangedListener("ochTaxi", StatusDescriptor.VR_MODE, this);
|
|
||||||
if (mActivity == null) return;
|
if (mActivity == null) return;
|
||||||
mActivity.finish();
|
mActivity.finish();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -713,6 +713,11 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
|||||||
*/
|
*/
|
||||||
private final ILimitingVelocityListener limitingVelocityListener = new ILimitingVelocityListener(){
|
private final ILimitingVelocityListener limitingVelocityListener = new ILimitingVelocityListener(){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUnion(int limitingVelocity, @NonNull DataSourceType sourceType) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLimitingVelocityChange(int limitingVelocity, DataSourceType dataSourceType) {
|
public void onLimitingVelocityChange(int limitingVelocity, DataSourceType dataSourceType) {
|
||||||
if (mVeloctityCallback != null){
|
if (mVeloctityCallback != null){
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ import android.view.LayoutInflater
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import com.mogo.commons.mvp.BaseFragment
|
import com.mogo.commons.mvp.BaseFragment
|
||||||
import com.mogo.eagle.core.function.overview.view.OverMapView
|
import com.mogo.eagle.core.function.view.OverMapView
|
||||||
|
|
||||||
class OverviewFragment : BaseFragment() {
|
class OverviewFragment : BaseFragment() {
|
||||||
|
|
||||||
private var overmapview:OverMapView?=null
|
private var overmapview: OverMapView?=null
|
||||||
|
|
||||||
override fun onCreateView(
|
override fun onCreateView(
|
||||||
inflater: LayoutInflater,
|
inflater: LayoutInflater,
|
||||||
|
|||||||
@@ -16,12 +16,12 @@ import com.mogo.commons.module.status.MogoStatusManager;
|
|||||||
import com.mogo.commons.mvp.MvpFragment;
|
import com.mogo.commons.mvp.MvpFragment;
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
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.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.CallerMapUIServiceManager;
|
||||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
||||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxBubbleView;
|
import com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxBubbleView;
|
||||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxButtonView;
|
import com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxButtonView;
|
||||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxListView;
|
import com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxListView;
|
||||||
|
import com.mogo.eagle.core.function.view.MapBizView;
|
||||||
import com.mogo.eagle.core.utilcode.util.OverlayViewUtils;
|
import com.mogo.eagle.core.utilcode.util.OverlayViewUtils;
|
||||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||||
import com.mogo.map.listener.IMogoMapListener;
|
import com.mogo.map.listener.IMogoMapListener;
|
||||||
@@ -54,6 +54,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
|||||||
|
|
||||||
static final String TAG = "TaxiPassengerBaseFragment";
|
static final String TAG = "TaxiPassengerBaseFragment";
|
||||||
|
|
||||||
|
private MapBizView mapBizView;
|
||||||
private ImageView mAutopilotImage;
|
private ImageView mAutopilotImage;
|
||||||
private ImageView mMapswitchBtn;
|
private ImageView mMapswitchBtn;
|
||||||
|
|
||||||
@@ -92,6 +93,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
|||||||
|
|
||||||
hideEagleConfig();
|
hideEagleConfig();
|
||||||
|
|
||||||
|
mapBizView = findViewById(R.id.mapBizView);
|
||||||
mAutopilotImage = findViewById(R.id.module_och_autopilot_iv);
|
mAutopilotImage = findViewById(R.id.module_och_autopilot_iv);
|
||||||
mMapswitchBtn = findViewById(R.id.module_och_taxi_swich_map_iv);
|
mMapswitchBtn = findViewById(R.id.module_och_taxi_swich_map_iv);
|
||||||
updateSwitchMapIcon();
|
updateSwitchMapIcon();
|
||||||
@@ -120,6 +122,12 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initViews(Bundle savedInstanceState) {
|
||||||
|
super.initViews(savedInstanceState);
|
||||||
|
mapBizView.onCreate(savedInstanceState);
|
||||||
|
}
|
||||||
|
|
||||||
private void updateSwitchMapIcon() {
|
private void updateSwitchMapIcon() {
|
||||||
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
@@ -180,6 +188,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
|||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
mapBizView.onResume();
|
||||||
// mPresenter.startOrStopOrderLoop();
|
// mPresenter.startOrStopOrderLoop();
|
||||||
// showOrHideServingOrderFragment(true,false);
|
// showOrHideServingOrderFragment(true,false);
|
||||||
// showOrHideStartAutopilotView(true,true);
|
// showOrHideStartAutopilotView(true,true);
|
||||||
@@ -249,8 +258,27 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
|||||||
return new BaseTaxiPassengerPresenter(this);
|
return new BaseTaxiPassengerPresenter(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLowMemory() {
|
||||||
|
super.onLowMemory();
|
||||||
|
mapBizView.onLowMemory();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||||
|
super.onSaveInstanceState(outState);
|
||||||
|
mapBizView.onSaveInstanceState(outState);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
mapBizView.onPause();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
|
mapBizView.onDestroy();
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
EventBus.getDefault().unregister(this);
|
EventBus.getDefault().unregister(this);
|
||||||
removeListener();
|
removeListener();
|
||||||
@@ -321,7 +349,6 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
|||||||
}
|
}
|
||||||
if (showOrHideLefeMenu) {
|
if (showOrHideLefeMenu) {
|
||||||
OverlayLeftViewUtils.INSTANCE.dismissOverlayView(true);
|
OverlayLeftViewUtils.INSTANCE.dismissOverlayView(true);
|
||||||
CallerHmiManager.INSTANCE.hideSmallFragment();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import android.view.LayoutInflater
|
|||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||||
import com.mogo.eagle.core.data.enums.TrafficLightEnum
|
import com.mogo.eagle.core.data.enums.TrafficLightEnum
|
||||||
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.trafficlight.CallerTrafficLightListenerManager
|
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||||
import com.mogo.och.taxi.passenger.R
|
import com.mogo.och.taxi.passenger.R
|
||||||
import kotlinx.android.synthetic.main.taxi_p_traffic_light_view.view.*
|
import kotlinx.android.synthetic.main.taxi_p_traffic_light_view.view.*
|
||||||
|
|||||||
@@ -5,6 +5,11 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.mogo.eagle.core.function.view.MapBizView
|
||||||
|
android:id="@+id/mapBizView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
<com.mogo.eagle.core.function.hmi.ui.widget.SteeringWheelView
|
<com.mogo.eagle.core.function.hmi.ui.widget.SteeringWheelView
|
||||||
android:id="@+id/steering_wheel"
|
android:id="@+id/steering_wheel"
|
||||||
android:layout_width="@dimen/dp_630"
|
android:layout_width="@dimen/dp_630"
|
||||||
@@ -27,6 +32,20 @@
|
|||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<!--浓雾预警动画-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.widget.V2XFogEventView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_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行为决策-->
|
<!--pnc行为决策-->
|
||||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ dependencies {
|
|||||||
implementation rootProject.ext.dependencies.amapnavi3dmap
|
implementation rootProject.ext.dependencies.amapnavi3dmap
|
||||||
|
|
||||||
implementation project(":OCH:mogo-och-common-module")
|
implementation project(":OCH:mogo-och-common-module")
|
||||||
|
compileOnly project(":libraries:mogo-map")
|
||||||
|
|
||||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||||
implementation rootProject.ext.dependencies.mogo_core_function_v2x
|
implementation rootProject.ext.dependencies.mogo_core_function_v2x
|
||||||
|
|||||||
@@ -8,9 +8,6 @@ import androidx.fragment.app.Fragment;
|
|||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
|
||||||
import com.mogo.commons.module.status.MogoStatusManager;
|
|
||||||
import com.mogo.commons.module.status.StatusDescriptor;
|
|
||||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
|
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||||
import com.mogo.och.taxi.constant.TaxiConst;
|
import com.mogo.och.taxi.constant.TaxiConst;
|
||||||
@@ -27,7 +24,7 @@ public
|
|||||||
* 网约车-出租车
|
* 网约车-出租车
|
||||||
*/
|
*/
|
||||||
@Route( path = TaxiConst.PATH )
|
@Route( path = TaxiConst.PATH )
|
||||||
class TaxiProvider implements IMogoOCH , IMogoStatusChangedListener {
|
class TaxiProvider implements IMogoOCH {
|
||||||
|
|
||||||
private static final String TAG = "TaxiProvider";
|
private static final String TAG = "TaxiProvider";
|
||||||
private TaxiFragment ochTaxiFragment;
|
private TaxiFragment ochTaxiFragment;
|
||||||
@@ -36,7 +33,6 @@ class TaxiProvider implements IMogoOCH , IMogoStatusChangedListener {
|
|||||||
@Override
|
@Override
|
||||||
public void init( Context context ) {
|
public void init( Context context ) {
|
||||||
CallerLogger.INSTANCE.d( M_TAXI + TAG, "init" );
|
CallerLogger.INSTANCE.d( M_TAXI + TAG, "init" );
|
||||||
MogoStatusManager.getInstance().registerStatusChangedListener("ochTaxi", StatusDescriptor.VR_MODE,this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -64,17 +60,6 @@ class TaxiProvider implements IMogoOCH , IMogoStatusChangedListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
|
||||||
if (descriptor == StatusDescriptor.VR_MODE){
|
|
||||||
if (isTrue){
|
|
||||||
showFragment();
|
|
||||||
}else {
|
|
||||||
hideFragment();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createCoverage(FragmentActivity activity, int containerId) {
|
public void createCoverage(FragmentActivity activity, int containerId) {
|
||||||
|
|
||||||
@@ -91,13 +76,13 @@ class TaxiProvider implements IMogoOCH , IMogoStatusChangedListener {
|
|||||||
public Fragment createCoverage(@Nullable FragmentActivity fragmentActivity, @Nullable Integer integer) {
|
public Fragment createCoverage(@Nullable FragmentActivity fragmentActivity, @Nullable Integer integer) {
|
||||||
this.mActivity = fragmentActivity;
|
this.mActivity = fragmentActivity;
|
||||||
this.mContainerId = integer;
|
this.mContainerId = integer;
|
||||||
|
showFragment();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
//若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
|
//若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
|
||||||
MogoStatusManager.getInstance().unregisterStatusChangedListener("ochTaxi", StatusDescriptor.VR_MODE,this);
|
|
||||||
if (mActivity == null) return;
|
if (mActivity == null) return;
|
||||||
mActivity.finish();
|
mActivity.finish();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAX
|
|||||||
import static com.mogo.och.taxi.constant.TaxiConst.TIMER_START_AUTOPILOT_INTERVAL;
|
import static com.mogo.och.taxi.constant.TaxiConst.TIMER_START_AUTOPILOT_INTERVAL;
|
||||||
|
|
||||||
import android.animation.ObjectAnimator;
|
import android.animation.ObjectAnimator;
|
||||||
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
@@ -35,6 +36,7 @@ import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
|||||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView;
|
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView;
|
||||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView;
|
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView;
|
||||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView;
|
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView;
|
||||||
|
import com.mogo.eagle.core.function.view.MapBizView;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
||||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||||
@@ -67,6 +69,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
|||||||
protected TextView mDriverRole;
|
protected TextView mDriverRole;
|
||||||
protected FrameLayout flStationPanelContainer;
|
protected FrameLayout flStationPanelContainer;
|
||||||
private FrameLayout flNaviPanelContainer;
|
private FrameLayout flNaviPanelContainer;
|
||||||
|
private MapBizView mapBizView;
|
||||||
private Group groupTestPanel;
|
private Group groupTestPanel;
|
||||||
private TextView mSpeedView;
|
private TextView mSpeedView;
|
||||||
private ImageView mAutopilotImage;
|
private ImageView mAutopilotImage;
|
||||||
@@ -153,6 +156,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initViews() {
|
protected void initViews() {
|
||||||
|
mapBizView = findViewById(R.id.mapBizView);
|
||||||
groupTestPanel = findViewById(R.id.groupTestPanel);
|
groupTestPanel = findViewById(R.id.groupTestPanel);
|
||||||
ctvAutopilotStatusRL = findViewById(R.id.module_mogo_och_autopilot_status);
|
ctvAutopilotStatusRL = findViewById(R.id.module_mogo_och_autopilot_status);
|
||||||
ctvAutopilotStatusRL.setBackground(getResources().getDrawable(R.drawable.taxi_autopilot_bg_selector));
|
ctvAutopilotStatusRL.setBackground(getResources().getDrawable(R.drawable.taxi_autopilot_bg_selector));
|
||||||
@@ -292,6 +296,24 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initViews(Bundle savedInstanceState) {
|
||||||
|
super.initViews(savedInstanceState);
|
||||||
|
mapBizView.onCreate(savedInstanceState);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
mapBizView.onResume();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
mapBizView.onPause();
|
||||||
|
}
|
||||||
|
|
||||||
protected void onChangeOperationStatus() {
|
protected void onChangeOperationStatus() {
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -309,8 +331,21 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLowMemory() {
|
||||||
|
super.onLowMemory();
|
||||||
|
mapBizView.onLowMemory();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||||
|
super.onSaveInstanceState(outState);
|
||||||
|
mapBizView.onSaveInstanceState(outState);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
|
mapBizView.onDestroy();
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
|
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import com.mogo.commons.AbsMogoApplication;
|
|||||||
import com.mogo.eagle.core.data.map.CenterLine;
|
import com.mogo.eagle.core.data.map.CenterLine;
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
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.autopilot.CallerAutoPilotStatusListenerManager;
|
||||||
import com.mogo.eagle.core.function.call.map.CallerHDMapManager;
|
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||||
@@ -765,7 +764,7 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
|
|||||||
.latitude(station.get(1))
|
.latitude(station.get(1))
|
||||||
.longitude(station.get(0));
|
.longitude(station.get(0));
|
||||||
IMogoMarker marker = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerManager(AbsMogoApplication.getApp())).addMarker(uuid, options);
|
IMogoMarker marker = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerManager(AbsMogoApplication.getApp())).addMarker(uuid, options);
|
||||||
CenterLine centerLine = CallerHDMapManager.INSTANCE.getCenterLineInfo(station.get(0)
|
CenterLine centerLine = CallerMapUIServiceManager.INSTANCE.getMapUIController().getCenterLineInfo(station.get(0)
|
||||||
, station.get(1), -1);
|
, station.get(1), -1);
|
||||||
if (null != centerLine && marker != null) {// 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致
|
if (null != centerLine && marker != null) {// 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致
|
||||||
marker.setRotateAngle(centerLine.getAngle().floatValue());
|
marker.setRotateAngle(centerLine.getAngle().floatValue());
|
||||||
|
|||||||
@@ -6,6 +6,11 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="@dimen/dp_72">
|
android:layout_marginTop="@dimen/dp_72">
|
||||||
|
|
||||||
|
<com.mogo.eagle.core.function.view.MapBizView
|
||||||
|
android:id="@+id/mapBizView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/module_mogo_och_speed_layout"
|
android:id="@+id/module_mogo_och_speed_layout"
|
||||||
android:layout_height="@dimen/taxi_tab_speed_width_height"
|
android:layout_height="@dimen/taxi_tab_speed_width_height"
|
||||||
@@ -80,6 +85,28 @@
|
|||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<!--浓雾预警动画-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.widget.V2XFogEventView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
<!--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.vehicle.SteeringBrakeView
|
||||||
|
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车辆标志-->
|
<!--Vip车辆标志-->
|
||||||
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
||||||
android:layout_width="@dimen/module_vip_width"
|
android:layout_width="@dimen/module_vip_width"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import androidx.test.core.app.ActivityScenario
|
|||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
import androidx.test.filters.LargeTest
|
import androidx.test.filters.LargeTest
|
||||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
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 com.mogo.eagle.core.function.main.MainLauncherActivity
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
import kotlinx.coroutines.flow.*
|
import kotlinx.coroutines.flow.*
|
||||||
@@ -121,15 +121,15 @@ class AutoPilotBadCaseTest {
|
|||||||
delay(TimeUnit.HOURS.toMillis(2))
|
delay(TimeUnit.HOURS.toMillis(2))
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiFragment = suspendCancellableCoroutine {
|
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiProvider = suspendCancellableCoroutine {
|
||||||
launch.onActivity { itx ->
|
launch.onActivity { itx ->
|
||||||
val executor = Executors.newSingleThreadScheduledExecutor()
|
val executor = Executors.newSingleThreadScheduledExecutor()
|
||||||
executor.scheduleAtFixedRate({
|
executor.scheduleAtFixedRate({
|
||||||
var find =
|
var find =
|
||||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
|
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
|
||||||
while (find == null) {
|
while (find == null) {
|
||||||
find =
|
find =
|
||||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
|
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
|
||||||
|
|
||||||
}
|
}
|
||||||
while (!find.isResumed) {
|
while (!find.isResumed) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import androidx.test.core.app.ActivityScenario
|
|||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
import androidx.test.filters.LargeTest
|
import androidx.test.filters.LargeTest
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
|
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 com.mogo.eagle.core.function.main.MainLauncherActivity
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
@@ -35,15 +35,15 @@ class MapDataCollectTest {
|
|||||||
CallerMapDataCollectorManager.setIsInit()
|
CallerMapDataCollectorManager.setIsInit()
|
||||||
delay(TimeUnit.HOURS.toMillis(1))
|
delay(TimeUnit.HOURS.toMillis(1))
|
||||||
}
|
}
|
||||||
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiFragment = suspendCancellableCoroutine {
|
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiProvider = suspendCancellableCoroutine {
|
||||||
launch.onActivity { itx ->
|
launch.onActivity { itx ->
|
||||||
val executor = Executors.newSingleThreadScheduledExecutor()
|
val executor = Executors.newSingleThreadScheduledExecutor()
|
||||||
executor.scheduleAtFixedRate({
|
executor.scheduleAtFixedRate({
|
||||||
var find =
|
var find =
|
||||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
|
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
|
||||||
while (find == null) {
|
while (find == null) {
|
||||||
find =
|
find =
|
||||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
|
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
|
||||||
|
|
||||||
}
|
}
|
||||||
while (!find.isResumed) {
|
while (!find.isResumed) {
|
||||||
|
|||||||
@@ -81,15 +81,15 @@ class ReminderTest {
|
|||||||
delay(3000000)
|
delay(3000000)
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiFragment = suspendCancellableCoroutine {
|
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiProvider = suspendCancellableCoroutine {
|
||||||
launch.onActivity { itx ->
|
launch.onActivity { itx ->
|
||||||
val executor = Executors.newSingleThreadScheduledExecutor()
|
val executor = Executors.newSingleThreadScheduledExecutor()
|
||||||
executor.scheduleAtFixedRate({
|
executor.scheduleAtFixedRate({
|
||||||
var find =
|
var find =
|
||||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
|
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
|
||||||
while (find == null) {
|
while (find == null) {
|
||||||
find =
|
find =
|
||||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
|
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
|
||||||
}
|
}
|
||||||
while (!find.isResumed) {
|
while (!find.isResumed) {
|
||||||
Thread.sleep(500)
|
Thread.sleep(500)
|
||||||
|
|||||||
@@ -136,15 +136,15 @@ class RoadAITest {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiFragment = suspendCancellableCoroutine {
|
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiProvider = suspendCancellableCoroutine {
|
||||||
launch.onActivity { itx ->
|
launch.onActivity { itx ->
|
||||||
val executor = Executors.newSingleThreadScheduledExecutor()
|
val executor = Executors.newSingleThreadScheduledExecutor()
|
||||||
executor.scheduleAtFixedRate({
|
executor.scheduleAtFixedRate({
|
||||||
var find =
|
var find =
|
||||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
|
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
|
||||||
while (find == null) {
|
while (find == null) {
|
||||||
find =
|
find =
|
||||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
|
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
|
||||||
}
|
}
|
||||||
while (!find.isResumed) {
|
while (!find.isResumed) {
|
||||||
Thread.sleep(500)
|
Thread.sleep(500)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package com.mogo.functions.test
|
|||||||
import androidx.test.core.app.ActivityScenario
|
import androidx.test.core.app.ActivityScenario
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
import androidx.test.filters.LargeTest
|
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.function.main.MainLauncherActivity
|
||||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
@@ -44,15 +44,15 @@ class TipToastLeakTest {
|
|||||||
delay(TimeUnit.SECONDS.toMillis(2))
|
delay(TimeUnit.SECONDS.toMillis(2))
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiFragment = suspendCancellableCoroutine {
|
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiProvider = suspendCancellableCoroutine {
|
||||||
launch.onActivity { itx ->
|
launch.onActivity { itx ->
|
||||||
val executor = Executors.newSingleThreadScheduledExecutor()
|
val executor = Executors.newSingleThreadScheduledExecutor()
|
||||||
executor.scheduleAtFixedRate({
|
executor.scheduleAtFixedRate({
|
||||||
var find =
|
var find =
|
||||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
|
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
|
||||||
while (find == null) {
|
while (find == null) {
|
||||||
find =
|
find =
|
||||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
|
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
|
||||||
|
|
||||||
}
|
}
|
||||||
while (!find.isResumed) {
|
while (!find.isResumed) {
|
||||||
|
|||||||
@@ -13,9 +13,7 @@ import com.mogo.eagle.function.biz.notice.NoticeSocketManager.Companion.noticeSo
|
|||||||
import com.mogo.eagle.function.biz.notice.network.NoticeNetWorkManager
|
import com.mogo.eagle.function.biz.notice.network.NoticeNetWorkManager
|
||||||
import com.mogo.eagle.function.biz.v2x.overview.OverViewDataManager
|
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.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.MogoTrafficLightManager
|
||||||
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightDispatcher
|
|
||||||
import com.mogo.eagle.function.biz.v2x.vip.VipCarManager
|
import com.mogo.eagle.function.biz.v2x.vip.VipCarManager
|
||||||
|
|
||||||
@Route(path = MogoServicePaths.PATH_FUNC_BIZ)
|
@Route(path = MogoServicePaths.PATH_FUNC_BIZ)
|
||||||
@@ -31,8 +29,6 @@ class FuncBizProvider : IMoGoFuncBizProvider {
|
|||||||
|
|
||||||
MogoTrafficLightManager.INSTANCE.initServer(context)
|
MogoTrafficLightManager.INSTANCE.initServer(context)
|
||||||
VipCarManager.INSTANCE.initServer(context)
|
VipCarManager.INSTANCE.initServer(context)
|
||||||
TrafficLightDispatcher.INSTANCE.initServer(context) //todo 宏宇 放入dataCenter
|
|
||||||
SpeedLimitDispatcher.INSTANCE.initLimit(context) //todo 宏宇,放入dataCenter
|
|
||||||
// RedLightWarningManager.INSTANCE.listenTrafficLight()
|
// RedLightWarningManager.INSTANCE.listenTrafficLight()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +85,6 @@ class FuncBizProvider : IMoGoFuncBizProvider {
|
|||||||
cronTaskManager.release()
|
cronTaskManager.release()
|
||||||
|
|
||||||
VipCarManager.INSTANCE.destroy()
|
VipCarManager.INSTANCE.destroy()
|
||||||
TrafficLightDispatcher.INSTANCE.destroy()
|
|
||||||
// RedLightWarningManager.INSTANCE.onDestroy()
|
// RedLightWarningManager.INSTANCE.onDestroy()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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.*
|
||||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightStatusHelper.getCurrentRoadTrafficLight
|
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.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||||
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener
|
||||||
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.autopilot.CallerChassisLocationGCJ20ListenerManager
|
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.hmi.CallerHmiManager
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
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.msgbox.CallerMsgBoxManager
|
||||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||||
import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager
|
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.CallerLogger
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||||
import com.mogo.eagle.core.utilcode.util.LocationUtils
|
import com.mogo.eagle.core.utilcode.util.LocationUtils
|
||||||
|
|||||||
@@ -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.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
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.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.CallerLogger
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
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
|
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(
|
trafficLightNetWorkModel.requestTrafficLight(
|
||||||
it.latitude, it.longitude, it.heading, road, { result ->
|
it.latitude, it.longitude, it.heading, road, { result ->
|
||||||
trafficLightResult = result
|
trafficLightResult = result
|
||||||
// TrafficLightHMIManager.INSTANCE.updateTrafficLight(result)
|
|
||||||
CallerTrafficLightListenerManager.invokeTrafficLightStatus(result)
|
CallerTrafficLightListenerManager.invokeTrafficLightStatus(result)
|
||||||
},
|
},
|
||||||
{ errorMsg ->
|
{ errorMsg ->
|
||||||
|
|||||||
@@ -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.isGreen
|
||||||
import com.mogo.eagle.core.data.trafficlight.isRed
|
import com.mogo.eagle.core.data.trafficlight.isRed
|
||||||
import com.mogo.eagle.core.data.v2x.VipMessage
|
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.v2x.IMoGoTrafficLightListener
|
||||||
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
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.hmi.CallerHmiManager
|
||||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
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.v2x.CallerTrafficLightListenerManager
|
||||||
import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager
|
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.CallerLogger
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||||
|
|||||||
@@ -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.data.constants.MogoServicePaths
|
||||||
import com.mogo.eagle.core.function.api.datacenter.IDataCenterProvider
|
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.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)
|
@Route(path = MogoServicePaths.PATH_DATA_CENTER_MODULE)
|
||||||
class DataCenterProvider: IDataCenterProvider {
|
class DataCenterProvider: IDataCenterProvider {
|
||||||
@@ -14,9 +16,15 @@ class DataCenterProvider: IDataCenterProvider {
|
|||||||
|
|
||||||
override fun init(context: Context?) {
|
override fun init(context: Context?) {
|
||||||
MoGoLocationDispatcher.initListener()
|
MoGoLocationDispatcher.initListener()
|
||||||
|
|
||||||
|
context?.let {
|
||||||
|
TrafficLightDispatcher.INSTANCE.initServer(it)
|
||||||
|
SpeedLimitDispatcher.INSTANCE.initLimit(it)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
|
TrafficLightDispatcher.INSTANCE.destroy()
|
||||||
|
SpeedLimitDispatcher.INSTANCE.destroy()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -52,6 +52,7 @@ import com.zhidao.support.adas.high.OnMultiDeviceListener
|
|||||||
import com.zhidao.support.adas.high.common.Constants
|
import com.zhidao.support.adas.high.common.Constants
|
||||||
import com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS
|
import com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS
|
||||||
import com.zhidao.support.adas.high.common.CupidLogUtils
|
import com.zhidao.support.adas.high.common.CupidLogUtils
|
||||||
|
import com.zhidao.support.adas.high.common.MessageType
|
||||||
import com.zhidao.support.adas.high.common.MogoReport
|
import com.zhidao.support.adas.high.common.MogoReport
|
||||||
import com.zhjt.service.chain.ChainLog
|
import com.zhjt.service.chain.ChainLog
|
||||||
import com.zhjt.service.chain.TracingConstants
|
import com.zhjt.service.chain.TracingConstants
|
||||||
@@ -720,7 +721,20 @@ class MoGoAutopilotControlProvider :
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun sendSweeperFuTianTaskCmd(fuTianTaskCmd: SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd) {
|
override fun sendSweeperFuTianTaskCmd(fuTianTaskCmd: SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd) {
|
||||||
Log.d(TAG, "---- sendSweeperFuTianTaskCmd ----")
|
|
||||||
AdasManager.getInstance().sendRoboSweeperFuTianTaskCmd(fuTianTaskCmd)
|
AdasManager.getInstance().sendRoboSweeperFuTianTaskCmd(fuTianTaskCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun setIsDrawPointCloud(isDrawPointCloud: Boolean) {
|
||||||
|
if (isDrawPointCloud) {
|
||||||
|
AdasManager.getInstance().subscribeInterface(
|
||||||
|
Constants.TERMINAL_ROLE.DRIVER,
|
||||||
|
Constants.SUBSCRIBE_TYPE.SUBSCRIBE,
|
||||||
|
MessageType.TYPE_RECEIVE_POINT_CLOUD)
|
||||||
|
} else {
|
||||||
|
AdasManager.getInstance().subscribeInterface(
|
||||||
|
Constants.TERMINAL_ROLE.DRIVER,
|
||||||
|
Constants.SUBSCRIBE_TYPE.UNSUBSCRIBE,
|
||||||
|
MessageType.TYPE_RECEIVE_POINT_CLOUD)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
package com.mogo.eagle.core.function.datacenter.autopilot.server
|
package com.mogo.eagle.core.function.datacenter.autopilot.server
|
||||||
|
|
||||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
|
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.autopilot.CallerAutoPilotControlManager
|
||||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author xiaoyuzhou
|
* @author xiaoyuzhou
|
||||||
|
|||||||
@@ -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.MsgBoxBean
|
||||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
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.IMoGoObuWarningMapListener
|
||||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningRsiListener
|
import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningRsiListener
|
||||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningRsmListener
|
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.CallerObuWarningRsiListenerManager
|
||||||
import com.mogo.eagle.core.function.call.obu.CallerObuWarningRsmListenerManager
|
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.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.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.CallerLogger
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||||
import com.mogo.support.obu.ObuScene
|
import com.mogo.support.obu.ObuScene
|
||||||
import com.mogo.support.obu.constants.MogoObuConstants
|
import com.mogo.support.obu.constants.MogoObuConstants
|
||||||
import mogo.v2x.ObuWarningEvent.*
|
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
|
|
||||||
@@ -258,8 +256,6 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
|||||||
when (status) {
|
when (status) {
|
||||||
// 添加
|
// 添加
|
||||||
MogoObuConstants.STATUS.ADD -> {
|
MogoObuConstants.STATUS.ADD -> {
|
||||||
//显示警告红边
|
|
||||||
CallerHmiManager.showWarning(direction)
|
|
||||||
CallerMsgBoxManager.saveMsgBox(
|
CallerMsgBoxManager.saveMsgBox(
|
||||||
MsgBoxBean(
|
MsgBoxBean(
|
||||||
MsgBoxType.V2X,
|
MsgBoxType.V2X,
|
||||||
@@ -275,13 +271,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
|||||||
CallerHmiManager.warningV2X(
|
CallerHmiManager.warningV2X(
|
||||||
appId,
|
appId,
|
||||||
alertContent,
|
alertContent,
|
||||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
ttsContent, null, direction
|
||||||
object : IMoGoWarningStatusListener {
|
|
||||||
override fun onDismiss() {
|
|
||||||
// 关闭警告红边
|
|
||||||
CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// 更新数据,是否需要
|
// 更新数据,是否需要
|
||||||
@@ -297,7 +287,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
|||||||
// 删除
|
// 删除
|
||||||
MogoObuConstants.STATUS.DELETE -> {
|
MogoObuConstants.STATUS.DELETE -> {
|
||||||
// 关闭警告红边
|
// 关闭警告红边
|
||||||
// CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||||
// 更新数据,删除标牌?
|
// 更新数据,删除标牌?
|
||||||
// TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(rsiWarningData)
|
// TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(rsiWarningData)
|
||||||
// ?.let {
|
// ?.let {
|
||||||
@@ -345,24 +335,20 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
|||||||
level = rsmWarningData.warningMsg.warningDataList[0].warningLevel
|
level = rsmWarningData.warningMsg.warningDataList[0].warningLevel
|
||||||
CallerLogger.d(
|
CallerLogger.d(
|
||||||
"${M_OBU}${TAG}",
|
"${M_OBU}${TAG}",
|
||||||
"MogoObuDcCombineManager onMogoObuRsmWarning ---status---> ${rsmWarningData.status} --list status----> ${
|
"ObuDcCombineManager onObuRsmWarning ---status---> ${rsmWarningData.status} --list status----> ${
|
||||||
rsmWarningData.warningMsg.warningDataList.get(
|
rsmWarningData.warningMsg.warningDataList[0].status
|
||||||
0
|
|
||||||
).status
|
|
||||||
} --v2xType--- $v2xType ---alertContent = $alertContent ---ttsContent= $ttsContent"
|
} --v2xType--- $v2xType ---alertContent = $alertContent ---ttsContent= $ttsContent"
|
||||||
)
|
)
|
||||||
|
|
||||||
when (rsmWarningData.warningMsg.warningDataList.get(0).status) {
|
when (rsmWarningData.warningMsg.warningDataList[0].status) {
|
||||||
MogoObuConstants.STATUS.ADD -> { // 添加
|
MogoObuConstants.STATUS.ADD -> { // 添加
|
||||||
//显示警告红边
|
|
||||||
CallerHmiManager.showWarning(direction)
|
|
||||||
CallerMsgBoxManager.saveMsgBox(
|
CallerMsgBoxManager.saveMsgBox(
|
||||||
MsgBoxBean(
|
MsgBoxBean(
|
||||||
MsgBoxType.V2X,
|
MsgBoxType.V2X,
|
||||||
V2XMsg(
|
V2XMsg(
|
||||||
v2xType,
|
v2xType,
|
||||||
alertContent,
|
alertContent,
|
||||||
ttsContent
|
ttsContent,
|
||||||
)
|
)
|
||||||
).apply {
|
).apply {
|
||||||
sourceType = DataSourceType.TELEMATIC
|
sourceType = DataSourceType.TELEMATIC
|
||||||
@@ -371,15 +357,9 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
|||||||
CallerHmiManager.warningV2X(
|
CallerHmiManager.warningV2X(
|
||||||
v2xType,
|
v2xType,
|
||||||
alertContent,
|
alertContent,
|
||||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
ttsContent,
|
||||||
object : IMoGoWarningStatusListener {
|
null,
|
||||||
override fun onDismiss() {
|
direction
|
||||||
// 关闭警告红边
|
|
||||||
CallerHmiManager.dismissWarning(
|
|
||||||
WarningDirectionEnum.ALERT_WARNING_ALL
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// 更新数据 TODO
|
// 更新数据 TODO
|
||||||
@@ -396,7 +376,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
|||||||
// 删除
|
// 删除
|
||||||
MogoObuConstants.STATUS.DELETE -> {
|
MogoObuConstants.STATUS.DELETE -> {
|
||||||
// 关闭警告红边
|
// 关闭警告红边
|
||||||
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL)
|
||||||
// 更新数据 TODO 由于obu通过域控需要转换单位,这里临时转换,后面3.0不需要转换
|
// 更新数据 TODO 由于obu通过域控需要转换单位,这里临时转换,后面3.0不需要转换
|
||||||
// TrafficDataConvertUtils.cvxPtcThreatIndInfo2TrafficData(rsmWarningData)?.let {
|
// TrafficDataConvertUtils.cvxPtcThreatIndInfo2TrafficData(rsmWarningData)?.let {
|
||||||
// // 事件结束,还原交通参与者颜色
|
// // 事件结束,还原交通参与者颜色
|
||||||
@@ -451,8 +431,8 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
|||||||
} --- data.speedMaxLimit = ${data.speedMaxLimit}"
|
} --- data.speedMaxLimit = ${data.speedMaxLimit}"
|
||||||
)
|
)
|
||||||
when (data.status) {
|
when (data.status) {
|
||||||
MogoObuConstants.STATUS.ADD -> { // 添加
|
MogoObuConstants.STATUS.ADD -> { // 添加 TODO
|
||||||
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
|
CallerLimitingVelocityListenerManager.invokeUnion(
|
||||||
(data.speedMaxLimit * 0.02 * 3.6).roundToInt().toInt(),
|
(data.speedMaxLimit * 0.02 * 3.6).roundToInt().toInt(),
|
||||||
DataSourceType.OBU
|
DataSourceType.OBU
|
||||||
)
|
)
|
||||||
@@ -462,7 +442,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
|||||||
}
|
}
|
||||||
|
|
||||||
MogoObuConstants.STATUS.DELETE -> { // 删除
|
MogoObuConstants.STATUS.DELETE -> { // 删除
|
||||||
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
|
CallerLimitingVelocityListenerManager.invokeUnion(
|
||||||
-1,
|
-1,
|
||||||
DataSourceType.OBU
|
DataSourceType.OBU
|
||||||
)
|
)
|
||||||
@@ -637,7 +617,6 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
|||||||
sourceType = DataSourceType.TELEMATIC
|
sourceType = DataSourceType.TELEMATIC
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
CallerHmiManager.warningV2X(
|
CallerHmiManager.warningV2X(
|
||||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||||
alertContent,
|
alertContent,
|
||||||
@@ -651,40 +630,38 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
|||||||
when (currentLight.light) {
|
when (currentLight.light) {
|
||||||
// 灯光不可用
|
// 灯光不可用
|
||||||
0 -> {
|
0 -> {
|
||||||
CallerTrafficLightListenerManager.showTrafficLight(
|
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(
|
||||||
TrafficLightEnum.BLACK,
|
TrafficLightEnum.BLACK,
|
||||||
|
-1,
|
||||||
DataSourceType.TELEMATIC
|
DataSourceType.TELEMATIC
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 红灯
|
// 红灯
|
||||||
2, 3 -> {
|
2, 3 -> {
|
||||||
CallerTrafficLightListenerManager.showTrafficLight(
|
val red = (currentLight.countDown / 10).toInt()
|
||||||
|
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(
|
||||||
TrafficLightEnum.RED,
|
TrafficLightEnum.RED,
|
||||||
|
red,
|
||||||
DataSourceType.TELEMATIC
|
DataSourceType.TELEMATIC
|
||||||
)
|
)
|
||||||
val red = currentLight.countDown / 10
|
|
||||||
CallerTrafficLightListenerManager.changeCountdownRed(red.toInt())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 绿灯
|
// 绿灯
|
||||||
4, 5, 6 -> {
|
4, 5, 6 -> {
|
||||||
CallerTrafficLightListenerManager.showTrafficLight(
|
val green = (currentLight.countDown / 10).toInt()
|
||||||
|
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(
|
||||||
TrafficLightEnum.GREEN,
|
TrafficLightEnum.GREEN,
|
||||||
|
green,
|
||||||
DataSourceType.TELEMATIC
|
DataSourceType.TELEMATIC
|
||||||
)
|
)
|
||||||
val green = currentLight.countDown / 10
|
|
||||||
CallerTrafficLightListenerManager.changeCountdownGreen(green.toInt())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 黄灯
|
// 黄灯
|
||||||
7, 8 -> {
|
7, 8 -> {
|
||||||
CallerTrafficLightListenerManager.showTrafficLight(
|
val yellow = (currentLight.countDown / 10).toInt()
|
||||||
|
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(
|
||||||
TrafficLightEnum.YELLOW,
|
TrafficLightEnum.YELLOW,
|
||||||
|
yellow,
|
||||||
DataSourceType.TELEMATIC
|
DataSourceType.TELEMATIC
|
||||||
)
|
)
|
||||||
val yellow = currentLight.countDown / 10
|
|
||||||
CallerTrafficLightListenerManager.changeCountdownYellow(yellow.toInt())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.map.CallerVisualAngleManager.Scene.TooClose
|
||||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
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.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.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.function.datacenter.obu.utils.TrafficDataConvertUtilsNew
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
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.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||||
@@ -410,12 +410,7 @@ class MogoPrivateObuNewManager private constructor() {
|
|||||||
appId,
|
appId,
|
||||||
alertContent,
|
alertContent,
|
||||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||||
object : IMoGoWarningStatusListener {
|
null, direction
|
||||||
override fun onDismiss() {
|
|
||||||
// 关闭警告红边
|
|
||||||
CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// 更新数据
|
// 更新数据
|
||||||
@@ -551,8 +546,6 @@ class MogoPrivateObuNewManager private constructor() {
|
|||||||
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
|
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
//显示警告红边
|
|
||||||
CallerHmiManager.showWarning(direction)
|
|
||||||
CallerMsgBoxManager.saveMsgBox(
|
CallerMsgBoxManager.saveMsgBox(
|
||||||
MsgBoxBean(
|
MsgBoxBean(
|
||||||
MsgBoxType.V2X,
|
MsgBoxType.V2X,
|
||||||
@@ -570,14 +563,7 @@ class MogoPrivateObuNewManager private constructor() {
|
|||||||
v2xType,
|
v2xType,
|
||||||
alertContent,
|
alertContent,
|
||||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||||
object : IMoGoWarningStatusListener {
|
null, direction
|
||||||
override fun onDismiss() {
|
|
||||||
// 关闭警告红边
|
|
||||||
CallerHmiManager.dismissWarning(
|
|
||||||
WarningDirectionEnum.ALERT_WARNING_ALL
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -586,7 +572,7 @@ class MogoPrivateObuNewManager private constructor() {
|
|||||||
|
|
||||||
MogoObuConstants.STATUS.DELETE -> { // 删除
|
MogoObuConstants.STATUS.DELETE -> { // 删除
|
||||||
// 关闭警告红边
|
// 关闭警告红边
|
||||||
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL)
|
||||||
//删除弱势交通元素
|
//删除弱势交通元素
|
||||||
CallerMapUIServiceManager.getMarkerService()
|
CallerMapUIServiceManager.getMarkerService()
|
||||||
?.removeCvxRvInfoIndInfo(data.participant.ptcId.toString())
|
?.removeCvxRvInfoIndInfo(data.participant.ptcId.toString())
|
||||||
@@ -612,7 +598,7 @@ class MogoPrivateObuNewManager private constructor() {
|
|||||||
MogoObuConstants.STATUS.ADD -> { // 添加
|
MogoObuConstants.STATUS.ADD -> { // 添加
|
||||||
UiThreadHandler.post {
|
UiThreadHandler.post {
|
||||||
if (data.speedMaxLimit > 0) {
|
if (data.speedMaxLimit > 0) {
|
||||||
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
|
CallerLimitingVelocityListenerManager.invokeUnion(
|
||||||
(data.speedMaxLimit * 3.6).roundToInt(), DataSourceType.OBU
|
(data.speedMaxLimit * 3.6).roundToInt(), DataSourceType.OBU
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -624,7 +610,7 @@ class MogoPrivateObuNewManager private constructor() {
|
|||||||
|
|
||||||
MogoObuConstants.STATUS.DELETE -> { // 删除
|
MogoObuConstants.STATUS.DELETE -> { // 删除
|
||||||
UiThreadHandler.post {
|
UiThreadHandler.post {
|
||||||
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
|
CallerLimitingVelocityListenerManager.invokeUnion(
|
||||||
-1,
|
-1,
|
||||||
DataSourceType.OBU
|
DataSourceType.OBU
|
||||||
)
|
)
|
||||||
@@ -637,196 +623,367 @@ class MogoPrivateObuNewManager private constructor() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取消息的方位 车辆相关
|
* 获取消息的方位 车辆相关
|
||||||
*/
|
*/
|
||||||
private fun getMessageDirection(targetClassification: Int): WarningDirectionEnum {
|
private fun getMessageDirection(targetClassification: Int): WarningDirectionEnum {
|
||||||
// CallerLogger.d("$M_OBU${TAG_MOGO_NEW_OBU}", "预警红边:预警方向->$targetClassification")
|
// CallerLogger.d("$M_OBU${TAG_MOGO_NEW_OBU}", "预警红边:预警方向->$targetClassification")
|
||||||
return when (targetClassification) {
|
return when (targetClassification) {
|
||||||
MogoObuConstants.VEH_TARGET_POSITION.AHEAD_IN_LANE,
|
MogoObuConstants.VEH_TARGET_POSITION.AHEAD_IN_LANE,
|
||||||
MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_TOP //正前方
|
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.AHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_LEFT,
|
||||||
MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_LEFT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAR_LEFT
|
MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_LEFT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAR_LEFT
|
||||||
-> WarningDirectionEnum.ALERT_WARNING_TOP_LEFT //左前方
|
-> WarningDirectionEnum.ALERT_WARNING_TOP_LEFT //左前方
|
||||||
|
|
||||||
MogoObuConstants.VEH_TARGET_POSITION.AHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_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
|
MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAT_RIGHT
|
||||||
-> WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT //右前方
|
-> WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT //右前方
|
||||||
|
|
||||||
MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_LEFT,
|
MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_LEFT,
|
||||||
-> WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT //左后方
|
-> WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT //左后方
|
||||||
|
|
||||||
MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_RIGHT,
|
MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_RIGHT,
|
||||||
-> WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT //右后方
|
-> WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT //右后方
|
||||||
|
|
||||||
MogoObuConstants.VEH_TARGET_POSITION.UNCLASSIFIED -> WarningDirectionEnum.ALERT_WARNING_NON //未知
|
MogoObuConstants.VEH_TARGET_POSITION.UNCLASSIFIED -> WarningDirectionEnum.ALERT_WARNING_NON //未知
|
||||||
else -> WarningDirectionEnum.ALERT_WARNING_ALL
|
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())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
when (status) {
|
||||||
* 构造对应展示数据和场景 根据obu的场景,add change delete确定是否展示
|
// 添加,更新 add的时候,可能级别是2,
|
||||||
*
|
MogoObuConstants.STATUS.ADD,
|
||||||
* @param appId 使用WarningTypeEnum获取icon、提示内容、tts内容 TODO 添加事件频繁播报拦截
|
MogoObuConstants.STATUS.UPDATE -> {
|
||||||
*
|
CallerLogger.d(
|
||||||
* @see com.mogo.module.common.enums.EventTypeEnum
|
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||||
*/
|
"new handleSdkObu appId2 = $appId --- level = $level ---ttsContent = $ttsContent --- alertContent = $alertContent --- direction = $direction"
|
||||||
private fun handleSdkObu(
|
)
|
||||||
appId: String,
|
if (level == 2 || level == 3) {
|
||||||
direction: WarningDirectionEnum,
|
//不显示弹框,其它保留
|
||||||
status: Int,
|
CallerMsgBoxManager.saveMsgBox(
|
||||||
level: Int,
|
MsgBoxBean(
|
||||||
info: MogoObuRvWarningData
|
MsgBoxType.V2X,
|
||||||
) {
|
V2XMsg(
|
||||||
// 这里排除需要特殊定制的语音及文案外,其余的都可以使用 EventTypeEnumNew 提供的
|
appId,
|
||||||
var alertContent: String = ""
|
alertContent,
|
||||||
var ttsContent: String = ""
|
ttsContent
|
||||||
var changeVisualAngle = false
|
)
|
||||||
when (appId) {
|
).apply {
|
||||||
//交叉路口碰撞预警
|
sourceType = DataSourceType.OBU
|
||||||
MogoObuConstants.V2X_WARNING_TYPE.FCW.toString() -> {
|
}
|
||||||
alertContent =
|
)
|
||||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
|
CallerHmiManager.warningV2X(
|
||||||
ttsContent =
|
appId,
|
||||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
|
alertContent,
|
||||||
}
|
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||||
|
object : IMoGoWarningStatusListener {
|
||||||
|
override fun onShow() {
|
||||||
|
super.onShow()
|
||||||
|
if (changeVisualAngle) {
|
||||||
|
CallerVisualAngleManager.changeVisualAngle(TooClose)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//交叉路口碰撞预警
|
override fun onDismiss() {
|
||||||
MogoObuConstants.V2X_WARNING_TYPE.ICW.toString() -> {
|
if (changeVisualAngle) {
|
||||||
alertContent =
|
CallerVisualAngleManager.changeVisualAngle(Default())
|
||||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType)
|
}
|
||||||
ttsContent =
|
}
|
||||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType)
|
}, direction
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
//更新周边车辆进行预警颜色变换,车辆实时移动和变色 ,UUID不需要匹配了
|
||||||
//左转辅助预警
|
TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let {
|
||||||
MogoObuConstants.V2X_WARNING_TYPE.LTA.toString() -> {
|
CallerMapUIServiceManager.getMarkerService()
|
||||||
alertContent =
|
?.updateITrafficThreatLevelInfo(it)
|
||||||
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())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 删除
|
||||||
|
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(
|
CallerLogger.d(
|
||||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
"$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(
|
CallerMsgBoxManager.saveMsgBox(
|
||||||
MsgBoxBean(
|
MsgBoxBean(
|
||||||
MsgBoxType.V2X,
|
MsgBoxType.V2X,
|
||||||
V2XMsg(
|
V2XMsg(
|
||||||
appId,
|
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||||
alertContent,
|
alertContent,
|
||||||
ttsContent
|
ttsContent
|
||||||
)
|
)
|
||||||
@@ -835,205 +992,34 @@ class MogoPrivateObuNewManager private constructor() {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
CallerHmiManager.warningV2X(
|
CallerHmiManager.warningV2X(
|
||||||
appId,
|
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||||
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,
|
|
||||||
alertContent,
|
alertContent,
|
||||||
ttsContent// 只有第一次才tts,防止更新的时候不断的提醒
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -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 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.data.enums.DataSourceType
|
||||||
import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
|
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.CallerLimitingVelocityListenerManager
|
||||||
import com.mogo.eagle.core.function.call.v2x.CallerViewLimitingVelocityListenerManager
|
|
||||||
import com.zhjt.service_biz.BizConfig
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author lixiaopeng
|
* @author lixiaopeng
|
||||||
@@ -35,11 +32,12 @@ class SpeedLimitDispatcher : ILimitingVelocityListener {
|
|||||||
* 地图限速数据
|
* 地图限速数据
|
||||||
*/
|
*/
|
||||||
// @BizConfig(FuncBizConfig.V2I, "", FuncBizConfig.BIZ_SLW) //todo arrow 重新考虑放的位置
|
// @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,体现链路能力
|
when (sourceType) { // obu 优先级高于 map,体现链路能力
|
||||||
DataSourceType.OBU -> {
|
DataSourceType.OBU -> {
|
||||||
hasObuStatus = limitingVelocity > 0
|
hasObuStatus = limitingVelocity > 0
|
||||||
CallerViewLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
|
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
|
||||||
limitingVelocity,
|
limitingVelocity,
|
||||||
sourceType
|
sourceType
|
||||||
)
|
)
|
||||||
@@ -47,7 +45,7 @@ class SpeedLimitDispatcher : ILimitingVelocityListener {
|
|||||||
}
|
}
|
||||||
DataSourceType.MAP -> {
|
DataSourceType.MAP -> {
|
||||||
if (!hasObuStatus) {
|
if (!hasObuStatus) {
|
||||||
CallerViewLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
|
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
|
||||||
limitingVelocity,
|
limitingVelocity,
|
||||||
sourceType
|
sourceType
|
||||||
)
|
)
|
||||||
@@ -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.content.Context
|
||||||
import android.os.Handler
|
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.enums.TrafficLightEnum
|
||||||
import com.mogo.eagle.core.data.trafficlight.*
|
import com.mogo.eagle.core.data.trafficlight.*
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
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.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
|
||||||
import perception.TrafficLightOuterClass.TrafficLight
|
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
|
* @author XuXinChao
|
||||||
* @description 对多个红绿灯信号来源进行统一调度(AI云、工控机、OBU)
|
* @description 对多个红绿灯信号来源进行统一调度(AI云、工控机、OBU)
|
||||||
@@ -38,7 +57,7 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
|
|||||||
|
|
||||||
fun initServer(context: Context) {
|
fun initServer(context: Context) {
|
||||||
mContext = context
|
mContext = context
|
||||||
//注册监听AI云获取红绿灯状态
|
//注册监听AI云.OBU,路侧获取红绿灯状态
|
||||||
CallerTrafficLightListenerManager.addListener(TAG, this)
|
CallerTrafficLightListenerManager.addListener(TAG, this)
|
||||||
//注册监听工控机感知红绿灯
|
//注册监听工控机感知红绿灯
|
||||||
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
|
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
|
||||||
@@ -66,39 +85,8 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
|
|||||||
//隐藏红绿灯显示
|
//隐藏红绿灯显示
|
||||||
CallerTrafficLightListenerManager.disableTrafficLight()
|
CallerTrafficLightListenerManager.disableTrafficLight()
|
||||||
} else {
|
} else {
|
||||||
when (light.state) {
|
onTrafficLightPlusSource(light.convert(), 0, DataSourceType.TELEMATIC)
|
||||||
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 -> {}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -109,8 +97,8 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
|
|||||||
*/
|
*/
|
||||||
override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) {
|
override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) {
|
||||||
if (!hasObuLightStatus) {
|
if (!hasObuLightStatus) {
|
||||||
updateTrafficLight(trafficLightResult)
|
|
||||||
hasAiLightStatus = true
|
hasAiLightStatus = true
|
||||||
|
updateTrafficLight(trafficLightResult)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,10 +128,38 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
|
|||||||
/**
|
/**
|
||||||
* obu 红绿灯数据
|
* obu 红绿灯数据
|
||||||
*/
|
*/
|
||||||
override fun onObuTrafficLightStatus(light: TrafficLightEnum) {
|
override fun onTrafficLightPlusSource(
|
||||||
super.onObuTrafficLightStatus(light)
|
light: TrafficLightEnum,
|
||||||
hasObuLightStatus = true
|
remain: Int,
|
||||||
CallerTrafficLightListenerManager.showTrafficLight(light, DataSourceType.OBU)
|
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) {
|
private fun updateTrafficLight(trafficLightResult: TrafficLightResult) {
|
||||||
@@ -154,25 +170,13 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
|
|||||||
} else {
|
} else {
|
||||||
it.remain
|
it.remain
|
||||||
}
|
}
|
||||||
when {
|
onTrafficLightPlusSource(it.convert(), remain, DataSourceType.AICLOUD)
|
||||||
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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun destroy() {
|
fun destroy() {
|
||||||
//取消注册监听AI云获取红绿灯状态
|
//取消注册监听AI云.OBU,路侧获取红绿灯状态
|
||||||
CallerTrafficLightListenerManager.removeListener(TAG)
|
CallerTrafficLightListenerManager.removeListener(TAG)
|
||||||
//取消注册监听工控机感知红绿灯
|
//取消注册监听工控机感知红绿灯
|
||||||
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
|
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
|
||||||
@@ -9,7 +9,7 @@ import com.mogo.eagle.core.data.bindingcar.ModifyBindingcarInfo
|
|||||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig
|
import com.mogo.eagle.core.data.config.HdMapBuildConfig
|
||||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBindingCarDialog
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBindingCarDialog
|
||||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showModifyBindingCarDialog
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showModifyBindingCarDialog
|
||||||
import com.mogo.eagle.core.function.call.map.CallerHDMapManager.changeCurrentIcon
|
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||||
import com.mogo.eagle.core.network.utils.GsonUtil
|
import com.mogo.eagle.core.network.utils.GsonUtil
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||||
@@ -156,19 +156,19 @@ class BindingCarNetWorkManager private constructor() {
|
|||||||
d(SceneConstant.M_BINDING + TAG, "updateCarVrIconRes : $brandId")
|
d(SceneConstant.M_BINDING + TAG, "updateCarVrIconRes : $brandId")
|
||||||
when (brandId) {
|
when (brandId) {
|
||||||
"1" -> {
|
"1" -> {
|
||||||
changeCurrentIcon(R.raw.chuzuche)
|
CallerMapUIServiceManager.getMapUIController()?.changeCurrentIcon(R.raw.chuzuche)
|
||||||
HdMapBuildConfig.currentCarVrIconRes = R.raw.chuzuche
|
HdMapBuildConfig.currentCarVrIconRes = R.raw.chuzuche
|
||||||
}
|
}
|
||||||
"2" -> {
|
"2" -> {
|
||||||
changeCurrentIcon(R.raw.hq_h9)
|
CallerMapUIServiceManager.getMapUIController()?.changeCurrentIcon(R.raw.hq_h9)
|
||||||
HdMapBuildConfig.currentCarVrIconRes = R.raw.hq_h9
|
HdMapBuildConfig.currentCarVrIconRes = R.raw.hq_h9
|
||||||
}
|
}
|
||||||
"3" -> {
|
"3" -> {
|
||||||
changeCurrentIcon(R.raw.xiaobache)
|
CallerMapUIServiceManager.getMapUIController()?.changeCurrentIcon(R.raw.xiaobache)
|
||||||
HdMapBuildConfig.currentCarVrIconRes = R.raw.xiaobache
|
HdMapBuildConfig.currentCarVrIconRes = R.raw.xiaobache
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
changeCurrentIcon(R.raw.chuzuche)
|
CallerMapUIServiceManager.getMapUIController()?.changeCurrentIcon(R.raw.chuzuche)
|
||||||
HdMapBuildConfig.currentCarVrIconRes = R.raw.chuzuche
|
HdMapBuildConfig.currentCarVrIconRes = R.raw.chuzuche
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import android.view.View
|
|||||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
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.api.hmi.view.IViewControlListener.Companion.LimitingVelocityView_TAG
|
||||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
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.function.hmi.WaringConst
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
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.logger.scene.SceneConstant.Companion.M_HMI
|
||||||
@@ -61,7 +61,7 @@ class V2XLimitingVelocityBroadcastReceiver : BroadcastReceiver() {
|
|||||||
* @param limitingVelocitySpeed 限速速度
|
* @param limitingVelocitySpeed 限速速度
|
||||||
*/
|
*/
|
||||||
private fun dispatchShowWaring(limitingVelocitySpeed: Int) {
|
private fun dispatchShowWaring(limitingVelocitySpeed: Int) {
|
||||||
CallerViewLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(limitingVelocitySpeed,DataSourceType.MAP)
|
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(limitingVelocitySpeed,DataSourceType.MAP)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import android.content.Context
|
|||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||||
import com.mogo.eagle.core.data.enums.TrafficLightEnum
|
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
|
import com.mogo.eagle.core.function.hmi.WaringConst
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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.MsgBoxType
|
||||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
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 预警广播接收。用于跨应用,跨进程,内部也可以通过这种方式弹出预警提示框
|
* V2X 预警广播接收。用于跨应用,跨进程,内部也可以通过这种方式弹出预警提示框
|
||||||
@@ -77,7 +77,7 @@ class V2XWarningBroadcastReceiver : BroadcastReceiver() {
|
|||||||
ttsContent: String?,
|
ttsContent: String?,
|
||||||
) {
|
) {
|
||||||
if (EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType == v2xType.toString()) {
|
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()) {
|
if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) {
|
||||||
Log.d("MsgBox-V2XWarningBR", "alertContent或ttsContent为空!")
|
Log.d("MsgBox-V2XWarningBR", "alertContent或ttsContent为空!")
|
||||||
|
|||||||
@@ -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) {
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -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 {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -3,18 +3,14 @@ package com.mogo.eagle.core.function.hmi.ui
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.text.TextUtils
|
import android.text.TextUtils
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import androidx.lifecycle.ProcessLifecycleOwner
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import com.alibaba.android.arouter.facade.annotation.Route
|
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.AIAssist
|
||||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
|
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
|
||||||
import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
|
import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
|
||||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_FRAGMENT_HMI
|
||||||
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
|
|
||||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_RTS
|
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.deva.bizconfig.FuncBizConfig.Companion.V2I
|
||||||
import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean
|
import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean
|
||||||
@@ -26,10 +22,8 @@ import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
|
|||||||
import com.mogo.eagle.core.data.report.ReportEntity
|
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.IMoGoHmiProvider
|
||||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
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.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.camera.RoadVideoDialog
|
||||||
import com.mogo.eagle.core.function.hmi.ui.notice.DispatchDialogManager
|
import com.mogo.eagle.core.function.hmi.ui.notice.DispatchDialogManager
|
||||||
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeCheckDialog
|
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeCheckDialog
|
||||||
@@ -42,15 +36,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.ToBindingCarDialog
|
||||||
import com.mogo.eagle.core.function.hmi.ui.tools.UpgradeAppDialog
|
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.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.kotlin.safeCancel
|
||||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
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.CallerLogger
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
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.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||||
import com.zhjt.service_biz.BizConfig
|
import com.zhjt.service_biz.BizConfig
|
||||||
import kotlinx.android.synthetic.main.fragment_hmi.*
|
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
import java.util.concurrent.atomic.AtomicReference
|
import java.util.concurrent.atomic.AtomicReference
|
||||||
|
|
||||||
@@ -59,36 +50,19 @@ import java.util.concurrent.atomic.AtomicReference
|
|||||||
* @date 2021/8/3 2:40 下午
|
* @date 2021/8/3 2:40 下午
|
||||||
* 预警图层
|
* 预警图层
|
||||||
*/
|
*/
|
||||||
@Route(path = MoGoFragmentPaths.PATH_FRAGMENT_HMI)
|
@Route(path = PATH_FRAGMENT_HMI)
|
||||||
class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
class MoGoHmiProvider : IMoGoHmiProvider {
|
||||||
IMoGoHmiProvider,
|
|
||||||
MoGoHmiContract.View {
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val TAG = "MoGoHmiFragment"
|
private const val TAG = "MoGoHmiProvider"
|
||||||
}
|
}
|
||||||
|
|
||||||
private val lastSpeakJob by lazy { AtomicReference<Job>() }
|
private val lastSpeakJob by lazy { AtomicReference<Job>() }
|
||||||
private var lastShowV2XJob: Job? = null
|
private var lastShowV2XJob: Job? = null
|
||||||
|
private var context: Context? = null
|
||||||
|
|
||||||
override fun initViews() {
|
override fun init(context: Context?) {
|
||||||
}
|
this.context = context
|
||||||
|
|
||||||
override fun showIPCReportWindow(
|
|
||||||
errorReportList: ArrayList<ReportEntity>,
|
|
||||||
warningReportList: ArrayList<ReportEntity>,
|
|
||||||
reportLevel: Int
|
|
||||||
) {
|
|
||||||
ThreadUtils.runOnUiThread {
|
|
||||||
if (reportLevel == 1) {
|
|
||||||
IPCReportWindow.show(
|
|
||||||
requireContext(),
|
|
||||||
errorReportList,
|
|
||||||
warningReportList,
|
|
||||||
reportLevel
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun setStatusBarDarkOrLight(light: Boolean) {
|
override fun setStatusBarDarkOrLight(light: Boolean) {
|
||||||
@@ -97,28 +71,19 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
|||||||
|
|
||||||
override fun updateStatusBarRightView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
override fun updateStatusBarRightView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
||||||
CallerHmiViewControlListenerManager.updateStatusBarRightView(
|
CallerHmiViewControlListenerManager.updateStatusBarRightView(
|
||||||
StatusBarView.TAG,
|
StatusBarView.TAG, insert, tag, viewGroup
|
||||||
insert,
|
|
||||||
tag,
|
|
||||||
viewGroup
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateStatusBarLeftView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
override fun updateStatusBarLeftView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
||||||
CallerHmiViewControlListenerManager.updateStatusBarLeftView(
|
CallerHmiViewControlListenerManager.updateStatusBarLeftView(
|
||||||
StatusBarView.TAG,
|
StatusBarView.TAG, insert, tag, viewGroup
|
||||||
insert,
|
|
||||||
tag,
|
|
||||||
viewGroup
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateStatusBarDownloadView(insert: Boolean, tag: String, progress: Int) {
|
override fun updateStatusBarDownloadView(insert: Boolean, tag: String, progress: Int) {
|
||||||
CallerHmiViewControlListenerManager.updateStatusBarDownloadView(
|
CallerHmiViewControlListenerManager.updateStatusBarDownloadView(
|
||||||
StatusBarView.TAG,
|
StatusBarView.TAG, insert, tag, progress
|
||||||
insert,
|
|
||||||
tag,
|
|
||||||
progress
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,23 +91,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
|||||||
CallerHmiViewControlListenerManager.updateMfStatus(StatusBarView.TAG, tag, status)
|
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 +100,31 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
|||||||
alertContent: CharSequence?,
|
alertContent: CharSequence?,
|
||||||
ttsContent: String?,
|
ttsContent: String?,
|
||||||
listener: IMoGoWarningStatusListener?,
|
listener: IMoGoWarningStatusListener?,
|
||||||
playTts: Boolean,
|
direction: WarningDirectionEnum,
|
||||||
expireTime: Long
|
expireTime: Long
|
||||||
) {
|
) {
|
||||||
val playTTS =
|
val playTTS = !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
|
||||||
playTts && !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
|
context?.let {
|
||||||
activity?.let {
|
val warningContent = alertContent ?: EventTypeEnumNew.getWarningContent(v2xType)
|
||||||
val warningContent = alertContent
|
|
||||||
?: EventTypeEnumNew.getWarningContent(v2xType)
|
|
||||||
|
|
||||||
if (warningContent.isEmpty()) {
|
if (warningContent.isEmpty()) {
|
||||||
CallerLogger.e("$M_HMI$TAG", "Show warningContent is null or empty!")
|
CallerLogger.e("$M_HMI$TAG", "Show warningContent is null or empty!")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
listener?.onShow()
|
listener?.onShow()
|
||||||
|
CallerV2XWarningListenerManager.show(v2xType, direction, expireTime)
|
||||||
CallerLogger.d(
|
CallerLogger.d(
|
||||||
"$M_HMI$TAG",
|
"$M_HMI$TAG",
|
||||||
"--- show v2x dialog 1 ---: info -> v2x-type: $v2xType : expireTime: $expireTime"
|
"--- show v2x dialog 1 ---: info -> v2x-type: $v2xType : expireTime: $expireTime"
|
||||||
)
|
)
|
||||||
lastShowV2XJob?.safeCancel()
|
lastShowV2XJob?.safeCancel()
|
||||||
lifecycleScope.launch {
|
ProcessLifecycleOwner.get().lifecycleScope.launch(Dispatchers.Main) {
|
||||||
delay(expireTime)
|
delay(expireTime)
|
||||||
}.also { itx ->
|
}.also { itx ->
|
||||||
lastShowV2XJob = itx
|
lastShowV2XJob = itx
|
||||||
}.invokeOnCompletion {
|
}.invokeOnCompletion {
|
||||||
listener?.onDismiss()
|
listener?.onDismiss()
|
||||||
dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL)
|
CallerV2XWarningListenerManager.dismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ttsContent != null && !TextUtils.isEmpty(ttsContent) && playTTS) {
|
if (ttsContent != null && !TextUtils.isEmpty(ttsContent) && playTTS) {
|
||||||
@@ -185,7 +132,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
|||||||
if (last != null && !last.isCompleted) {
|
if (last != null && !last.isCompleted) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
lifecycleScope.launch(Dispatchers.Default) {
|
ProcessLifecycleOwner.get().lifecycleScope.launch(Dispatchers.Main) {
|
||||||
speak(it, ttsContent)
|
speak(it, ttsContent)
|
||||||
}.also { itx ->
|
}.also { itx ->
|
||||||
lastSpeakJob.set(itx)
|
lastSpeakJob.set(itx)
|
||||||
@@ -217,38 +164,35 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun showWarning(direction: WarningDirectionEnum) {
|
override fun showWarning(v2xType: String, direction: WarningDirectionEnum, expireTime: Long) {
|
||||||
CallerLogger.d(TAG, "showWarning====")
|
CallerV2XWarningListenerManager.show(v2xType, direction, expireTime)
|
||||||
flV2XWarningView?.showWarning(direction)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun showWarning(direction: WarningDirectionEnum, closeTime: Long) {
|
|
||||||
flV2XWarningView?.showWarning(direction, closeTime)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun dismissWarning(direction: WarningDirectionEnum) {
|
override fun dismissWarning(direction: WarningDirectionEnum) {
|
||||||
flV2XWarningView?.dismissWarning(direction)
|
CallerV2XWarningListenerManager.dismiss(direction)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** todo----------------------------------------------- **/
|
|
||||||
|
|
||||||
override fun showDispatchDialog(msgData: DispatchAdasAutoPilotLocReceiverBean) {
|
override fun showDispatchDialog(msgData: DispatchAdasAutoPilotLocReceiverBean) {
|
||||||
context?.let {
|
ThreadUtils.runOnUiThread {
|
||||||
DispatchDialogManager.getInstance(it).showDialog(msgData)
|
context?.let {
|
||||||
|
DispatchDialogManager.getInstance(it).showDialog(msgData)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun dismissDispatchDialog() {
|
override fun dismissDispatchDialog() {
|
||||||
context?.let {
|
ThreadUtils.runOnUiThread {
|
||||||
DispatchDialogManager.getInstance(it).releaseDialog()
|
context?.let {
|
||||||
|
DispatchDialogManager.getInstance(it).releaseDialog()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun showNoticeForTrafficWithData(trafficStylePushData: NoticeTrafficStylePushData?) {
|
override fun showNoticeForTrafficWithData(pushData: NoticeTrafficStylePushData?) {
|
||||||
trafficStylePushData?.let {
|
pushData?.let {
|
||||||
ThreadUtils.runOnUiThread {
|
ThreadUtils.runOnUiThread {
|
||||||
context?.let { it ->
|
context?.let { it ->
|
||||||
NoticeTrafficDialog.show(it, trafficStylePushData)
|
NoticeTrafficDialog.show(it, pushData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -289,15 +233,29 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun showToBindingcarDialog() {
|
override fun showToBindingCarDialog() {
|
||||||
if (ContextHolderUtil.getContext() != null) {
|
if (context != null) {
|
||||||
ToBindingCarDialog.show(ContextHolderUtil.getContext())
|
ToBindingCarDialog.show(context)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun showModifyBindingcarDialog() {
|
override fun showModifyBindingCarDialog() {
|
||||||
if (ContextHolderUtil.getContext() != null) {
|
if (context != null) {
|
||||||
ModifyBindingCarDialog.show(ContextHolderUtil.getContext())
|
ModifyBindingCarDialog.show(context)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun showIPCReportWindow(
|
||||||
|
errorReportList: ArrayList<ReportEntity>,
|
||||||
|
warningReportList: ArrayList<ReportEntity>,
|
||||||
|
reportLevel: Int
|
||||||
|
) {
|
||||||
|
ThreadUtils.runOnUiThread {
|
||||||
|
context?.let {
|
||||||
|
if (reportLevel == 1) {
|
||||||
|
IPCReportWindow.show(it, errorReportList, warningReportList, reportLevel)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -308,18 +266,17 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
|||||||
content: String,
|
content: String,
|
||||||
installType: String
|
installType: String
|
||||||
) {
|
) {
|
||||||
if (ContextHolderUtil.getContext() != null) {
|
if (context != null) {
|
||||||
UpgradeAppDialog.show(
|
UpgradeAppDialog.show(
|
||||||
ContextHolderUtil.getContext(),
|
context, name, url, title, content, installType
|
||||||
name, url, title, content, installType
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun showAdUpgradeDialog(images: List<String>, padSn: String, releaseId: String) {
|
override fun showAdUpgradeDialog(images: List<String>, padSn: String, releaseId: String) {
|
||||||
ThreadUtils.runOnUiThread {
|
ThreadUtils.runOnUiThread {
|
||||||
if (ContextHolderUtil.getContext() != null) {
|
if (context != null) {
|
||||||
AdUpgradeDialog.show(ContextHolderUtil.getContext(), images, padSn, releaseId)
|
AdUpgradeDialog.show(context, images, padSn, releaseId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -330,47 +287,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()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,6 @@ import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsFuncConfigList
|
|||||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
||||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
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.hmi.CallerHmiManager
|
||||||
import com.mogo.eagle.core.function.call.map.CallerHDMapManager
|
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager
|
import com.mogo.eagle.core.function.call.map.CallerSmpManager
|
||||||
import com.mogo.eagle.core.function.call.obu.CallerObuApiManager
|
import com.mogo.eagle.core.function.call.obu.CallerObuApiManager
|
||||||
@@ -524,10 +523,10 @@ internal class DebugSettingView @JvmOverloads constructor(
|
|||||||
tbChangeCurrentCarIcon.setOnCheckedChangeListener { _, isChecked ->
|
tbChangeCurrentCarIcon.setOnCheckedChangeListener { _, isChecked ->
|
||||||
if (!isChecked) {
|
if (!isChecked) {
|
||||||
// 替换为出租车图标
|
// 替换为出租车图标
|
||||||
CallerHDMapManager.changeCurrentIcon(R.raw.chuzuche)
|
CallerMapUIServiceManager.getMapUIController()?.changeCurrentIcon(R.raw.chuzuche)
|
||||||
} else {
|
} else {
|
||||||
// 替换为小巴车图标
|
// 替换为小巴车图标
|
||||||
CallerHDMapManager.changeCurrentIcon(R.raw.xiaobache)
|
CallerMapUIServiceManager.getMapUIController()?.changeCurrentIcon(R.raw.xiaobache)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -741,7 +740,9 @@ internal class DebugSettingView @JvmOverloads constructor(
|
|||||||
tbDrawPointCloudData.isChecked = FunctionBuildConfig.isDrawPointCloudData
|
tbDrawPointCloudData.isChecked = FunctionBuildConfig.isDrawPointCloudData
|
||||||
//是否渲染点云数据
|
//是否渲染点云数据
|
||||||
tbDrawPointCloudData.setOnCheckedChangeListener { _, isChecked ->
|
tbDrawPointCloudData.setOnCheckedChangeListener { _, isChecked ->
|
||||||
CallerHDMapManager.setIsDrawPointCloud(isChecked)
|
CallerAutoPilotControlManager.setIsDrawPointCloud(isChecked)
|
||||||
|
FunctionBuildConfig.isDrawPointCloudData = isChecked
|
||||||
|
CallerMapUIServiceManager.getMapUIController()?.setIsDrawPointCloud(isChecked)
|
||||||
}
|
}
|
||||||
|
|
||||||
//设置点云大小
|
//设置点云大小
|
||||||
@@ -752,7 +753,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
|||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
val cloudSizeFloat = cloudSize.toFloat()
|
val cloudSizeFloat = cloudSize.toFloat()
|
||||||
CallerHDMapManager.setPointCloudSize(cloudSizeFloat)
|
CallerMapUIServiceManager.getMapUIController()?.setPointCloudSize(cloudSizeFloat)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
ToastUtils.showShort("点云大小格式输入不正确")
|
ToastUtils.showShort("点云大小格式输入不正确")
|
||||||
}
|
}
|
||||||
@@ -765,7 +766,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
|||||||
ToastUtils.showShort("请输入正确的点云颜色")
|
ToastUtils.showShort("请输入正确的点云颜色")
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
CallerHDMapManager.setPointCloudColor(cloudColor)
|
CallerMapUIServiceManager.getMapUIController()?.setPointCloudColor(cloudColor)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
ToastUtils.showShort("点云大小颜色输入不正确")
|
ToastUtils.showShort("点云大小颜色输入不正确")
|
||||||
}
|
}
|
||||||
@@ -1053,33 +1054,23 @@ internal class DebugSettingView @JvmOverloads constructor(
|
|||||||
* sn绑定控制
|
* sn绑定控制
|
||||||
*/
|
*/
|
||||||
tbOpenSnBinding.setOnCheckedChangeListener { _, isChecked ->
|
tbOpenSnBinding.setOnCheckedChangeListener { _, isChecked ->
|
||||||
if (!isChecked) {
|
HmiBuildConfig.isShowSnBindingView = !isChecked
|
||||||
CallerHmiManager.setSnBinding(true)
|
|
||||||
} else {
|
|
||||||
CallerHmiManager.setSnBinding(false)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* obu弱势交通控制
|
* obu弱势交通控制
|
||||||
*/
|
*/
|
||||||
tbObuWeaknessTraffic.setOnCheckedChangeListener { _, isChecked ->
|
tbObuWeaknessTraffic.setOnCheckedChangeListener { _, isChecked ->
|
||||||
if (!isChecked) { //默认开启
|
// 默认开启
|
||||||
CallerHmiManager.setObuWeaknessTraffic(true)
|
HmiBuildConfig.isShowObuWeaknessTrafficView = !isChecked
|
||||||
} else {
|
|
||||||
CallerHmiManager.setObuWeaknessTraffic(false)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 云端弱势交通控制
|
* 云端弱势交通控制
|
||||||
*/
|
*/
|
||||||
tbCloudWeaknessTraffic.setOnCheckedChangeListener { _, isChecked ->
|
tbCloudWeaknessTraffic.setOnCheckedChangeListener { _, isChecked ->
|
||||||
if (isChecked) { //默认关闭
|
// 默认关闭
|
||||||
CallerHmiManager.setCloudWeaknessTraffic(true)
|
HmiBuildConfig.isShowObuWeaknessTrafficView = isChecked
|
||||||
} else {
|
|
||||||
CallerHmiManager.setCloudWeaknessTraffic(false)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1225,7 +1216,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
|||||||
* 设置是否输出高精地图日志 true-打印日志,false-不打印日志
|
* 设置是否输出高精地图日志 true-打印日志,false-不打印日志
|
||||||
*/
|
*/
|
||||||
tbHdMapLog.setOnCheckedChangeListener { _, isChecked ->
|
tbHdMapLog.setOnCheckedChangeListener { _, isChecked ->
|
||||||
CallerHDMapManager.setDebugMode(isChecked)
|
CallerMapUIServiceManager.getMapUIController()?.setDebugMode(isChecked)
|
||||||
}
|
}
|
||||||
|
|
||||||
cbTraceLog.isChecked = CallerDevaToolsManager.getTraceLogStatus()
|
cbTraceLog.isChecked = CallerDevaToolsManager.getTraceLogStatus()
|
||||||
|
|||||||
@@ -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.utilcode.util.ToastUtils
|
||||||
import com.mogo.eagle.core.function.business.routeoverlay.RouteStrategy
|
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.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.function.hmi.ui.widget.DemoModeView
|
||||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||||
import kotlinx.android.synthetic.main.view_sop_setting.view.*
|
import kotlinx.android.synthetic.main.view_sop_setting.view.*
|
||||||
@@ -81,11 +81,8 @@ internal class SOPSettingView @JvmOverloads constructor(
|
|||||||
*/
|
*/
|
||||||
tbObuWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowObuWeaknessTrafficView
|
tbObuWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowObuWeaknessTrafficView
|
||||||
tbObuWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
|
tbObuWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
|
||||||
if (!isChecked) { //默认开启
|
// 默认开启
|
||||||
CallerHmiManager.setObuWeaknessTraffic(true)
|
HmiBuildConfig.isShowObuWeaknessTrafficView = !isChecked
|
||||||
} else {
|
|
||||||
CallerHmiManager.setObuWeaknessTraffic(false)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -93,18 +90,15 @@ internal class SOPSettingView @JvmOverloads constructor(
|
|||||||
*/
|
*/
|
||||||
tbCloudWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowCloudWeaknessTrafficView
|
tbCloudWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowCloudWeaknessTrafficView
|
||||||
tbCloudWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
|
tbCloudWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
|
||||||
if (isChecked) { //默认关闭
|
// 默认关闭
|
||||||
CallerHmiManager.setCloudWeaknessTraffic(true)
|
HmiBuildConfig.isShowCloudWeaknessTrafficView = isChecked
|
||||||
} else {
|
|
||||||
CallerHmiManager.setCloudWeaknessTraffic(false)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 限速数据来源开关
|
* 限速数据来源开关
|
||||||
*/
|
*/
|
||||||
tbRoadLimitSpeedSop.setOnCheckedChangeListener { _, isChecked ->
|
tbRoadLimitSpeedSop.setOnCheckedChangeListener { _, isChecked ->
|
||||||
//默认关闭
|
// 默认关闭
|
||||||
HmiBuildConfig.isShowObuLimitSpeedView = isChecked
|
HmiBuildConfig.isShowObuLimitSpeedView = isChecked
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,7 +106,7 @@ internal class SOPSettingView @JvmOverloads constructor(
|
|||||||
* obu V2V开关
|
* obu V2V开关
|
||||||
*/
|
*/
|
||||||
tbObuV2vView.setOnCheckedChangeListener { _, isChecked ->
|
tbObuV2vView.setOnCheckedChangeListener { _, isChecked ->
|
||||||
//默认关闭
|
// 默认关闭
|
||||||
HmiBuildConfig.isShowObuV2vView = isChecked
|
HmiBuildConfig.isShowObuV2vView = isChecked
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +114,7 @@ internal class SOPSettingView @JvmOverloads constructor(
|
|||||||
* obu V2i开关
|
* obu V2i开关
|
||||||
*/
|
*/
|
||||||
tbObuV2iView.setOnCheckedChangeListener { _, isChecked ->
|
tbObuV2iView.setOnCheckedChangeListener { _, isChecked ->
|
||||||
//默认关闭
|
// 默认关闭
|
||||||
HmiBuildConfig.isShowObuV2iView = isChecked
|
HmiBuildConfig.isShowObuV2iView = isChecked
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,7 +122,7 @@ internal class SOPSettingView @JvmOverloads constructor(
|
|||||||
* obu 数据通过dc 传输V2i事件 开关 TODO pm确定下开关功能 HmiBuildConfig.isShowObuToDcV2iView
|
* obu 数据通过dc 传输V2i事件 开关 TODO pm确定下开关功能 HmiBuildConfig.isShowObuToDcV2iView
|
||||||
*/
|
*/
|
||||||
tbObuToDcView.setOnCheckedChangeListener { _, isChecked ->
|
tbObuToDcView.setOnCheckedChangeListener { _, isChecked ->
|
||||||
//默认开启
|
// 默认开启
|
||||||
HmiBuildConfig.isShowObuToDcV2iView = !isChecked
|
HmiBuildConfig.isShowObuToDcV2iView = !isChecked
|
||||||
// Log.d("liyz", "HmiBuildConfig.isShowObuToDcV2iView = " + HmiBuildConfig.isShowObuToDcV2iView)
|
// Log.d("liyz", "HmiBuildConfig.isShowObuToDcV2iView = " + HmiBuildConfig.isShowObuToDcV2iView)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.IMoGoAutopilotPlanningActionsListener
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
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.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.CallerAutoPilotStatusListenerManager
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager
|
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.function.hmi.R
|
||||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||||
import com.zhjt.service_biz.BizConfig
|
import com.zhjt.service_biz.BizConfig
|
||||||
|
|||||||
@@ -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.hmi.view.IViewControlListener.Companion.LimitingVelocityView_TAG
|
||||||
import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
|
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.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 com.mogo.eagle.core.function.hmi.R
|
||||||
import kotlinx.android.synthetic.main.view_limiting_speed_vr.view.*
|
import kotlinx.android.synthetic.main.view_limiting_speed_vr.view.*
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ class LimitingVelocityView constructor(
|
|||||||
|
|
||||||
override fun onAttachedToWindow() {
|
override fun onAttachedToWindow() {
|
||||||
super.onAttachedToWindow()
|
super.onAttachedToWindow()
|
||||||
CallerViewLimitingVelocityListenerManager.addListener(TAG, this)
|
CallerLimitingVelocityListenerManager.addListener(TAG, this)
|
||||||
CallerHmiViewControlListenerManager.addListener(LimitingVelocityView_TAG, this)
|
CallerHmiViewControlListenerManager.addListener(LimitingVelocityView_TAG, this)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ class LimitingVelocityView constructor(
|
|||||||
|
|
||||||
override fun onDetachedFromWindow() {
|
override fun onDetachedFromWindow() {
|
||||||
super.onDetachedFromWindow()
|
super.onDetachedFromWindow()
|
||||||
CallerViewLimitingVelocityListenerManager.removeListener(TAG)
|
CallerLimitingVelocityListenerManager.removeListener(TAG)
|
||||||
CallerHmiViewControlListenerManager.removeListener(LimitingVelocityView_TAG)
|
CallerHmiViewControlListenerManager.removeListener(LimitingVelocityView_TAG)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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.data.enums.TrafficLightEnum
|
||||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
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.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.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.function.hmi.R
|
||||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||||
|
|
||||||
|
import android.animation.Animator
|
||||||
|
import android.animation.Animator.AnimatorListener
|
||||||
|
import android.animation.AnimatorSet
|
||||||
|
import android.animation.ObjectAnimator
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
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) :
|
||||||
|
ConstraintLayout(context, attrs), 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
|
||||||
|
animatorSet.addListener(object : AnimatorListener{
|
||||||
|
override fun onAnimationStart(animation: Animator?) {
|
||||||
|
visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onAnimationEnd(animation: Animator?) {
|
||||||
|
visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onAnimationCancel(animation: Animator?) {
|
||||||
|
visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onAnimationRepeat(animation: Animator?) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -8,26 +8,26 @@ import android.view.animation.AlphaAnimation
|
|||||||
import android.view.animation.Animation
|
import android.view.animation.Animation
|
||||||
import android.view.animation.LinearInterpolator
|
import android.view.animation.LinearInterpolator
|
||||||
import android.widget.RelativeLayout
|
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.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.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 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(
|
class V2XWarningView @JvmOverloads constructor(
|
||||||
context: Context,
|
context: Context,
|
||||||
attrs: AttributeSet? = null,
|
attrs: AttributeSet? = null,
|
||||||
defStyleAttr: Int = 0
|
defStyleAttr: Int = 0
|
||||||
) : RelativeLayout(context, attrs, defStyleAttr) {
|
) : RelativeLayout(context, attrs, defStyleAttr), IV2XEventListener {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val ALL_CLOSE_TIMER = 10000L
|
private const val ALL_CLOSE_TIMER = 5000L
|
||||||
private const val TAG = "V2XWarningView"
|
private const val TAG = "V2XWarningView"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,24 +36,43 @@ class V2XWarningView @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
init {
|
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
|
* @param direction
|
||||||
* @see WarningDirectionEnum
|
* @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 {
|
UiThreadHandler.post {
|
||||||
// 如果传入的不是关闭显示,则设置倒计时,定时关闭红框警示
|
// 如果传入的不是关闭显示,则设置倒计时,定时关闭红框警示
|
||||||
if (direction != ALERT_WARNING_NON) {
|
if (direction != ALERT_WARNING_NON) {
|
||||||
removeCallbacks(closeWarningTask)
|
removeCallbacks(closeWarningTask)
|
||||||
postDelayed(closeWarningTask, closeTime)
|
postDelayed(closeWarningTask, time)
|
||||||
}
|
}
|
||||||
when (direction) {
|
when (direction) {
|
||||||
ALERT_WARNING_NON ->{
|
ALERT_WARNING_NON -> {
|
||||||
// nothing
|
// nothing
|
||||||
}
|
}
|
||||||
ALERT_WARNING_TOP -> {
|
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) {
|
if (direction == ALERT_WARNING_NON) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -202,4 +221,10 @@ class V2XWarningView @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
clearAnimation()
|
clearAnimation()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onDetachedFromWindow() {
|
||||||
|
super.onDetachedFromWindow()
|
||||||
|
CallerV2XWarningListenerManager.removeListener(TAG)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -5,8 +5,8 @@ import android.util.AttributeSet
|
|||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
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.vip.CallVipSetListenerManager
|
import com.mogo.eagle.core.function.call.v2x.CallVipSetListenerManager
|
||||||
import com.mogo.eagle.core.function.hmi.R
|
import com.mogo.eagle.core.function.hmi.R
|
||||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||||
|
|
||||||
|
|||||||
@@ -1,484 +0,0 @@
|
|||||||
package com.mogo.eagle.core.function.main;
|
|
||||||
|
|
||||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_ALIAS_CODE_RECORD_NATIVE_LEAK;
|
|
||||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_LEAK;
|
|
||||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_LOG_NATIVE_LEAK;
|
|
||||||
import static com.mogo.eagle.core.function.main.MainPresenter.MOGO_PERMISSION_REQUEST_CODE;
|
|
||||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
|
||||||
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.provider.Settings;
|
|
||||||
import android.view.Gravity;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.FrameLayout;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
|
||||||
import androidx.fragment.app.Fragment;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
|
|
||||||
import com.alibaba.android.arouter.launcher.ARouter;
|
|
||||||
import com.kwai.koom.base.MonitorManager;
|
|
||||||
import com.kwai.koom.nativeoom.leakmonitor.LeakMonitor;
|
|
||||||
import com.kwai.koom.nativeoom.leakmonitor.LeakMonitorConfig;
|
|
||||||
import com.kwai.koom.nativeoom.leakmonitor.LeakRecord;
|
|
||||||
import com.mogo.commons.analytics.AnalyticsUtils;
|
|
||||||
import com.mogo.commons.context.ContextHolderUtil;
|
|
||||||
import com.mogo.commons.debug.DebugConfig;
|
|
||||||
import com.mogo.commons.module.status.MogoStatusManager;
|
|
||||||
import com.mogo.commons.mvp.BaseFragment;
|
|
||||||
import com.mogo.commons.mvp.MvpActivity;
|
|
||||||
import com.mogo.commons.mvp.MvpFragment;
|
|
||||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
|
||||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig;
|
|
||||||
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.map.CallerMapUIServiceManager;
|
|
||||||
import com.mogo.eagle.core.function.call.startup.CallerStartUpManager;
|
|
||||||
import com.mogo.eagle.core.function.hmi.R;
|
|
||||||
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView;
|
|
||||||
import com.mogo.eagle.core.function.main.modules.MogoModulesManager;
|
|
||||||
import com.mogo.eagle.core.function.main.windowview.FloatingViewHandler;
|
|
||||||
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils;
|
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
|
||||||
import com.mogo.eagle.core.utilcode.mogo.permissions.PermissionsDialogUtils;
|
|
||||||
import com.mogo.eagle.core.utilcode.mogo.toast.ResourcesHelper;
|
|
||||||
import com.mogo.eagle.core.utilcode.util.BarUtils;
|
|
||||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
|
||||||
import com.mogo.eagle.core.utilcode.util.ProcessUtils;
|
|
||||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
|
||||||
import com.mogo.map.listener.IMogoMapListener;
|
|
||||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
|
||||||
import com.mogo.map.uicontroller.EnumMapUI;
|
|
||||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
|
||||||
import com.rousetime.android_startup.StartupManager;
|
|
||||||
import com.rousetime.android_startup.model.LoggerLevel;
|
|
||||||
import com.rousetime.android_startup.model.StartupConfig;
|
|
||||||
import com.zhjt.mogo_core_function_devatools.monitor.db.CpuInfo;
|
|
||||||
import com.zhjt.mogo_core_function_devatools.monitor.db.MemInfo;
|
|
||||||
import com.zhjt.mogo_core_function_devatools.monitor.db.MonitorDb;
|
|
||||||
import com.zhjt.service.chain.ChainLog;
|
|
||||||
import com.zhjt.service.chain.TracingConstants;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import mogo.telematics.pad.MessagePad;
|
|
||||||
import mogo_msg.MogoReportMsg;
|
|
||||||
import system_master.SystemStatusInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author congtaowang
|
|
||||||
* @since 2019-12-23
|
|
||||||
* <p>
|
|
||||||
* 描述:加载各个模块
|
|
||||||
*/
|
|
||||||
public class MainActivity extends MvpActivity<MainView, MainPresenter> implements MainView,
|
|
||||||
IMoGoAutopilotStatusListener {
|
|
||||||
|
|
||||||
protected static final String TAG = "MainActivity";
|
|
||||||
private static final int REQUEST_CODE_DIALOG = 100;
|
|
||||||
|
|
||||||
protected FrameLayout mFloatingLayout;
|
|
||||||
protected View mCoverUpLayout;
|
|
||||||
|
|
||||||
protected ConstraintLayout clSpecialEffect;
|
|
||||||
|
|
||||||
private boolean isFirst = false;
|
|
||||||
|
|
||||||
private RecyclerView mConnectInfoRV;
|
|
||||||
private ConnInfoAdapter mConnAdapter;
|
|
||||||
private final List<AutopilotStatusInfo> dataList = new ArrayList<>();
|
|
||||||
private int mLastStatus = 0x00;
|
|
||||||
private boolean isFloatingLayerHidden = false;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected int getLayoutId() {
|
|
||||||
return R.layout.module_main_activity_main;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void initViews() {
|
|
||||||
injectStatusBar();
|
|
||||||
getWindow().setBackgroundDrawable(null);
|
|
||||||
|
|
||||||
mFloatingLayout = findViewById(R.id.module_main_id_floating_view);
|
|
||||||
mCoverUpLayout = findViewById(R.id.module_main_id_cover_up);
|
|
||||||
|
|
||||||
clSpecialEffect = findViewById(R.id.cl_special_effect);
|
|
||||||
mConnectInfoRV = findViewById(R.id.rvConnectInfo);
|
|
||||||
initConnectInfoRV();
|
|
||||||
FloatingViewHandler.init(mFloatingLayout);
|
|
||||||
|
|
||||||
//申请悬浮窗权限
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
||||||
// 检查是否有悬浮窗权限
|
|
||||||
if (Settings.canDrawOverlays(this)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
PermissionsDialogUtils.openAppDetails(this, "显示悬浮窗", REQUEST_CODE_DIALOG);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void injectStatusBar() {
|
|
||||||
FrameLayout decorView = (FrameLayout) this.getWindow().getDecorView();
|
|
||||||
View contentView = ((ViewGroup) decorView.findViewById(android.R.id.content)).getChildAt(0);
|
|
||||||
contentView.setFitsSystemWindows(false);
|
|
||||||
decorView.setClipToPadding(false);
|
|
||||||
|
|
||||||
View statusBarView = decorView.findViewWithTag("status_bar");
|
|
||||||
if (statusBarView == null) {
|
|
||||||
statusBarView = getStatusBarView();
|
|
||||||
statusBarView.setTag("status_bar");
|
|
||||||
}
|
|
||||||
FrameLayout.LayoutParams statusBarLP =
|
|
||||||
new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, BarUtils.getStatusBarHeight());
|
|
||||||
statusBarLP.topMargin = 0;
|
|
||||||
statusBarLP.gravity = Gravity.TOP;
|
|
||||||
decorView.addView(statusBarView, statusBarLP);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改statusBar 重写实现,需要继承 StatusBarView,xml中基础系统控件不要修改其id,拿来即用
|
|
||||||
* @return StatusBarView
|
|
||||||
*/
|
|
||||||
protected StatusBarView getStatusBarView(){
|
|
||||||
return new StatusBarView(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
calculateStartTime();
|
|
||||||
ContextHolderUtil.holdContext(this);
|
|
||||||
// 监听工控机连接信息
|
|
||||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
|
|
||||||
CallerStartUpManager.initStageTwo();
|
|
||||||
// 加载模块
|
|
||||||
mPresenter.postLoadModuleMsg();
|
|
||||||
// 监听网络状态
|
|
||||||
NetworkUtils.listenNetStrength(this);
|
|
||||||
// 浓雾预警
|
|
||||||
DisplayEffectsHelper.getInstance().init(clSpecialEffect);
|
|
||||||
|
|
||||||
mPresenter.checkPermission(this);
|
|
||||||
|
|
||||||
// 同步AppInfo Config信息
|
|
||||||
CallerDevaToolsManager.INSTANCE.syncConfig();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void calculateStartTime() {
|
|
||||||
long coldStartTime = AppLaunchTimeUtils.getTimeCalculate(AppLaunchTimeUtils.COLD_START);
|
|
||||||
// 这里记录的TimeUtils.coldStartTime是指Application启动的时间,最终的冷启动时间等于Application启动时间+热启动时间
|
|
||||||
AppLaunchTimeUtils.sColdStartTime = coldStartTime > 0 ? coldStartTime : 0;
|
|
||||||
AppLaunchTimeUtils.beginTimeCalculate(AppLaunchTimeUtils.HOT_START);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onWindowFocusChanged(boolean hasFocus) {
|
|
||||||
super.onWindowFocusChanged(hasFocus);
|
|
||||||
if (hasFocus) {
|
|
||||||
// 统计代码
|
|
||||||
final Map<String, Object> properties = new HashMap<>();
|
|
||||||
long hotStartTime = AppLaunchTimeUtils.getTimeCalculate(AppLaunchTimeUtils.HOT_START);
|
|
||||||
if (AppLaunchTimeUtils.sColdStartTime > 0 && hotStartTime > 0) {
|
|
||||||
// 真正的冷启动时间 = Application启动时间 + 热启动时间
|
|
||||||
long coldStartTime = AppLaunchTimeUtils.sColdStartTime + hotStartTime;
|
|
||||||
// 过滤掉异常启动时间
|
|
||||||
if (coldStartTime < 50000) {
|
|
||||||
// 上传冷启动时间coldStartTime
|
|
||||||
CallerLogger.INSTANCE.i(M_HMI + TAG, "coldStartTime:" + coldStartTime);
|
|
||||||
properties.put("app_launch_coldStartTime", coldStartTime);
|
|
||||||
}
|
|
||||||
} else if (hotStartTime > 0) {
|
|
||||||
// 过滤掉异常启动时间
|
|
||||||
if (hotStartTime < 30000) {
|
|
||||||
// 上传热启动时间hotStartTime
|
|
||||||
CallerLogger.INSTANCE.i(M_HMI + TAG, "hotStartTime:" + hotStartTime);
|
|
||||||
properties.put("app_launch_hotStartTime", hotStartTime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnalyticsUtils.track("app_launch_time", properties);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initConnectInfoRV() {
|
|
||||||
mConnAdapter = new ConnInfoAdapter(this, dataList);
|
|
||||||
mConnectInfoRV.setLayoutManager(new LinearLayoutManager(this));
|
|
||||||
mConnectInfoRV.setAdapter(mConnAdapter);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void loadModules() {
|
|
||||||
final long start = System.currentTimeMillis();
|
|
||||||
MogoModulesManager.getInstance().init(this);
|
|
||||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().registerHostMapListener(TAG, new IMogoMapListener() {
|
|
||||||
@Override
|
|
||||||
public void onMapLoaded() {
|
|
||||||
// 延时加载其他模块
|
|
||||||
getWindow().getDecorView().post(() -> {
|
|
||||||
HdMapBuildConfig.isMapLoaded = true;
|
|
||||||
loadOthersModules();
|
|
||||||
loadFunctionFragment();
|
|
||||||
|
|
||||||
// TODO 这里临时兼容进入VR模式,标记状态机。有些业务(OCH)会根据状态判断加载
|
|
||||||
MogoStatusManager.getInstance().setVrMode(TAG, true);
|
|
||||||
// 设置地图样式
|
|
||||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onMapModeChanged(EnumMapUI.MAP_STYLE_DAY_VR);
|
|
||||||
});
|
|
||||||
CallerLogger.INSTANCE.i(M_HMI + TAG, "App launch timer cost " + (System.currentTimeMillis() - start) + "ms");
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// 加载地图
|
|
||||||
loadFunctionMapView();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 加载其它模块
|
|
||||||
*/
|
|
||||||
protected void loadOthersModules() {
|
|
||||||
// 加载地图,触发地图加载完毕回调,在初始化其他卡片模块,保证卡片模块可以正确获取地图相关服务。
|
|
||||||
MogoModulesManager.getInstance().loadFunctionModules();
|
|
||||||
mPresenter.delayOperations();
|
|
||||||
MogoModulesManager.getInstance().loadFunctionModulesServer();
|
|
||||||
UiThreadHandler.postDelayed(() -> {
|
|
||||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "5秒已过,启动基础服务……");
|
|
||||||
MogoModulesManager.getInstance().loadBaseModule();
|
|
||||||
}, 5_000L);
|
|
||||||
if (DebugConfig.isDebug()) {
|
|
||||||
// 启动Native内存泄漏监测
|
|
||||||
startLeakMonitor();
|
|
||||||
}
|
|
||||||
checkMonitorDb();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void startLeakMonitor() {
|
|
||||||
LeakMonitorConfig leakMonitorConfig = new LeakMonitorConfig.Builder()
|
|
||||||
.setLoopInterval(50000)
|
|
||||||
.setMonitorThreshold(16)
|
|
||||||
.setNativeHeapAllocatedThreshold(0)
|
|
||||||
.setSelectedSoList(new String[]{"libhdmap", "libmap",
|
|
||||||
"libAMapSDK_NAVI_v8_0_1", "libZegoExpressEngine",
|
|
||||||
"libcntts"
|
|
||||||
})
|
|
||||||
.setEnableLocalSymbolic(DebugConfig.isDebug())
|
|
||||||
.setLeakListener(leaks -> {
|
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
|
||||||
if (!leaks.isEmpty()) {
|
|
||||||
for (LeakRecord leakRecord : leaks) {
|
|
||||||
stringBuilder.append(leakRecord.toString());
|
|
||||||
}
|
|
||||||
printLeakMsg(stringBuilder.toString());
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.build();
|
|
||||||
MonitorManager.addMonitorConfig(leakMonitorConfig);
|
|
||||||
LeakMonitor.INSTANCE.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void checkMonitorDb() {
|
|
||||||
new Thread(() -> {
|
|
||||||
long limitId = 50001;
|
|
||||||
File file = this.getDatabasePath(MonitorDb.INTERNAL_DB_NAME);
|
|
||||||
try {
|
|
||||||
if (file != null && file.exists()) {
|
|
||||||
List<CpuInfo> cpuList = MonitorDb.getDb(this).monitorDao().getAllCPUById(limitId);
|
|
||||||
List<MemInfo> memList = MonitorDb.getDb(this).monitorDao().getAllMemById(limitId);
|
|
||||||
// 大于5w条清除
|
|
||||||
if (cpuList.size() > 0 || memList.size() > 0) {
|
|
||||||
this.deleteDatabase(MonitorDb.INTERNAL_DB_NAME);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
CallerLogger.INSTANCE.e(TAG, e.getMessage());
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
@ChainLog(
|
|
||||||
linkChainLog = CHAIN_LINK_LOG_NATIVE_LEAK,
|
|
||||||
linkCode = CHAIN_LINK_LEAK,
|
|
||||||
endpoint = TracingConstants.Endpoint.PAD,
|
|
||||||
nodeAliasCode = CHAIN_ALIAS_CODE_RECORD_NATIVE_LEAK,
|
|
||||||
paramIndexes = {0},
|
|
||||||
clientPkFileName = "sn"
|
|
||||||
)
|
|
||||||
private void printLeakMsg(String leakRecord) {
|
|
||||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "内存泄漏日志如下:\n" + leakRecord);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void hideCoverUpLayout() {
|
|
||||||
mConnectInfoRV.setVisibility(View.GONE);
|
|
||||||
getWindow().setBackgroundDrawable(null);
|
|
||||||
mCoverUpLayout.setVisibility(View.GONE);
|
|
||||||
isFloatingLayerHidden = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@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);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 加载地图视图
|
|
||||||
*/
|
|
||||||
private void loadFunctionMapView() {
|
|
||||||
MvpFragment fragmentHdMap = (MvpFragment) ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_MAP).navigation();
|
|
||||||
if (fragmentHdMap != null) {
|
|
||||||
addFragment(fragmentHdMap, fragmentHdMap.getTagName(), R.id.module_main_id_map_fragment_container);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
@Override
|
|
||||||
protected MainPresenter createPresenter() {
|
|
||||||
return new MainPresenter(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
MogoStatusManager.getInstance().setMainPageResumeStatus(TAG, true);
|
|
||||||
MogoStatusManager.getInstance().setMainPageIsBackgroundStatus(TAG, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPause() {
|
|
||||||
super.onPause();
|
|
||||||
MogoStatusManager.getInstance().setMainPageResumeStatus(TAG, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onStop() {
|
|
||||||
super.onStop();
|
|
||||||
MogoStatusManager.getInstance().setMainPageIsBackgroundStatus(TAG, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAutopilotStatusResponse(@NonNull AutopilotStatusInfo autoPilotStatusInfo) {
|
|
||||||
int status = autoPilotStatusInfo.getIpcConnStatus();
|
|
||||||
if (mLastStatus != status) {
|
|
||||||
AutopilotStatusInfo statusInfo = autoPilotStatusInfo.clone();
|
|
||||||
mConnectInfoRV.post(() -> updateConnectInfoView(statusInfo));
|
|
||||||
mLastStatus = status;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAutopilotArriveAtStation(@Nullable MessagePad.ArrivalNotification arrivalNotification) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAutopilotIpcConnectStatusChanged(int status, @Nullable String reason) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAutopilotSNRequest() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateConnectInfoView(@NonNull AutopilotStatusInfo autoPilotStatusInfo) {
|
|
||||||
if (!isFloatingLayerHidden) {// 遮罩层显示的时候
|
|
||||||
mConnAdapter.updateData(autoPilotStatusInfo);
|
|
||||||
mConnectInfoRV.scrollToPosition(mConnAdapter.getItemCount() - 1);
|
|
||||||
mLastStatus = autoPilotStatusInfo.getIpcConnStatus();
|
|
||||||
} else {// 遮罩层隐藏的时候
|
|
||||||
CallerAutoPilotStatusListenerManager.INSTANCE.removeListener(TAG);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
CallerAutoPilotStatusListenerManager.INSTANCE.removeListener(TAG);
|
|
||||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().unregisterHostMapListener(TAG);
|
|
||||||
IMogoMapUIController mapUIController = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
|
||||||
if (mapUIController != null) {
|
|
||||||
mapUIController.destroy();
|
|
||||||
}
|
|
||||||
MogoStatusManager.getInstance().setMainPageIsBackgroundStatus(TAG, false);
|
|
||||||
|
|
||||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "destroy.");
|
|
||||||
ContextHolderUtil.releaseContext();
|
|
||||||
MogoModulesManager.getInstance().onDestroy();
|
|
||||||
FloatingViewHandler.clear();
|
|
||||||
ProcessUtils.killAllBackgroundProcesses();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
|
||||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
|
||||||
if (requestCode == MOGO_PERMISSION_REQUEST_CODE) {
|
|
||||||
boolean isAllGranted = true;
|
|
||||||
// 判断是否所有的权限都已经授予了
|
|
||||||
for (int grant : grantResults) {
|
|
||||||
if (grant != PackageManager.PERMISSION_GRANTED) {
|
|
||||||
isAllGranted = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isAllGranted) {
|
|
||||||
isFirst = false;
|
|
||||||
} else {
|
|
||||||
// 弹出对话框告诉用户需要权限的原因, 并引导用户去应用权限管理中手动打开权限按钮
|
|
||||||
if (!isFirst) {
|
|
||||||
PermissionsDialogUtils.openAppDetails(this, null, REQUEST_CODE_DIALOG);
|
|
||||||
isFirst = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 由于应用是单页面的,所以采用Fragment将各模块的UI进行分割解耦合
|
|
||||||
*
|
|
||||||
* @param newFragment 功能UI
|
|
||||||
* @param tagName UI绑定的Tag
|
|
||||||
* @param containerId 要加入的资源ID
|
|
||||||
*/
|
|
||||||
private void addFragment(Fragment newFragment, String tagName, int containerId) {
|
|
||||||
Fragment fragment = getSupportFragmentManager().findFragmentByTag(tagName);
|
|
||||||
if (fragment == null) {
|
|
||||||
fragment = newFragment;
|
|
||||||
}
|
|
||||||
if (fragment == null) {
|
|
||||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "add fragment fail cause fragment == null, container is " + ResourcesHelper.getResNameById(getApplicationContext(), containerId));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
getSupportFragmentManager().beginTransaction()
|
|
||||||
.replace(containerId, fragment, tagName)
|
|
||||||
.commitAllowingStateLoss();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPointerCaptureChanged(boolean hasCapture) {
|
|
||||||
super.onPointerCaptureChanged(hasCapture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,410 @@
|
|||||||
|
package com.mogo.eagle.core.function.main
|
||||||
|
|
||||||
|
import android.content.pm.PackageManager
|
||||||
|
import android.os.Build
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.provider.Settings
|
||||||
|
import android.view.Gravity
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import android.widget.FrameLayout
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import com.alibaba.android.arouter.launcher.ARouter
|
||||||
|
import com.kwai.koom.base.MonitorManager.addMonitorConfig
|
||||||
|
import com.kwai.koom.nativeoom.leakmonitor.LeakListener
|
||||||
|
import com.kwai.koom.nativeoom.leakmonitor.LeakMonitor.start
|
||||||
|
import com.kwai.koom.nativeoom.leakmonitor.LeakMonitorConfig
|
||||||
|
import com.kwai.koom.nativeoom.leakmonitor.LeakRecord
|
||||||
|
import com.mogo.commons.analytics.AnalyticsUtils
|
||||||
|
import com.mogo.commons.context.ContextHolderUtil
|
||||||
|
import com.mogo.commons.debug.DebugConfig
|
||||||
|
import com.mogo.commons.module.status.MogoStatusManager
|
||||||
|
import com.mogo.commons.mvp.BaseFragment
|
||||||
|
import com.mogo.commons.mvp.MvpActivity
|
||||||
|
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||||
|
import com.mogo.eagle.core.data.config.HdMapBuildConfig
|
||||||
|
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
|
||||||
|
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||||
|
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.getMapUIController
|
||||||
|
import com.mogo.eagle.core.function.call.startup.CallerStartUpManager.initStageTwo
|
||||||
|
import com.mogo.eagle.core.function.hmi.R
|
||||||
|
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
|
||||||
|
import com.mogo.eagle.core.function.main.modules.MogoModulesManager
|
||||||
|
import com.mogo.eagle.core.function.main.windowview.FloatingViewHandler
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.i
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.permissions.PermissionsDialogUtils
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.toast.ResourcesHelper
|
||||||
|
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||||
|
import com.mogo.eagle.core.utilcode.util.NetworkUtils
|
||||||
|
import com.mogo.eagle.core.utilcode.util.ProcessUtils
|
||||||
|
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||||
|
import com.mogo.map.listener.IMogoMapListener
|
||||||
|
import com.mogo.map.listener.MogoMapListenerHandler.Companion.mogoMapListenerHandler
|
||||||
|
import com.mogo.map.uicontroller.EnumMapUI
|
||||||
|
import com.zhjt.mogo_core_function_devatools.monitor.db.MonitorDb
|
||||||
|
import com.zhjt.mogo_core_function_devatools.monitor.db.MonitorDb.Companion.getDb
|
||||||
|
import com.zhjt.service.chain.ChainLog
|
||||||
|
import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD
|
||||||
|
import kotlinx.android.synthetic.main.module_main_activity_main.*
|
||||||
|
import mogo.telematics.pad.MessagePad
|
||||||
|
import mogo_msg.MogoReportMsg
|
||||||
|
import system_master.SystemStatusInfo
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author congtaowang
|
||||||
|
* @since 2019-12-23
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* 描述:加载各个模块
|
||||||
|
*/
|
||||||
|
open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||||
|
IMoGoAutopilotStatusListener {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
protected const val TAG = "MainActivity"
|
||||||
|
private const val REQUEST_CODE_DIALOG = 100
|
||||||
|
}
|
||||||
|
|
||||||
|
private var isFirst = false
|
||||||
|
private var mConnAdapter: ConnInfoAdapter? = null
|
||||||
|
private val dataList: List<AutopilotStatusInfo> = ArrayList()
|
||||||
|
private var mLastStatus = 0x00
|
||||||
|
private var isFloatingLayerHidden = false
|
||||||
|
|
||||||
|
override fun getLayoutId(): Int {
|
||||||
|
return R.layout.module_main_activity_main
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun initViews() {
|
||||||
|
injectStatusBar()
|
||||||
|
window.setBackgroundDrawable(null)
|
||||||
|
initConnectInfoRV()
|
||||||
|
FloatingViewHandler.init(module_main_id_floating_view)
|
||||||
|
CallerHmiManager.init(this)
|
||||||
|
|
||||||
|
//申请悬浮窗权限
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
// 检查是否有悬浮窗权限
|
||||||
|
if (Settings.canDrawOverlays(this)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
PermissionsDialogUtils.openAppDetails(this, "显示悬浮窗", REQUEST_CODE_DIALOG)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun injectStatusBar() {
|
||||||
|
val decorView = this.window.decorView as FrameLayout
|
||||||
|
val contentView =
|
||||||
|
(decorView.findViewById<View>(android.R.id.content) as ViewGroup).getChildAt(0)
|
||||||
|
contentView.fitsSystemWindows = false
|
||||||
|
decorView.clipToPadding = false
|
||||||
|
var statusBarView = decorView.findViewWithTag<View>("status_bar")
|
||||||
|
if (statusBarView == null) {
|
||||||
|
statusBarView = StatusBarView(this)
|
||||||
|
statusBarView.setTag("status_bar")
|
||||||
|
}
|
||||||
|
val statusBarLP = FrameLayout.LayoutParams(
|
||||||
|
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||||
|
BarUtils.getStatusBarHeight()
|
||||||
|
)
|
||||||
|
statusBarLP.topMargin = 0
|
||||||
|
statusBarLP.gravity = Gravity.TOP
|
||||||
|
decorView.addView(statusBarView, statusBarLP)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改statusBar 重写实现,需要继承 StatusBarView,xml中基础系统控件不要修改其id,拿来即用
|
||||||
|
* @return StatusBarView
|
||||||
|
*/
|
||||||
|
protected val statusBarView: StatusBarView
|
||||||
|
get() = StatusBarView(this)
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
calculateStartTime()
|
||||||
|
ContextHolderUtil.holdContext(this)
|
||||||
|
// 监听工控机连接信息
|
||||||
|
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||||
|
initStageTwo()
|
||||||
|
// 加载模块
|
||||||
|
mPresenter!!.postLoadModuleMsg()
|
||||||
|
// 监听网络状态
|
||||||
|
NetworkUtils.listenNetStrength(this)
|
||||||
|
mPresenter!!.checkPermission(this)
|
||||||
|
|
||||||
|
// 同步AppInfo Config信息
|
||||||
|
CallerDevaToolsManager.syncConfig()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun calculateStartTime() {
|
||||||
|
val coldStartTime = AppLaunchTimeUtils.getTimeCalculate(AppLaunchTimeUtils.COLD_START)
|
||||||
|
// 这里记录的TimeUtils.coldStartTime是指Application启动的时间,最终的冷启动时间等于Application启动时间+热启动时间
|
||||||
|
AppLaunchTimeUtils.sColdStartTime = if (coldStartTime > 0) coldStartTime else 0
|
||||||
|
AppLaunchTimeUtils.beginTimeCalculate(AppLaunchTimeUtils.HOT_START)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onWindowFocusChanged(hasFocus: Boolean) {
|
||||||
|
super.onWindowFocusChanged(hasFocus)
|
||||||
|
if (hasFocus) {
|
||||||
|
// 统计代码
|
||||||
|
val properties: MutableMap<String, Any> = HashMap()
|
||||||
|
val hotStartTime = AppLaunchTimeUtils.getTimeCalculate(AppLaunchTimeUtils.HOT_START)
|
||||||
|
if (AppLaunchTimeUtils.sColdStartTime > 0 && hotStartTime > 0) {
|
||||||
|
// 真正的冷启动时间 = Application启动时间 + 热启动时间
|
||||||
|
val coldStartTime = AppLaunchTimeUtils.sColdStartTime + hotStartTime
|
||||||
|
// 过滤掉异常启动时间
|
||||||
|
if (coldStartTime < 50000) {
|
||||||
|
// 上传冷启动时间coldStartTime
|
||||||
|
i(SceneConstant.M_HMI + TAG, "coldStartTime:$coldStartTime")
|
||||||
|
properties["app_launch_coldStartTime"] = coldStartTime
|
||||||
|
}
|
||||||
|
} else if (hotStartTime > 0) {
|
||||||
|
// 过滤掉异常启动时间
|
||||||
|
if (hotStartTime < 30000) {
|
||||||
|
// 上传热启动时间hotStartTime
|
||||||
|
i(SceneConstant.M_HMI + TAG, "hotStartTime:$hotStartTime")
|
||||||
|
properties["app_launch_hotStartTime"] = hotStartTime
|
||||||
|
}
|
||||||
|
}
|
||||||
|
AnalyticsUtils.track("app_launch_time", properties)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initConnectInfoRV() {
|
||||||
|
mConnAdapter = ConnInfoAdapter(this, dataList)
|
||||||
|
rvConnectInfo.layoutManager = LinearLayoutManager(this)
|
||||||
|
rvConnectInfo.adapter = mConnAdapter
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun loadModules() {
|
||||||
|
val start = System.currentTimeMillis()
|
||||||
|
MogoStatusManager.getInstance().setVrMode(TAG, true)
|
||||||
|
MogoModulesManager.getInstance().init(this)
|
||||||
|
loadOthersModules()
|
||||||
|
mogoMapListenerHandler.registerHostMapListener(TAG, object : IMogoMapListener {
|
||||||
|
override fun onMapLoaded() {
|
||||||
|
// 延时加载其他模块
|
||||||
|
window.decorView.post {
|
||||||
|
HdMapBuildConfig.isMapLoaded = true
|
||||||
|
mPresenter!!.delayOperations()
|
||||||
|
loadFunctionFragment()
|
||||||
|
// 设置地图样式
|
||||||
|
mogoMapListenerHandler.onMapModeChanged(EnumMapUI.MAP_STYLE_DAY_VR)
|
||||||
|
}
|
||||||
|
i(
|
||||||
|
SceneConstant.M_HMI + TAG,
|
||||||
|
"App launch timer cost " + (System.currentTimeMillis() - start) + "ms"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载其它模块
|
||||||
|
*/
|
||||||
|
protected open fun loadOthersModules() {
|
||||||
|
// 加载地图,触发地图加载完毕回调,在初始化其他卡片模块,保证卡片模块可以正确获取地图相关服务。
|
||||||
|
MogoModulesManager.getInstance().loadFunctionModules()
|
||||||
|
MogoModulesManager.getInstance().loadFunctionModulesServer()
|
||||||
|
UiThreadHandler.postDelayed({
|
||||||
|
d(SceneConstant.M_HMI + TAG, "5秒已过,启动基础服务……")
|
||||||
|
MogoModulesManager.getInstance().loadBaseModule()
|
||||||
|
}, 5000L)
|
||||||
|
if (DebugConfig.isDebug()) {
|
||||||
|
// 启动Native内存泄漏监测
|
||||||
|
startLeakMonitor()
|
||||||
|
}
|
||||||
|
checkMonitorDb()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun startLeakMonitor() {
|
||||||
|
val leakMonitorConfig: LeakMonitorConfig = LeakMonitorConfig.Builder()
|
||||||
|
.setLoopInterval(50000)
|
||||||
|
.setMonitorThreshold(16)
|
||||||
|
.setNativeHeapAllocatedThreshold(0)
|
||||||
|
.setSelectedSoList(
|
||||||
|
arrayOf(
|
||||||
|
"libhdmap", "libmap",
|
||||||
|
"libAMapSDK_NAVI_v8_0_1", "libZegoExpressEngine",
|
||||||
|
"libcntts"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.setEnableLocalSymbolic(DebugConfig.isDebug())
|
||||||
|
.setLeakListener(object : LeakListener {
|
||||||
|
override fun onLeak(leaks: MutableCollection<LeakRecord>) {
|
||||||
|
val stringBuilder = StringBuilder()
|
||||||
|
if (!leaks.isEmpty()) {
|
||||||
|
for (leakRecord in leaks) {
|
||||||
|
stringBuilder.append(leakRecord.toString())
|
||||||
|
}
|
||||||
|
printLeakMsg(stringBuilder.toString())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.build()
|
||||||
|
addMonitorConfig(leakMonitorConfig)
|
||||||
|
start()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun checkMonitorDb() {
|
||||||
|
Thread {
|
||||||
|
val limitId: Long = 50001
|
||||||
|
val file = getDatabasePath(MonitorDb.INTERNAL_DB_NAME)
|
||||||
|
try {
|
||||||
|
if (file != null && file.exists()) {
|
||||||
|
val cpuList = getDb(this).monitorDao().getAllCPUById(limitId)
|
||||||
|
val memList = getDb(this).monitorDao().getAllMemById(limitId)
|
||||||
|
// 大于5w条清除
|
||||||
|
if (cpuList.isNotEmpty() || memList.isNotEmpty()) {
|
||||||
|
deleteDatabase(MonitorDb.INTERNAL_DB_NAME)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
e(TAG, e.message)
|
||||||
|
}
|
||||||
|
}.start()
|
||||||
|
}
|
||||||
|
|
||||||
|
@ChainLog(
|
||||||
|
linkChainLog = ChainConstant.CHAIN_LINK_LOG_NATIVE_LEAK,
|
||||||
|
linkCode = ChainConstant.CHAIN_LINK_LEAK,
|
||||||
|
endpoint = PAD,
|
||||||
|
nodeAliasCode = ChainConstant.CHAIN_ALIAS_CODE_RECORD_NATIVE_LEAK,
|
||||||
|
paramIndexes = [0],
|
||||||
|
clientPkFileName = "sn"
|
||||||
|
)
|
||||||
|
private fun printLeakMsg(leakRecord: String) {
|
||||||
|
d(SceneConstant.M_HMI + TAG, "内存泄漏日志如下:\n$leakRecord")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun hideCoverUpLayout() {
|
||||||
|
rvConnectInfo.visibility = View.GONE
|
||||||
|
window.setBackgroundDrawable(null)
|
||||||
|
module_main_id_cover_up!!.visibility = View.GONE
|
||||||
|
isFloatingLayerHidden = true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun loadFunctionFragment() {
|
||||||
|
d(SceneConstant.M_HMI + TAG, "loadFunctionFragment……")
|
||||||
|
// 加载 小地图 图层
|
||||||
|
val fragmentSmpMap = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_SMP)
|
||||||
|
.navigation() as BaseFragment
|
||||||
|
addFragment(fragmentSmpMap, fragmentSmpMap.tagName, R.id.module_main_id_smp_fragment)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun createPresenter(): MainPresenter {
|
||||||
|
return MainPresenter(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
MogoStatusManager.getInstance().setMainPageResumeStatus(TAG, true)
|
||||||
|
MogoStatusManager.getInstance().setMainPageIsBackgroundStatus(TAG, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onPause() {
|
||||||
|
super.onPause()
|
||||||
|
MogoStatusManager.getInstance().setMainPageResumeStatus(TAG, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onStop() {
|
||||||
|
super.onStop()
|
||||||
|
MogoStatusManager.getInstance().setMainPageIsBackgroundStatus(TAG, true)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
|
||||||
|
val status = autoPilotStatusInfo.ipcConnStatus
|
||||||
|
if (mLastStatus != status) {
|
||||||
|
val statusInfo = autoPilotStatusInfo.clone()
|
||||||
|
rvConnectInfo.post { updateConnectInfoView(statusInfo) }
|
||||||
|
mLastStatus = status
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun updateConnectInfoView(autoPilotStatusInfo: AutopilotStatusInfo) {
|
||||||
|
if (!isFloatingLayerHidden) { // 遮罩层显示的时候
|
||||||
|
mConnAdapter!!.updateData(autoPilotStatusInfo)
|
||||||
|
rvConnectInfo.scrollToPosition(mConnAdapter!!.itemCount - 1)
|
||||||
|
mLastStatus = autoPilotStatusInfo.ipcConnStatus
|
||||||
|
} else { // 遮罩层隐藏的时候
|
||||||
|
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
super.onDestroy()
|
||||||
|
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||||
|
mogoMapListenerHandler.unregisterHostMapListener(TAG)
|
||||||
|
val mapUIController = getMapUIController()
|
||||||
|
mapUIController?.destroy()
|
||||||
|
MogoStatusManager.getInstance().setMainPageIsBackgroundStatus(TAG, false)
|
||||||
|
d(SceneConstant.M_HMI + TAG, "destroy.")
|
||||||
|
ContextHolderUtil.releaseContext()
|
||||||
|
MogoModulesManager.getInstance().onDestroy()
|
||||||
|
FloatingViewHandler.clear()
|
||||||
|
ProcessUtils.killAllBackgroundProcesses()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onRequestPermissionsResult(
|
||||||
|
requestCode: Int,
|
||||||
|
permissions: Array<String>,
|
||||||
|
grantResults: IntArray
|
||||||
|
) {
|
||||||
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
||||||
|
if (requestCode == MainPresenter.MOGO_PERMISSION_REQUEST_CODE) {
|
||||||
|
var isAllGranted = true
|
||||||
|
// 判断是否所有的权限都已经授予了
|
||||||
|
for (grant in grantResults) {
|
||||||
|
if (grant != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
isAllGranted = false
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isAllGranted) {
|
||||||
|
isFirst = false
|
||||||
|
} else {
|
||||||
|
// 弹出对话框告诉用户需要权限的原因, 并引导用户去应用权限管理中手动打开权限按钮
|
||||||
|
if (!isFirst) {
|
||||||
|
PermissionsDialogUtils.openAppDetails(this, null, REQUEST_CODE_DIALOG)
|
||||||
|
isFirst = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 由于应用是单页面的,所以采用Fragment将各模块的UI进行分割解耦合
|
||||||
|
*
|
||||||
|
* @param newFragment 功能UI
|
||||||
|
* @param tagName UI绑定的Tag
|
||||||
|
* @param containerId 要加入的资源ID
|
||||||
|
*/
|
||||||
|
private fun addFragment(newFragment: Fragment, tagName: String, containerId: Int) {
|
||||||
|
var fragment = supportFragmentManager.findFragmentByTag(tagName)
|
||||||
|
if (fragment == null) {
|
||||||
|
fragment = newFragment
|
||||||
|
}
|
||||||
|
if (fragment == null) {
|
||||||
|
e(
|
||||||
|
SceneConstant.M_HMI + TAG,
|
||||||
|
"add fragment fail cause fragment == null, container is " + ResourcesHelper.getResNameById(
|
||||||
|
applicationContext, containerId
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
supportFragmentManager.beginTransaction()
|
||||||
|
.replace(containerId, fragment, tagName)
|
||||||
|
.commitAllowingStateLoss()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_INIT;
|
|||||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_LOG_CONNECT_STATUS;
|
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_LOG_CONNECT_STATUS;
|
||||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_F;
|
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_F;
|
||||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||||
|
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_MAIN;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -93,13 +94,6 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
|||||||
@Override
|
@Override
|
||||||
protected void initViews() {
|
protected void initViews() {
|
||||||
super.initViews();
|
super.initViews();
|
||||||
// 这里在初始化完GUI后,做一些个性化的定制
|
|
||||||
// 小巴车的乘客屏幕
|
|
||||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) &&
|
|
||||||
AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
|
||||||
FrameLayout frameLayout = findViewById(R.id.module_main_id_map_fragment_container);
|
|
||||||
frameLayout.setPadding(0, 0, AutoSizeUtils.dp2px(getContext(), 700), 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -134,7 +128,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
|||||||
@Override
|
@Override
|
||||||
protected void loadOthersModules() {
|
protected void loadOthersModules() {
|
||||||
super.loadOthersModules();
|
super.loadOthersModules();
|
||||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "loadOthersModules");
|
CallerLogger.INSTANCE.d(M_MAIN + TAG, "loadOthersModules");
|
||||||
loadOCHModule();
|
loadOCHModule();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,14 +15,12 @@ import android.os.Process;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.widget.FrameLayout;
|
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.alibaba.android.arouter.launcher.ARouter;
|
import com.alibaba.android.arouter.launcher.ARouter;
|
||||||
import com.mogo.commons.module.intent.IMogoIntentListener;
|
import com.mogo.commons.module.intent.IMogoIntentListener;
|
||||||
import com.mogo.commons.module.intent.IntentManager;
|
import com.mogo.commons.module.intent.IntentManager;
|
||||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
|
||||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
|
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
|
||||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener;
|
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener;
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
|
||||||
@@ -30,7 +28,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
|
|||||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager;
|
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager;
|
||||||
import com.mogo.eagle.core.function.hmi.R;
|
import com.mogo.eagle.core.function.hmi.R;
|
||||||
import com.mogo.eagle.core.function.main.moujie.BluetoothMonitorReceiver;
|
import com.mogo.eagle.core.function.main.moujie.BluetoothMonitorReceiver;
|
||||||
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.CallerLogger;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||||
@@ -47,8 +44,6 @@ import java.util.Set;
|
|||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
|
|
||||||
import me.jessyan.autosize.utils.AutoSizeUtils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 针对作为Launcher的情况,做个性化操作
|
* 针对作为Launcher的情况,做个性化操作
|
||||||
*
|
*
|
||||||
@@ -91,13 +86,6 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte
|
|||||||
@Override
|
@Override
|
||||||
protected void initViews() {
|
protected void initViews() {
|
||||||
super.initViews();
|
super.initViews();
|
||||||
// 这里在初始化完GUI后,做一些个性化的定制
|
|
||||||
// 小巴车的乘客屏幕
|
|
||||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) &&
|
|
||||||
AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
|
||||||
FrameLayout frameLayout = findViewById(R.id.module_main_id_map_fragment_container);
|
|
||||||
frameLayout.setPadding(0, 0, AutoSizeUtils.dp2px(getContext(),700), 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.mogo.eagle.core.function.main.modules;
|
package com.mogo.eagle.core.function.main.modules;
|
||||||
|
|
||||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||||
|
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_MAIN;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -82,7 +83,7 @@ public class MogoModulesManager implements MogoModulesHandler {
|
|||||||
final List<MogoModule> modules = MogoModulePaths.getModuleFunctions();
|
final List<MogoModule> modules = MogoModulePaths.getModuleFunctions();
|
||||||
if (modules != null && !modules.isEmpty()) {
|
if (modules != null && !modules.isEmpty()) {
|
||||||
for (MogoModule module : modules) {
|
for (MogoModule module : modules) {
|
||||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "module.getPath():" + module.getPath() + " name: " + module.getName());
|
CallerLogger.INSTANCE.d(M_MAIN + TAG, "module.getPath():" + module.getPath() + " name: " + module.getName());
|
||||||
IMoGoFunctionProvider provider = loadFunction(module.getPath());
|
IMoGoFunctionProvider provider = loadFunction(module.getPath());
|
||||||
if (provider != null) {
|
if (provider != null) {
|
||||||
mModuleFunctionProviders.put(module, provider);
|
mModuleFunctionProviders.put(module, provider);
|
||||||
@@ -97,7 +98,7 @@ public class MogoModulesManager implements MogoModulesHandler {
|
|||||||
final List<MogoModule> modules = MogoModulePaths.getModuleFunctionServers();
|
final List<MogoModule> modules = MogoModulePaths.getModuleFunctionServers();
|
||||||
if (modules != null && !modules.isEmpty()) {
|
if (modules != null && !modules.isEmpty()) {
|
||||||
for (MogoModule module : modules) {
|
for (MogoModule module : modules) {
|
||||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "module.getPath():" + module.getPath() + " name: " + module.getName());
|
CallerLogger.INSTANCE.d(M_MAIN + TAG, "module.getPath():" + module.getPath() + " name: " + module.getName());
|
||||||
IMoGoFunctionServerProvider provider = loadFunctionServer(module.getPath());
|
IMoGoFunctionServerProvider provider = loadFunctionServer(module.getPath());
|
||||||
if (provider != null) {
|
if (provider != null) {
|
||||||
mModuleFunctionServerProviders.put(module, provider);
|
mModuleFunctionServerProviders.put(module, provider);
|
||||||
@@ -114,7 +115,7 @@ public class MogoModulesManager implements MogoModulesHandler {
|
|||||||
if (baseModule == null) {
|
if (baseModule == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "加载基本模块 : " + baseModule.getPath());
|
CallerLogger.INSTANCE.d(M_MAIN + TAG, "加载基本模块 : " + baseModule.getPath());
|
||||||
loadBaseProvider(baseModule.getPath());
|
loadBaseProvider(baseModule.getPath());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>
|
|
||||||
@@ -1,48 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@drawable/main_splash_bg"
|
android:background="@drawable/main_splash_bg"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<!-- 地图 -->
|
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/module_main_id_map_fragment_container"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent" />
|
|
||||||
|
|
||||||
<!--浓雾预警动画-->
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:id="@+id/cl_special_effect"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
tools:visibility="visible">
|
|
||||||
|
|
||||||
<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_constraintStart_toStartOf="parent" />
|
|
||||||
|
|
||||||
<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" />
|
|
||||||
</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
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?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"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<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>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.mogo.eagle.core.function.map">
|
package="com.mogo.eagle.core.function.view">
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.mogo.eagle.core.function
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import com.alibaba.android.arouter.facade.annotation.Route
|
||||||
|
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||||
|
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider
|
||||||
|
import com.mogo.eagle.core.function.business.MapPointCloudSubscriber
|
||||||
|
import com.mogo.eagle.core.function.business.SpeedLimitDataManager
|
||||||
|
import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber
|
||||||
|
import com.mogo.eagle.core.function.business.routeoverlay.MogoRouteOverlayManager
|
||||||
|
|
||||||
|
@Route(path = MogoServicePaths.PATH_MAP_BIZ)
|
||||||
|
class MapBizProvider :IMoGoFunctionServerProvider{
|
||||||
|
|
||||||
|
override val functionName: String
|
||||||
|
get() = "MapBizProvider"
|
||||||
|
|
||||||
|
override fun init(context: Context?) {
|
||||||
|
MapIdentifySubscriber.instance
|
||||||
|
MogoRouteOverlayManager.getInstance().init()
|
||||||
|
MapPointCloudSubscriber.instance
|
||||||
|
SpeedLimitDataManager.getInstance().start()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -58,7 +58,7 @@ public class SpeedLimitDataManager implements IMoGoChassisLocationGCJ02Listener
|
|||||||
int speedLimit = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), (float) mLocation.getHeading());
|
int speedLimit = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), (float) mLocation.getHeading());
|
||||||
UiThreadHandler.post(() -> {
|
UiThreadHandler.post(() -> {
|
||||||
if (speedLimit > 0) {
|
if (speedLimit > 0) {
|
||||||
CallerLimitingVelocityListenerManager.INSTANCE.invokeOnLimitingVelocityChange(speedLimit, DataSourceType.MAP);
|
CallerLimitingVelocityListenerManager.INSTANCE.invokeUnion(speedLimit, DataSourceType.MAP);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import android.annotation.SuppressLint;
|
|||||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum;
|
import com.mogo.eagle.core.data.enums.TrafficTypeEnum;
|
||||||
import com.mogo.eagle.core.data.map.CenterLine;
|
import com.mogo.eagle.core.data.map.CenterLine;
|
||||||
import com.mogo.eagle.core.function.call.map.CallerHDMapManager;
|
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||||
import com.mogo.eagle.core.utilcode.geometry.S2CellId;
|
import com.mogo.eagle.core.utilcode.geometry.S2CellId;
|
||||||
import com.mogo.eagle.core.utilcode.geometry.S2LatLng;
|
import com.mogo.eagle.core.utilcode.geometry.S2LatLng;
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ public class TrackObj {
|
|||||||
lon = data.getLongitude();
|
lon = data.getLongitude();
|
||||||
s2LatLng = S2LatLng.fromDegrees(data.getLatitude(), data.getLongitude());
|
s2LatLng = S2LatLng.fromDegrees(data.getLatitude(), data.getLongitude());
|
||||||
s2CellId = S2CellId.fromLatLng(s2LatLng).parent(22); //需要验证22前后
|
s2CellId = S2CellId.fromLatLng(s2LatLng).parent(22); //需要验证22前后
|
||||||
CenterLine centerLine = CallerHDMapManager.INSTANCE.getCenterLineInfo(lon, lat, -1);
|
CenterLine centerLine = CallerMapUIServiceManager.INSTANCE.getMapUIController().getCenterLineInfo(lon, lat, -1);
|
||||||
if (centerLine != null && centerLine.getAngle() != 0) {
|
if (centerLine != null && centerLine.getAngle() != 0) {
|
||||||
roadAngle = centerLine.getAngle();
|
roadAngle = centerLine.getAngle();
|
||||||
}
|
}
|
||||||
@@ -55,8 +55,8 @@ public class TrackObj {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void correct() {
|
private void correct() {
|
||||||
calAverageSpeedAndType();
|
// calAverageSpeedAndType();
|
||||||
calLoc();
|
// calLoc();
|
||||||
// calHeading();
|
// calHeading();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ public class TrackObj {
|
|||||||
//更正数据,速度小于LIMIT_SPEED使用上一帧数据
|
//更正数据,速度小于LIMIT_SPEED使用上一帧数据
|
||||||
if (relativeStatic()) {
|
if (relativeStatic()) {
|
||||||
if (roadAngle != 0.0) {
|
if (roadAngle != 0.0) {
|
||||||
CenterLine centerLine = CallerHDMapManager.INSTANCE.getCenterLineInfo(lon, lat, -1);
|
CenterLine centerLine = CallerMapUIServiceManager.INSTANCE.getMapUIController().getCenterLineInfo(lon, lat, -1);
|
||||||
if (centerLine != null && centerLine.getAngle() != 0) {
|
if (centerLine != null && centerLine.getAngle() != 0) {
|
||||||
cacheData = cacheData.toBuilder().setHeading(centerLine.getAngle()).build();
|
cacheData = cacheData.toBuilder().setHeading(centerLine.getAngle()).build();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import android.content.Context;
|
|||||||
|
|
||||||
import com.mogo.commons.AbsMogoApplication;
|
import com.mogo.commons.AbsMogoApplication;
|
||||||
import com.mogo.eagle.core.function.impl.marker.AdasRecognizedType;
|
import com.mogo.eagle.core.function.impl.marker.AdasRecognizedType;
|
||||||
import com.mogo.eagle.core.function.map.R;
|
import com.mogo.eagle.core.function.view.R;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author congtaowang
|
* @author congtaowang
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import android.widget.ImageView;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity;
|
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity;
|
||||||
import com.mogo.eagle.core.function.map.R;
|
import com.mogo.eagle.core.function.view.R;
|
||||||
import com.mogo.map.marker.MogoMarkerOptions;
|
import com.mogo.map.marker.MogoMarkerOptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import android.widget.LinearLayout;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity;
|
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity;
|
||||||
import com.mogo.eagle.core.function.map.R;
|
import com.mogo.eagle.core.function.view.R;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideImageLoader;
|
import com.mogo.eagle.core.utilcode.mogo.glide.GlideImageLoader;
|
||||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||||
import com.mogo.eagle.core.utilcode.util.ViewUtils;
|
import com.mogo.eagle.core.utilcode.util.ViewUtils;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import com.mogo.commons.module.status.MogoStatusManager;
|
|||||||
import com.mogo.eagle.core.data.map.PoiWrapper;
|
import com.mogo.eagle.core.data.map.PoiWrapper;
|
||||||
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay;
|
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay;
|
||||||
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity;
|
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity;
|
||||||
import com.mogo.eagle.core.function.map.R;
|
import com.mogo.eagle.core.function.view.R;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||||
import com.mogo.map.marker.MogoMarkerOptions;
|
import com.mogo.map.marker.MogoMarkerOptions;
|
||||||
import com.mogo.eagle.core.data.config.CloudPoiManager;
|
import com.mogo.eagle.core.data.config.CloudPoiManager;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import android.graphics.BitmapFactory;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import com.mogo.commons.AbsMogoApplication;
|
import com.mogo.commons.AbsMogoApplication;
|
||||||
import com.mogo.eagle.core.function.map.R;
|
import com.mogo.eagle.core.function.view.R;
|
||||||
import com.mogo.map.marker.IMogoMarker;
|
import com.mogo.map.marker.IMogoMarker;
|
||||||
|
|
||||||
import java.lang.ref.SoftReference;
|
import java.lang.ref.SoftReference;
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
package com.mogo.eagle.core.function.map
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import android.os.Bundle
|
|
||||||
import chassis.Chassis
|
|
||||||
import com.mogo.eagle.core.data.map.MogoLocation
|
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
|
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
|
||||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
|
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
|
||||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
|
||||||
import com.mogo.map.MogoMapView
|
|
||||||
|
|
||||||
class MapBizView(context: Context?) : MogoMapView(context), IMoGoSkinModeChangeListener,
|
|
||||||
IMoGoChassisLocationWGS84Listener, IMoGoChassisLamplightListener {
|
|
||||||
|
|
||||||
override fun onCreate(bundle: Bundle?) {
|
|
||||||
super.onCreate(bundle)
|
|
||||||
map.uiController.showMyLocation(true)
|
|
||||||
|
|
||||||
CallerSkinModeListenerManager.addListener(MapFragment.functionName, this)
|
|
||||||
CallerChassisLocationWGS84ListenerManager.addListener(MapFragment.functionName, this)
|
|
||||||
CallerChassisLamplightListenerManager.addListener(MapFragment.functionName, this)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onSkinModeChange(skinMode: Int) {
|
|
||||||
TODO("Not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
|
|
||||||
super.onAutopilotLightSwitchData(lightSwitch)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
|
||||||
TODO("Not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDestroy() {
|
|
||||||
// 先取消注册数据,再onDestroy
|
|
||||||
CallerSkinModeListenerManager.removeListener(MapFragment.functionName)
|
|
||||||
CallerChassisLocationWGS84ListenerManager.removeListener(MapFragment.functionName)
|
|
||||||
CallerChassisLamplightListenerManager.removeListener(MapFragment.functionName)
|
|
||||||
super.onDestroy()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,336 +0,0 @@
|
|||||||
package com.mogo.eagle.core.function.map
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import android.os.Bundle
|
|
||||||
import android.view.View
|
|
||||||
import chassis.Chassis
|
|
||||||
import com.alibaba.android.arouter.facade.annotation.Route
|
|
||||||
import com.mogo.commons.mvp.MvpFragment
|
|
||||||
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
|
|
||||||
import com.mogo.eagle.core.data.map.CenterLine
|
|
||||||
import com.mogo.eagle.core.data.map.MogoLocation
|
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
|
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
|
||||||
import com.mogo.eagle.core.function.api.map.hd.IMoGoMapFragmentProvider
|
|
||||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
|
||||||
import com.mogo.eagle.core.function.business.MapPointCloudSubscriber
|
|
||||||
import com.mogo.eagle.core.function.business.SpeedLimitDataManager
|
|
||||||
import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber
|
|
||||||
import com.mogo.eagle.core.function.business.routeoverlay.MogoRouteOverlayManager
|
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
|
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
|
||||||
import com.mogo.eagle.core.function.call.map.CallerHDMapManager
|
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
|
||||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
|
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
|
||||||
import com.mogo.map.IMogoMap
|
|
||||||
import com.mogo.map.MogoMapView
|
|
||||||
import com.mogo.map.uicontroller.IMogoMapUIController
|
|
||||||
import com.zhidaoauto.map.sdk.open.MapAutoApi
|
|
||||||
import com.zhidaoauto.map.sdk.open.business.PointCloudHelper
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author donghongyu
|
|
||||||
* @since 2021-11-09
|
|
||||||
* 高精度地图层UI
|
|
||||||
* 地图图层,地图操作都在这个图层完成 //todo 以view方式进行提供
|
|
||||||
*/
|
|
||||||
@Route(path = MoGoFragmentPaths.PATH_FRAGMENT_MAP)
|
|
||||||
class MapFragment : MvpFragment<MapView?, MapPresenter?>(),
|
|
||||||
MapView,
|
|
||||||
IMoGoMapFragmentProvider,
|
|
||||||
IMoGoSkinModeChangeListener,
|
|
||||||
IMoGoChassisLocationWGS84Listener,
|
|
||||||
IMoGoChassisLamplightListener {
|
|
||||||
|
|
||||||
private var mMogoMapView: MogoMapView? = null
|
|
||||||
private var mMogoMap: IMogoMap? = null
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
const val functionName = "MapFragment"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* sight mode
|
|
||||||
*
|
|
||||||
* @param mode
|
|
||||||
*/
|
|
||||||
const val SIGHT_MODE_NORMAL = 0
|
|
||||||
const val SIGHT_MODE_TOP = 1
|
|
||||||
const val SIGHT_MODE_BACK = 2
|
|
||||||
const val SIGHT_MODE_CROSS = 3
|
|
||||||
const val SIGHT_MODE_FAR = 4
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
override fun getLayoutId(): Int {
|
|
||||||
return R.layout.module_map_fragment_map
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getTagName(): String {
|
|
||||||
return Companion.functionName
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun initViews() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun stepInVrMode(isDayMode: Boolean) {
|
|
||||||
try {
|
|
||||||
if (mMogoMapView != null && mMogoMapView!!.map != null && mMogoMapView!!.map.uiController != null) {
|
|
||||||
mMogoMapView!!.map.uiController.stepInVrMode(isDayMode)
|
|
||||||
}
|
|
||||||
} catch (e: Exception) {
|
|
||||||
e.printStackTrace()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun init(context: Context) {
|
|
||||||
// do not implement
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun initViews(savedInstanceState: Bundle?) {
|
|
||||||
super.initViews(savedInstanceState)
|
|
||||||
mMogoMapView = findViewById(R.id.module_map_id_map)
|
|
||||||
mMogoMapView!!.onCreate(savedInstanceState)
|
|
||||||
mMogoMap = mMogoMapView!!.map
|
|
||||||
if (mMogoMap != null) {
|
|
||||||
mMogoMap!!.uiController.showMyLocation(true)
|
|
||||||
}
|
|
||||||
// 添加换肤监听
|
|
||||||
CallerSkinModeListenerManager.addListener(Companion.functionName, this)
|
|
||||||
CallerChassisLocationWGS84ListenerManager.addListener(Companion.functionName, this)
|
|
||||||
CallerChassisLamplightListenerManager.addListener(Companion.functionName, this)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun createPresenter(): MapPresenter {
|
|
||||||
return MapPresenter(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
|
||||||
super.onViewCreated(view, savedInstanceState)
|
|
||||||
initMapView()
|
|
||||||
initMapBiz()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onSaveInstanceState(outState: Bundle) {
|
|
||||||
super.onSaveInstanceState(outState)
|
|
||||||
if (mMogoMapView != null) {
|
|
||||||
mMogoMapView!!.onSaveInstanceState(outState)
|
|
||||||
} else {
|
|
||||||
e(SceneConstant.M_MAP + Companion.functionName, "mMogoMapView is null")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onPause() {
|
|
||||||
super.onPause()
|
|
||||||
if (mMogoMapView != null) {
|
|
||||||
mMogoMapView!!.onPause()
|
|
||||||
} else {
|
|
||||||
e(SceneConstant.M_MAP + Companion.functionName, "mMogoMapView is null")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onResume() {
|
|
||||||
super.onResume()
|
|
||||||
if (mMogoMapView != null) {
|
|
||||||
mMogoMapView!!.onResume()
|
|
||||||
} else {
|
|
||||||
e(SceneConstant.M_MAP + Companion.functionName, "mMogoMapView is null")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onLowMemory() {
|
|
||||||
super.onLowMemory()
|
|
||||||
if (mMogoMapView != null) {
|
|
||||||
mMogoMapView!!.onLowMemory()
|
|
||||||
} else {
|
|
||||||
e(SceneConstant.M_MAP + Companion.functionName, "mMogoMapView is null")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun initMapView() {
|
|
||||||
mMogoMap = mMogoMapView!!.map
|
|
||||||
if (mMogoMap == null) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
val uiSettings = mMogoMap!!.uiSettings
|
|
||||||
if (uiSettings != null) {
|
|
||||||
//设置所有手势是否可用
|
|
||||||
uiSettings.setAllGesturesEnabled(true)
|
|
||||||
//设置指南针是否可见。
|
|
||||||
uiSettings.setCompassEnabled(false)
|
|
||||||
//设置室内地图楼层切换控件是否可见。
|
|
||||||
uiSettings.setIndoorSwitchEnabled(true)
|
|
||||||
//设置定位按钮是否可见。
|
|
||||||
uiSettings.setMyLocationButtonEnabled(false)
|
|
||||||
//设置旋转手势是否可用。
|
|
||||||
uiSettings.setRotateGesturesEnabled(false)
|
|
||||||
//设置比例尺控件是否可见
|
|
||||||
uiSettings.setScaleControlsEnabled(true)
|
|
||||||
//设置拖拽手势是否可用。
|
|
||||||
uiSettings.setScrollGesturesEnabled(true)
|
|
||||||
//设置倾斜手势是否可用。
|
|
||||||
uiSettings.setTiltGesturesEnabled(true)
|
|
||||||
//设置缩放按钮是否可见。
|
|
||||||
uiSettings.setZoomControlsEnabled(false)
|
|
||||||
//设置双指缩放手势是否可用。
|
|
||||||
uiSettings.setZoomGesturesEnabled(true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun initMapBiz() {
|
|
||||||
// TODO 临时初始化地图监听工控机、OBU等数据监听器,用于感知元素绘制
|
|
||||||
MapIdentifySubscriber.instance
|
|
||||||
MogoRouteOverlayManager.getInstance().init()
|
|
||||||
MapPointCloudSubscriber.instance
|
|
||||||
SpeedLimitDataManager.getInstance().start()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getUIController(): IMogoMapUIController {
|
|
||||||
return mMogoMap!!.uiController
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDestroyView() {
|
|
||||||
CallerSkinModeListenerManager.removeListener(Companion.functionName)
|
|
||||||
CallerChassisLocationWGS84ListenerManager.removeListener(Companion.functionName)
|
|
||||||
CallerChassisLamplightListenerManager.removeListener(Companion.functionName)
|
|
||||||
|
|
||||||
if (mMogoMapView != null) {
|
|
||||||
mMogoMapView!!.onDestroy()
|
|
||||||
mMogoMapView = null
|
|
||||||
mMogoMap = null
|
|
||||||
} else {
|
|
||||||
e(SceneConstant.M_MAP + Companion.functionName, "mMogoMapView is null")
|
|
||||||
}
|
|
||||||
super.onDestroyView()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun changeMaoViewAngle(type: Int) {
|
|
||||||
if (mMogoMapView != null && mMogoMapView!!.map != null && mMogoMapView!!.map.uiController != null) {
|
|
||||||
mMogoMapView!!.map.uiController.changeMapViewAngle(type)
|
|
||||||
} else {
|
|
||||||
e(SceneConstant.M_MAP + Companion.functionName, "mMogoMapView is null")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun changeCurrentIcon(iconId: Int) {
|
|
||||||
if (mMogoMapView != null && mMogoMapView!!.map != null && mMogoMapView!!.map.uiController != null) {
|
|
||||||
mMogoMapView!!.map.uiController.changeCurrentIcon(iconId)
|
|
||||||
} else {
|
|
||||||
e(SceneConstant.M_MAP + Companion.functionName, "mMogoMapView is null")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun setMapDAngle(mode: Int) {
|
|
||||||
val angle = getSightModeAngle(mode)
|
|
||||||
if (mMogoMapView != null && mMogoMapView!!.map != null && mMogoMapView!!.map.uiController != null) {
|
|
||||||
mMogoMapView!!.map.uiController.setMapDAngle(angle)
|
|
||||||
} else {
|
|
||||||
e(SceneConstant.M_MAP + Companion.functionName, "mMogoMapView is null")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun getSightModeAngle(mode: Int): Float { //todo 宏宇
|
|
||||||
var angle = 0.0f
|
|
||||||
when (mode) {
|
|
||||||
SIGHT_MODE_NORMAL -> {
|
|
||||||
angle = 16.5f
|
|
||||||
angle = 16.5f
|
|
||||||
angle = 16.5f
|
|
||||||
angle = 16.5f
|
|
||||||
angle = 16.5f
|
|
||||||
}
|
|
||||||
SIGHT_MODE_TOP -> {
|
|
||||||
angle = 16.5f
|
|
||||||
angle = 16.5f
|
|
||||||
angle = 16.5f
|
|
||||||
angle = 16.5f
|
|
||||||
}
|
|
||||||
SIGHT_MODE_BACK -> {
|
|
||||||
angle = 16.5f
|
|
||||||
angle = 16.5f
|
|
||||||
angle = 16.5f
|
|
||||||
}
|
|
||||||
SIGHT_MODE_CROSS -> {
|
|
||||||
angle = 16.5f
|
|
||||||
angle = 16.5f
|
|
||||||
}
|
|
||||||
SIGHT_MODE_FAR -> angle = 16.5f
|
|
||||||
}
|
|
||||||
return angle
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getCenterLineInfo(lon: Double, lat: Double, angle: Float): CenterLine? {
|
|
||||||
return if (mMogoMapView != null && mMogoMapView!!.map != null && mMogoMapView!!.map.uiController != null) {
|
|
||||||
mMogoMapView!!.map.uiController.getCenterLineInfo(lon, lat, angle)
|
|
||||||
} else {
|
|
||||||
e(SceneConstant.M_MAP + Companion.functionName, "mMogoMapView is null")
|
|
||||||
null //上层使用应该判空
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onSkinModeChange(skinMode: Int) {
|
|
||||||
if (skinMode == 0) {
|
|
||||||
CallerHDMapManager.stepInVrMode(false)
|
|
||||||
} else if (skinMode == 1) {
|
|
||||||
CallerHDMapManager.stepInVrMode(true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun setPointCloudSize(pointCloudSize: Float) {
|
|
||||||
//设置点云大小
|
|
||||||
PointCloudHelper.setPointCloudSize(pointCloudSize)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun setPointCloudColor(color: String) {
|
|
||||||
// 设置点云颜色
|
|
||||||
PointCloudHelper.setPointCloudColor(color)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun setIsDrawPointCloud(isDrawPointCloud: Boolean) {
|
|
||||||
try {
|
|
||||||
// 是否绘制点云
|
|
||||||
PointCloudHelper.setIsDrawPointCloud(isDrawPointCloud)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
e.printStackTrace()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置地图是否是Debug模式
|
|
||||||
*
|
|
||||||
* @param debugMode 是否开启Debug模式
|
|
||||||
*/
|
|
||||||
override fun setDebugMode(debugMode: Boolean) {
|
|
||||||
MapAutoApi.setDebugMode(debugMode)
|
|
||||||
}
|
|
||||||
|
|
||||||
override val functionName: String
|
|
||||||
get() = functionName
|
|
||||||
|
|
||||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
|
||||||
// 跟新地图控件
|
|
||||||
mMogoMapView?.setExtraGPSData(gnssInfo)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
|
|
||||||
lightSwitch?.let {
|
|
||||||
when (it.number) {
|
|
||||||
1 -> { //左转灯
|
|
||||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(4, 500)
|
|
||||||
}
|
|
||||||
2 -> { //右转灯
|
|
||||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500)
|
|
||||||
}
|
|
||||||
else -> {
|
|
||||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package com.mogo.eagle.core.function.map;
|
|
||||||
|
|
||||||
import com.mogo.commons.mvp.Presenter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author congtaowang
|
|
||||||
* @since 2019-12-23
|
|
||||||
* <p>
|
|
||||||
* 描述
|
|
||||||
*/
|
|
||||||
public class MapPresenter extends Presenter<MapView> {
|
|
||||||
|
|
||||||
private static final String TAG = "MapPresenter";
|
|
||||||
|
|
||||||
public MapPresenter(MapView view) {
|
|
||||||
super(view);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
package com.mogo.eagle.core.function.map;
|
|
||||||
|
|
||||||
import com.mogo.commons.mvp.IView;
|
|
||||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author congtaowang
|
|
||||||
* @since 2019-12-23
|
|
||||||
* <p>
|
|
||||||
* 地图view
|
|
||||||
*/
|
|
||||||
public interface MapView extends IView {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 地图控制接口
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
IMogoMapUIController getUIController();
|
|
||||||
}
|
|
||||||
@@ -13,13 +13,10 @@ import com.amap.api.maps.model.LatLng;
|
|||||||
import com.amap.api.maps.model.Marker;
|
import com.amap.api.maps.model.Marker;
|
||||||
import com.amap.api.maps.model.MarkerOptions;
|
import com.amap.api.maps.model.MarkerOptions;
|
||||||
import com.amap.api.maps.model.Polyline;
|
import com.amap.api.maps.model.Polyline;
|
||||||
import com.amap.api.navi.AMapNaviView;
|
|
||||||
import com.autonavi.amap.mapcore.IPoint;
|
import com.autonavi.amap.mapcore.IPoint;
|
||||||
import com.mogo.eagle.core.function.map.R;
|
import com.mogo.eagle.core.function.view.R;
|
||||||
|
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 包名: com.amap.api.navi.core
|
* 包名: com.amap.api.navi.core
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import android.content.Context
|
|||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
import com.mogo.eagle.core.function.map.R
|
import com.mogo.eagle.core.function.view.R
|
||||||
import kotlinx.android.synthetic.main.view_maker_with_count.view.*
|
import kotlinx.android.synthetic.main.view_maker_with_count.view.*
|
||||||
|
|
||||||
class MakerWithCount @JvmOverloads constructor(
|
class MakerWithCount @JvmOverloads constructor(
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import com.mogo.eagle.core.data.map.MogoLatLng;
|
|||||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
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.autopilot.CallerChassisLocationGCJ20ListenerManager;
|
||||||
import com.mogo.eagle.core.function.map.R;
|
import com.mogo.eagle.core.function.view.R;
|
||||||
import com.mogo.eagle.core.function.smp.view.ISmallMapDirectionView;
|
import com.mogo.eagle.core.function.smp.view.ISmallMapDirectionView;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils;
|
import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import com.mogo.eagle.core.function.api.map.smp.IMogoSmallMapProvider;
|
|||||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
|
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
|
||||||
import com.mogo.eagle.core.function.map.R;
|
import com.mogo.eagle.core.function.view.R;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import android.view.LayoutInflater
|
|||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
import com.mogo.eagle.core.function.map.R
|
import com.mogo.eagle.core.function.view.R
|
||||||
|
|
||||||
class V2XMarkerView @JvmOverloads constructor(
|
class V2XMarkerView @JvmOverloads constructor(
|
||||||
context: Context,
|
context: Context,
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
|||||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
|
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
|
||||||
import com.mogo.eagle.core.function.map.R
|
import com.mogo.eagle.core.function.view.R
|
||||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||||
import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils
|
import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||||
|
|||||||
@@ -0,0 +1,112 @@
|
|||||||
|
package com.mogo.eagle.core.function.view
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import androidx.lifecycle.LifecycleObserver
|
||||||
|
import chassis.Chassis
|
||||||
|
import com.mogo.eagle.core.data.map.MogoLocation
|
||||||
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
|
||||||
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||||
|
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
||||||
|
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
|
||||||
|
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||||
|
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||||
|
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||||
|
import com.mogo.map.MogoMapView
|
||||||
|
|
||||||
|
|
||||||
|
class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context, attrs), IMoGoSkinModeChangeListener,
|
||||||
|
IMoGoChassisLocationWGS84Listener, IMoGoChassisLamplightListener , LifecycleObserver {
|
||||||
|
|
||||||
|
companion object{
|
||||||
|
private const val TAG = "MapBizView"
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreate(bundle: Bundle?) {
|
||||||
|
super.onCreate(bundle)
|
||||||
|
map?.uiController?.showMyLocation(true)
|
||||||
|
initMapView()
|
||||||
|
|
||||||
|
CallerSkinModeListenerManager.addListener(TAG, this)
|
||||||
|
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
|
||||||
|
CallerChassisLamplightListenerManager.addListener(TAG, this)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initMapView(){
|
||||||
|
map?.uiSettings?.let {
|
||||||
|
//设置所有手势是否可用
|
||||||
|
it.setAllGesturesEnabled(true)
|
||||||
|
//设置指南针是否可见。
|
||||||
|
it.setCompassEnabled(false)
|
||||||
|
//设置室内地图楼层切换控件是否可见。
|
||||||
|
it.setIndoorSwitchEnabled(true)
|
||||||
|
//设置定位按钮是否可见。
|
||||||
|
it.setMyLocationButtonEnabled(false)
|
||||||
|
//设置旋转手势是否可用。
|
||||||
|
it.setRotateGesturesEnabled(false)
|
||||||
|
//设置比例尺控件是否可见
|
||||||
|
it.setScaleControlsEnabled(true)
|
||||||
|
//设置拖拽手势是否可用。
|
||||||
|
it.setScrollGesturesEnabled(true)
|
||||||
|
//设置倾斜手势是否可用。
|
||||||
|
it.setTiltGesturesEnabled(true)
|
||||||
|
//设置缩放按钮是否可见。
|
||||||
|
it.setZoomControlsEnabled(false)
|
||||||
|
//设置双指缩放手势是否可用。
|
||||||
|
it.setZoomGesturesEnabled(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSaveInstanceState(outState: Bundle?) {
|
||||||
|
super.onSaveInstanceState(outState)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onPause() {
|
||||||
|
super.onPause()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSkinModeChange(skinMode: Int) {
|
||||||
|
if (skinMode == 0) {
|
||||||
|
CallerMapUIServiceManager.getMapUIController()?.stepInVrMode(false)
|
||||||
|
} else if (skinMode == 1) {
|
||||||
|
CallerMapUIServiceManager.getMapUIController()?.stepInVrMode(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||||
|
// 跟新地图控件
|
||||||
|
setExtraGPSData(gnssInfo)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
|
||||||
|
super.onAutopilotLightSwitchData(lightSwitch)
|
||||||
|
lightSwitch?.let {
|
||||||
|
when (it.number) {
|
||||||
|
1 -> { //左转灯
|
||||||
|
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(4, 500)
|
||||||
|
}
|
||||||
|
2 -> { //右转灯
|
||||||
|
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500)
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
// 先取消注册数据,再onDestroy
|
||||||
|
CallerSkinModeListenerManager.removeListener(TAG)
|
||||||
|
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
|
||||||
|
CallerChassisLamplightListenerManager.removeListener(TAG)
|
||||||
|
super.onDestroy()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mogo.eagle.core.function.overview.view
|
package com.mogo.eagle.core.function.view
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
@@ -16,7 +16,6 @@ import com.amap.api.maps.CameraUpdate
|
|||||||
import com.amap.api.maps.CameraUpdateFactory
|
import com.amap.api.maps.CameraUpdateFactory
|
||||||
import com.amap.api.maps.TextureMapView
|
import com.amap.api.maps.TextureMapView
|
||||||
import com.amap.api.maps.model.*
|
import com.amap.api.maps.model.*
|
||||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
|
||||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||||
import com.mogo.eagle.core.data.map.Infrastructure
|
import com.mogo.eagle.core.data.map.Infrastructure
|
||||||
import com.mogo.eagle.core.data.map.MogoLocation
|
import com.mogo.eagle.core.data.map.MogoLocation
|
||||||
@@ -29,7 +28,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20Lis
|
|||||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
|
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
|
||||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizListenerManager
|
import com.mogo.eagle.core.function.call.biz.CallerFuncBizListenerManager
|
||||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showVideoDialog
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showVideoDialog
|
||||||
import com.mogo.eagle.core.function.map.R
|
|
||||||
import com.mogo.eagle.core.function.smp.MakerWithCount
|
import com.mogo.eagle.core.function.smp.MakerWithCount
|
||||||
import com.mogo.eagle.core.function.smp.MarkerDrawerManager
|
import com.mogo.eagle.core.function.smp.MarkerDrawerManager
|
||||||
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.callback
|
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.callback
|
||||||
@@ -318,7 +316,7 @@ class OverMapView @JvmOverloads constructor(
|
|||||||
val center = v2xEvent.center
|
val center = v2xEvent.center
|
||||||
if (center != null) {
|
if (center != null) {
|
||||||
val markerOption = MarkerOptions()
|
val markerOption = MarkerOptions()
|
||||||
var latLng: LatLng =
|
val latLng: LatLng =
|
||||||
if (v2xEvent.coordinateType == null || v2xEvent.coordinateType == 0) {
|
if (v2xEvent.coordinateType == null || v2xEvent.coordinateType == 0) {
|
||||||
LatLng(center.lat, center.lon)
|
LatLng(center.lat, center.lon)
|
||||||
} else {
|
} else {
|
||||||
@@ -584,12 +582,15 @@ class OverMapView @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
|
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
|
||||||
mLocation = gnssInfo
|
gnssInfo?.let {
|
||||||
lonLat = Pair(gnssInfo!!.longitude, gnssInfo.latitude)
|
mLocation = it
|
||||||
drawCarMarker(gnssInfo)
|
lonLat = Pair(it.longitude, it.latitude)
|
||||||
if (isFirstLocation) {
|
drawCarMarker(it)
|
||||||
displayCustomOverView()
|
if (isFirstLocation) {
|
||||||
isFirstLocation = false
|
displayCustomOverView()
|
||||||
|
isFirstLocation = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
>
|
|
||||||
|
|
||||||
<com.mogo.map.MogoMapView
|
|
||||||
android:id="@+id/module_map_id_map"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:visibility="visible"/>
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
@@ -11,7 +11,7 @@ import com.mogo.eagle.core.function.startup.stageone.ThreadOptStartup
|
|||||||
import com.mogo.eagle.core.function.startup.stagetwo.AutopilotStartUp
|
import com.mogo.eagle.core.function.startup.stagetwo.AutopilotStartUp
|
||||||
import com.mogo.eagle.core.function.startup.stagetwo.DataCenterStartUp
|
import com.mogo.eagle.core.function.startup.stagetwo.DataCenterStartUp
|
||||||
import com.mogo.eagle.core.function.startup.stagetwo.ObuStartUp
|
import com.mogo.eagle.core.function.startup.stagetwo.ObuStartUp
|
||||||
import com.mogo.eagle.core.function.startup.stagetwo.V2XStartUp
|
import com.mogo.eagle.core.function.startup.stagetwo.MapBizStartUp
|
||||||
import com.rousetime.android_startup.StartupListener
|
import com.rousetime.android_startup.StartupListener
|
||||||
import com.rousetime.android_startup.StartupManager
|
import com.rousetime.android_startup.StartupManager
|
||||||
import com.rousetime.android_startup.model.CostTimesModel
|
import com.rousetime.android_startup.model.CostTimesModel
|
||||||
@@ -79,7 +79,7 @@ class MogoStartUpProvider: IStartUpProvider {
|
|||||||
.addStartup(DataCenterStartUp())
|
.addStartup(DataCenterStartUp())
|
||||||
.addStartup(AutopilotStartUp())
|
.addStartup(AutopilotStartUp())
|
||||||
.addStartup(ObuStartUp())
|
.addStartup(ObuStartUp())
|
||||||
.addStartup(V2XStartUp())
|
.addStartup(MapBizStartUp())
|
||||||
.setConfig(config)
|
.setConfig(config)
|
||||||
.build(it)
|
.build(it)
|
||||||
.start()
|
.start()
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ import com.alibaba.android.arouter.launcher.ARouter
|
|||||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||||
import com.rousetime.android_startup.AndroidStartup
|
import com.rousetime.android_startup.AndroidStartup
|
||||||
|
|
||||||
class V2XStartUp: AndroidStartup<Boolean>() {
|
class MapBizStartUp: AndroidStartup<Boolean>() {
|
||||||
|
|
||||||
override fun create(context: Context): Boolean? {
|
override fun create(context: Context): Boolean {
|
||||||
ARouter.getInstance().build(MogoServicePaths.PATH_V2X_MODULE).navigation()
|
ARouter.getInstance().build(MogoServicePaths.PATH_MAP_BIZ).navigation()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ class V2XStartUp: AndroidStartup<Boolean>() {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun dependenciesByName(): List<String>? {
|
override fun dependenciesByName(): List<String> {
|
||||||
val deps = arrayListOf<String>()
|
val deps = arrayListOf<String>()
|
||||||
deps.add("com.mogo.eagle.core.function.startup.stagetwo.DataCenterStartUp")
|
deps.add("com.mogo.eagle.core.function.startup.stagetwo.DataCenterStartUp")
|
||||||
return deps
|
return deps
|
||||||
@@ -156,7 +156,6 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback,
|
|||||||
val v2XMessageEntity = V2XMessageEntity<V2XRoadEventEntity>()
|
val v2XMessageEntity = V2XMessageEntity<V2XRoadEventEntity>()
|
||||||
v2XMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING
|
v2XMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING
|
||||||
v2XMessageEntity.content = v2XRoadEventEntity
|
v2XMessageEntity.content = v2XRoadEventEntity
|
||||||
v2XMessageEntity.isShowState = true
|
|
||||||
V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity)
|
V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.mogo.eagle.core.function.v2x.events.scenario.scene.road;
|
package com.mogo.eagle.core.function.v2x.events.scenario.scene.road;
|
||||||
|
|
||||||
import com.mogo.commons.AbsMogoApplication;
|
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.EventTypeEnumNew;
|
||||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum;
|
import com.mogo.eagle.core.data.enums.WarningDirectionEnum;
|
||||||
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay;
|
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));
|
Logger.d(TAG, "v2XMessageEntity:" + GsonUtil.jsonFromObject(v2XMessageEntity));
|
||||||
V2XRoadEventEntity v2XRoadEventEntity = v2XMessageEntity.getContent();
|
V2XRoadEventEntity v2XRoadEventEntity = v2XMessageEntity.getContent();
|
||||||
if (v2XRoadEventEntity != null) {
|
if (v2XRoadEventEntity != null) {
|
||||||
if (v2XMessageEntity.isShowState()) {
|
if (!isSameScenario(v2XMessageEntity)) {
|
||||||
if (!isSameScenario(v2XMessageEntity)) {
|
// 更新要提醒的数据
|
||||||
// 更新要提醒的数据
|
setV2XMessageEntity(v2XMessageEntity);
|
||||||
setV2XMessageEntity(v2XMessageEntity);
|
show();
|
||||||
show();
|
|
||||||
} else {
|
|
||||||
// 更新要提醒的数据
|
|
||||||
setV2XMessageEntity(v2XMessageEntity);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
close();
|
// 更新要提醒的数据
|
||||||
|
setV2XMessageEntity(v2XMessageEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -70,16 +66,12 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
|||||||
if (getV2XMessageEntity() != null && getV2XMessageEntity().getContent() != null) {
|
if (getV2XMessageEntity() != null && getV2XMessageEntity().getContent() != null) {
|
||||||
//只展示不播报 不广播
|
//只展示不播报 不广播
|
||||||
V2XMessageEntity<V2XRoadEventEntity> entity = getV2XMessageEntity();
|
V2XMessageEntity<V2XRoadEventEntity> entity = getV2XMessageEntity();
|
||||||
boolean onlyShow = entity.isOnlyShow();
|
V2XRoadEventEntity content = entity.getContent();
|
||||||
if (!onlyShow) {
|
if (content != null && !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType())
|
||||||
// 设置TTS
|
&& !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_JINGZHI.getPoiType())
|
||||||
V2XRoadEventEntity content = entity.getContent();
|
&& !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU.getPoiType())
|
||||||
if (content != null && !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType())
|
&& !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION.getPoiType())) {
|
||||||
&& !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_JINGZHI.getPoiType())
|
content.getTts(false);
|
||||||
&& !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU.getPoiType())
|
|
||||||
&& !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION.getPoiType())) {
|
|
||||||
content.getTts(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
showWindow();
|
showWindow();
|
||||||
}
|
}
|
||||||
@@ -101,7 +93,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
|||||||
}
|
}
|
||||||
String poiType = content.getPoiType();
|
String poiType = content.getPoiType();
|
||||||
if (EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType().equals(poiType) ||
|
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_CONGESTION.getPoiType().equals(poiType) ||
|
||||||
EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU.getPoiType().equals(poiType)) {
|
EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU.getPoiType().equals(poiType)) {
|
||||||
MarkerExploreWay noveltyInfo = content.getNoveltyInfo();
|
MarkerExploreWay noveltyInfo = content.getNoveltyInfo();
|
||||||
@@ -134,7 +126,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
CallerHmiManager.INSTANCE.warningV2X(poiType, alarmText,
|
CallerHmiManager.INSTANCE.warningV2X(poiType, alarmText,
|
||||||
ttsText, this, !entity.isOnlyShow(),
|
ttsText, this,WarningDirectionEnum.ALERT_WARNING_TOP,
|
||||||
TimeUnit.SECONDS.toMillis(5));
|
TimeUnit.SECONDS.toMillis(5));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -161,19 +153,13 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
|||||||
if (isNeedChangeAngle()) {
|
if (isNeedChangeAngle()) {
|
||||||
CallerVisualAngleManager.INSTANCE.changeVisualAngle(CallerVisualAngleManager.Scene.RoadEvent.INSTANCE);
|
CallerVisualAngleManager.INSTANCE.changeVisualAngle(CallerVisualAngleManager.Scene.RoadEvent.INSTANCE);
|
||||||
}
|
}
|
||||||
CallerHmiManager.INSTANCE.showWarning(WarningDirectionEnum.ALERT_WARNING_TOP, TimeUnit.HOURS.toMillis(1));
|
|
||||||
V2XMessageEntity<V2XRoadEventEntity> entity = getV2XMessageEntity();
|
V2XMessageEntity<V2XRoadEventEntity> entity = getV2XMessageEntity();
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
|
|
||||||
V2XRoadEventEntity content = entity.getContent();
|
V2XRoadEventEntity content = entity.getContent();
|
||||||
if (content != null) {
|
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();
|
drawPOI();
|
||||||
}
|
}
|
||||||
MarkerExploreWay noveltyInfo = content.getNoveltyInfo();
|
|
||||||
if (noveltyInfo != null && EventTypeEnumNew.FOURS_FOG.getPoiType().equals(content.getNoveltyInfo().getPoiType())) {
|
|
||||||
CallerHmiManager.INSTANCE.displayEffects();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoChas
|
|||||||
if (mMarkerEntity != null) {
|
if (mMarkerEntity != null) {
|
||||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "----- show --- 2 --:\n" + mMarkerEntity);
|
CallerLogger.INSTANCE.d(M_V2X + TAG, "----- show --- 2 --:\n" + mMarkerEntity);
|
||||||
int v2xType = getV2XTypeForFrontWarning(mMarkerEntity);
|
int v2xType = getV2XTypeForFrontWarning(mMarkerEntity);
|
||||||
V2XMessageEntity entity = getV2XMessageEntity();
|
|
||||||
if (v2xType != 0) {
|
if (v2xType != 0) {
|
||||||
if (getAlertContentForFrontWarning(mMarkerEntity).toString() == null
|
if (getAlertContentForFrontWarning(mMarkerEntity).toString() == null
|
||||||
|| getAlertContentForFrontWarning(mMarkerEntity).toString().isEmpty()
|
|| getAlertContentForFrontWarning(mMarkerEntity).toString().isEmpty()
|
||||||
@@ -82,8 +81,8 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoChas
|
|||||||
);
|
);
|
||||||
CallerHmiManager.INSTANCE.warningV2X(v2xType + "",
|
CallerHmiManager.INSTANCE.warningV2X(v2xType + "",
|
||||||
getAlertContentForFrontWarning(mMarkerEntity), mMarkerEntity.getTts(),
|
getAlertContentForFrontWarning(mMarkerEntity), mMarkerEntity.getTts(),
|
||||||
this, !entity.isOnlyShow(),
|
this,getDirection(),
|
||||||
TimeUnit.SECONDS.toMillis(3));
|
TimeUnit.SECONDS.toMillis(5));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -134,9 +133,7 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoChas
|
|||||||
sV2XWarningMarker.onCarLocationChanged2(gnssInfo);
|
sV2XWarningMarker.onCarLocationChanged2(gnssInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private WarningDirectionEnum getDirection(){
|
||||||
public void onShow() {
|
|
||||||
//预警蒙层
|
|
||||||
WarningDirectionEnum warningDirectionEnum = WarningDirectionEnum.ALERT_WARNING_ALL;
|
WarningDirectionEnum warningDirectionEnum = WarningDirectionEnum.ALERT_WARNING_ALL;
|
||||||
switch (mMarkerEntity.getDirection()) {
|
switch (mMarkerEntity.getDirection()) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -155,8 +152,13 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoChas
|
|||||||
warningDirectionEnum = WarningDirectionEnum.ALERT_WARNING_RIGHT;
|
warningDirectionEnum = WarningDirectionEnum.ALERT_WARNING_RIGHT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
CallerHmiManager.INSTANCE.showWarning(warningDirectionEnum, TimeUnit.HOURS.toMillis(1));
|
|
||||||
mDirection = warningDirectionEnum;
|
mDirection = warningDirectionEnum;
|
||||||
|
return warningDirectionEnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShow() {
|
||||||
|
//预警蒙层
|
||||||
drawPOI();
|
drawPOI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user