Merge branch 'dev_arch_opt_3.0' into dev_robosweeper-d_app-module_221230_1.1.0
# Conflicts: # OCH/mogo-och-sweeper/build.gradle # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/SweeperProvider.java # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/fragment/BaseSweeperTabFragment.java # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/fragment/SweeperFragment.java # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/model/SweeperOrderModel.java # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/presenter/SweeperPresenter.java # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/SweeperOperatePanelView.java # OCH/mogo-och-sweeper/src/main/res/layout/sweeper_base_fragment.xml
This commit is contained in:
@@ -52,12 +52,8 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||
implementation rootProject.ext.dependencies.amapnavi3dmap
|
||||
implementation project(":OCH:mogo-och-common-module")
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_v2x
|
||||
}else {
|
||||
implementation project(':foudations:mogo-aicloud-services-sdk')
|
||||
implementation project(':core:function-impl:mogo-core-function-v2x')
|
||||
}
|
||||
compileOnly project(":libraries:mogo-map")
|
||||
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
@@ -1,15 +1,13 @@
|
||||
package com.mogo.och.bus.passenger;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
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.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
|
||||
@@ -18,17 +16,13 @@ import com.mogo.och.bus.passenger.ui.BusPassengerRouteFragment;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 网约车-Bus-乘客端
|
||||
*
|
||||
* Created on 2022/3/29
|
||||
*/
|
||||
@Route(path = BusPassengerConst.PATH)
|
||||
public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener {
|
||||
public class MogoOCHBusPassenger implements IMogoOCH {
|
||||
private static final String TAG = MogoOCHBusPassenger.class.getSimpleName();
|
||||
|
||||
private FragmentActivity mActivity;
|
||||
@@ -45,8 +39,7 @@ public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener
|
||||
public Fragment createCoverage(@Nullable FragmentActivity activity, @Nullable Integer containerId) {
|
||||
this.mActivity = activity;
|
||||
this.mContainerId = containerId;
|
||||
|
||||
// UiThreadHandler.post(() -> stepIntoVrMode());
|
||||
showFragment();
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -65,18 +58,6 @@ public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener
|
||||
|
||||
@Override
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,7 +65,6 @@ public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener
|
||||
*/
|
||||
private void stepIntoVrMode() {
|
||||
CallerLogger.INSTANCE.d( M_TAXI_P + TAG, "进入vr模式" );
|
||||
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).stepInVrMode(true); // 白天模式
|
||||
CallerMoGoUiSettingManager.INSTANCE.stepInDayMode();//白天模式 状态栏字体颜色变黑
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.och.bus.passenger.callback;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
|
||||
/**
|
||||
* Created on 2022/3/31
|
||||
@@ -11,5 +11,5 @@ public interface IBusPassengerControllerStatusCallback {
|
||||
// 是否vr map模式
|
||||
void onVRModeChanged(boolean isVRMode);
|
||||
// 自车定位
|
||||
void onCarLocationChanged(MessagePad.GnssInfo location);
|
||||
void onCarLocationChanged(MogoLocation location);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
|
||||
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.CallerChassisLocationGCJ02ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
@@ -89,7 +89,7 @@ public class BusPassengerModel {
|
||||
private IBusPassegerDriverStatusCallback mDriverStatusCallback; //出车收车状态
|
||||
private IBusPassengerRouteLineInfoCallback mRouteLineInfoCallback; // bus路线信息更新
|
||||
|
||||
private MessagePad.GnssInfo mLocation = null;
|
||||
private MogoLocation mLocation = null;
|
||||
|
||||
private BusPassengerRoutesResult routesResult = null;
|
||||
|
||||
@@ -272,7 +272,7 @@ public class BusPassengerModel {
|
||||
IntentManager.getInstance().registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener );
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ20ListenerManager.INSTANCE.addListener(TAG, mMapLocationListener);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, mMapLocationListener);
|
||||
|
||||
//2021.11.1 自动驾驶路线规划接口
|
||||
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG,moGoAutopilotPlanningListener);
|
||||
@@ -284,7 +284,7 @@ public class BusPassengerModel {
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
// 注销定位监听
|
||||
CallerChassisLocationGCJ20ListenerManager.INSTANCE.removeListener(TAG);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.removeListener(TAG);
|
||||
|
||||
MogoAiCloudSocketManager.getInstance(mContext)
|
||||
.unregisterLifecycleListener(10010);
|
||||
@@ -321,7 +321,7 @@ public class BusPassengerModel {
|
||||
|
||||
private final IMoGoChassisLocationGCJ02Listener mMapLocationListener = new IMoGoChassisLocationGCJ02Listener() {
|
||||
@Override
|
||||
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
|
||||
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
|
||||
if (null == gnssInfo) return;
|
||||
mLocation = gnssInfo;
|
||||
for (IBusPassengerControllerStatusCallback callback :mControllerStatusCallbackMap.values()){
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.och.bus.passenger.presenter;
|
||||
|
||||
import android.location.Location;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
|
||||
|
||||
import android.os.Looper;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -24,10 +25,6 @@ import com.mogo.och.bus.passenger.ui.BusPassengerRouteFragment;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* Created on 2022/3/31
|
||||
*/
|
||||
@@ -112,7 +109,7 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(MessagePad.GnssInfo location) {
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
if (location != null){
|
||||
runOnUIThread(() -> mView.onCarLocationChanged(location));
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.widget.ContentLoadingProgressBar;
|
||||
|
||||
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.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.view.MapBizView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.bus.passenger.R;
|
||||
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil;
|
||||
import com.mogo.och.common.module.wigets.OCHBorderShadowLayout;
|
||||
|
||||
/**
|
||||
* 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> {
|
||||
private static final String TAG = BusPassengerBaseFragment.class.getSimpleName();
|
||||
|
||||
private MapBizView mapBizView;
|
||||
private TextView mCurrentArriveStation;
|
||||
private TextView mCurrentArriveStationTitle;
|
||||
private TextView mCurrentArriveTip;
|
||||
@@ -56,12 +57,12 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
|
||||
return TAG;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
//隐藏小地图
|
||||
CallerSmpManager.INSTANCE.hidePanel();
|
||||
|
||||
mapBizView = findViewById(R.id.mapBizView);
|
||||
mCurrentArriveStation = findViewById(R.id.bus_p_cur_station_name);
|
||||
mCurrentArriveStationTitle = findViewById(R.id.bus_p_cur_station_title);
|
||||
mCurrentArriveTip = findViewById(R.id.bus_p_cur_station_tip);
|
||||
@@ -83,6 +84,37 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
|
||||
@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();
|
||||
}
|
||||
|
||||
@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() {
|
||||
CallerHmiManager.INSTANCE.showSmallFragment();
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
CallerHmiManager.INSTANCE.hideSmallFragment();
|
||||
}
|
||||
},5000L);
|
||||
}
|
||||
|
||||
@@ -27,8 +27,9 @@ import com.amap.api.maps.model.Marker;
|
||||
import com.amap.api.maps.model.MarkerOptions;
|
||||
import com.amap.api.maps.model.Polyline;
|
||||
import com.amap.api.maps.model.PolylineOptions;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
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.CallerChassisLocationGCJ02ListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.bus.passenger.R;
|
||||
import com.mogo.och.bus.passenger.callback.IBusPassengerMapViewCallback;
|
||||
@@ -37,8 +38,6 @@ import com.mogo.och.bus.passenger.utils.BusPassengerMapAssetStyleUtil;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* 乘客屏小地图
|
||||
*/
|
||||
@@ -104,14 +103,14 @@ public class BusPassengerMapDirectionView
|
||||
initAMapView();
|
||||
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ20ListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ20ListenerManager.INSTANCE.removeListener(TAG);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.removeListener(TAG);
|
||||
}
|
||||
|
||||
private void initAMapView() {
|
||||
@@ -175,7 +174,7 @@ public class BusPassengerMapDirectionView
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
|
||||
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
|
||||
if (gnssInfo == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.elegant.utils.UiThreadHandler;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.och.bus.passenger.R;
|
||||
@@ -32,8 +32,6 @@ import com.mogo.och.common.module.wigets.MarqueeTextView;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/4/12
|
||||
@@ -299,8 +297,8 @@ public class BusPassengerRouteFragment extends
|
||||
lastBearing = bearing;
|
||||
}
|
||||
|
||||
public void onCarLocationChanged(MessagePad.GnssInfo location) {
|
||||
updateSpeedView((float) location.getVehicleSpeed());
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
updateSpeedView((float) location.getGnssSpeed());
|
||||
}
|
||||
|
||||
public void updateSpeedView(float speed){
|
||||
|
||||
@@ -6,8 +6,8 @@ import android.view.LayoutInflater
|
||||
import android.widget.LinearLayout
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.TrafficLightEnum
|
||||
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import kotlinx.android.synthetic.main.bus_p_traffic_light_view.view.*
|
||||
|
||||
@@ -4,6 +4,14 @@
|
||||
android:layout_width="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
|
||||
android:id="@+id/steering_wheel"
|
||||
android:layout_width="@dimen/dp_490"
|
||||
@@ -26,8 +34,22 @@
|
||||
app:layout_constraintLeft_toLeftOf="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行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
|
||||
@@ -51,11 +51,12 @@ dependencies {
|
||||
|
||||
implementation rootProject.ext.dependencies.rxjava
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
implementation rootProject.ext.dependencies.androidxrecyclerview
|
||||
compileOnly rootProject.ext.dependencies.recyclerviewadapterhelper
|
||||
|
||||
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()
|
||||
@@ -10,10 +10,8 @@ import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
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.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
import com.mogo.och.bus.fragment.BusFragment;
|
||||
@@ -21,8 +19,6 @@ import com.mogo.och.bus.fragment.BusFragment;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 网约车小巴业务实现入口
|
||||
*
|
||||
@@ -42,13 +38,11 @@ public class BusProvider implements IMogoOCH {
|
||||
*/
|
||||
private void stepIntoVrMode() {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "进入vr模式");
|
||||
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).stepInVrMode(false);
|
||||
CallerMoGoUiSettingManager.INSTANCE.stepInNightMode();//夜间模式 状态栏字体颜色变黑
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener("OchBus"
|
||||
, StatusDescriptor.VR_MODE, statusChangedListener);
|
||||
}
|
||||
|
||||
private void showFragment() {
|
||||
@@ -78,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
|
||||
public void createCoverage(FragmentActivity activity, int containerId) {
|
||||
|
||||
@@ -108,19 +86,15 @@ public class BusProvider implements IMogoOCH {
|
||||
@Nullable
|
||||
@Override
|
||||
public Fragment createCoverage(@Nullable FragmentActivity fragmentActivity, @Nullable Integer integer) {
|
||||
|
||||
this.containerId = integer;
|
||||
this.activity = fragmentActivity;
|
||||
|
||||
// UiThreadHandler.postDelayed(this::stepIntoVrMode, 5_000L );
|
||||
showFragment();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
//若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener("OchBus"
|
||||
, StatusDescriptor.VR_MODE, statusChangedListener);
|
||||
if (activity == null) return;
|
||||
activity.finish();
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@ package com.mogo.och.bus.callback;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* Created on 2021/9/10
|
||||
*
|
||||
@@ -13,7 +11,7 @@ public interface IBusControllerStatusCallback {
|
||||
// 是否vr map模式
|
||||
void onVRModeChanged(boolean isVRMode);
|
||||
// 自车定位
|
||||
void onCarLocationChanged(MessagePad.GnssInfo location);
|
||||
void onCarLocationChanged(MogoLocation location);
|
||||
//开始开启自动驾驶
|
||||
void startOpenAutopilot();
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@ 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.DriverMsgBoxListView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView;
|
||||
import com.mogo.eagle.core.function.smp.view.SmallMapView;
|
||||
import com.mogo.eagle.core.function.view.MapBizView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
@@ -72,6 +74,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
protected RelativeLayout mBadcaseBtn;
|
||||
protected RelativeLayout mAICollectBtn;
|
||||
private FrameLayout flStationPanelContainer;
|
||||
private MapBizView mapBizView;
|
||||
private Group groupTestPanel;
|
||||
private TrafficDataView mTrafficDataView;
|
||||
// private BusTrafficLightView mTrafficLightView;
|
||||
@@ -80,6 +83,8 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
private ImageView mSwitchMapModeImage;
|
||||
private LinearLayout mSwitchMapModeLayout;
|
||||
|
||||
protected SmallMapView smallMapView;
|
||||
|
||||
//消息盒子
|
||||
private DriverMsgBoxButtonView viewDriverMsgBoxButton;
|
||||
private DriverMsgBoxListView viewDriverMsgBoxList;
|
||||
@@ -106,6 +111,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
mapBizView = findViewById(R.id.mapBizView);
|
||||
groupTestPanel = findViewById(R.id.groupTestPanel);
|
||||
slidePanelView = findViewById(R.id.module_mogo_och_slide_panel);
|
||||
ctvAutopilotStatus = findViewById(R.id.module_mogo_och_autopilot_status);
|
||||
@@ -218,6 +224,22 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
viewDriverMsgBoxBubble.isShowData(true);
|
||||
}
|
||||
});
|
||||
|
||||
smallMapView = findViewById(R.id.smallMapView);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews(Bundle savedInstanceState) {
|
||||
super.initViews(savedInstanceState);
|
||||
mapBizView.onCreate(savedInstanceState);
|
||||
smallMapView.onCreateView(savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
mapBizView.onResume();
|
||||
smallMapView.onResume();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -247,14 +269,33 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
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();
|
||||
smallMapView.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
mapBizView.onDestroy();
|
||||
super.onDestroyView();
|
||||
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onAutopilotRecordResult(@Nullable RecordPanelOuterClass.RecordPanel recordPanel) {
|
||||
// if (!HmiBuildConfig.isShowBadCaseView && recordPanel != null && recordPanel.getType() == 1 && recordPanel.getStat() == 100) {
|
||||
@@ -266,7 +307,6 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
public void onAutopilotRecordConfig(@NonNull MessagePad.RecordDataConfig config) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 测试到站
|
||||
*/
|
||||
@@ -500,6 +540,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
smallMapView.onDestroy();
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().unregisterHostMapListener(TAG);
|
||||
}
|
||||
|
||||
|
||||
@@ -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.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
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.CallerSmpManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
@@ -435,7 +434,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
}
|
||||
|
||||
//清除鹰眼右下角小地图轨迹
|
||||
CallerSmpManager.clearPolyline();
|
||||
smallMapView.clearPolyline();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -471,7 +470,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
.latitude(lat)
|
||||
.longitude(longi);
|
||||
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);
|
||||
if (null != centerLine && marker != null) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致 地图未初始化会返回空
|
||||
marker.setRotateAngle(centerLine.getAngle().floatValue());
|
||||
|
||||
@@ -24,12 +24,13 @@ import com.mogo.commons.module.status.StatusDescriptor;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
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.CallerChassisLocationGCJ20ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
@@ -150,7 +151,7 @@ public class BusOrderModel {
|
||||
mContext = AbsMogoApplication.getApp();
|
||||
loginService = (LoginService) ARouter.getInstance().build(OchCommonConst.LOGINSERVICE).navigation();
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ20ListenerManager.INSTANCE.addListener(TAG, mMapLocationListener);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, mMapLocationListener);
|
||||
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
@@ -330,7 +331,7 @@ public class BusOrderModel {
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
// 注销定位监听
|
||||
CallerChassisLocationGCJ20ListenerManager.INSTANCE.removeListener(TAG);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.removeListener(TAG);
|
||||
|
||||
//自动驾驶路线规划接口
|
||||
CallerPlanningRottingListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
|
||||
@@ -377,7 +378,7 @@ public class BusOrderModel {
|
||||
// 自车定位
|
||||
private final IMoGoChassisLocationGCJ02Listener mMapLocationListener = new IMoGoChassisLocationGCJ02Listener() {
|
||||
@Override
|
||||
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
|
||||
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
|
||||
if (null == gnssInfo) return;
|
||||
mLongitude = gnssInfo.getLongitude();
|
||||
mLatitude = gnssInfo.getLatitude();
|
||||
@@ -393,7 +394,7 @@ public class BusOrderModel {
|
||||
};
|
||||
|
||||
//根据围栏判断,是否到达站点
|
||||
private void judgeArrivedStation(MessagePad.GnssInfo location) {
|
||||
private void judgeArrivedStation(MogoLocation location) {
|
||||
|
||||
if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) {
|
||||
CallerLogger.INSTANCE.e(M_BUS + TAG, "到站数组越界");
|
||||
@@ -634,7 +635,7 @@ public class BusOrderModel {
|
||||
return;
|
||||
}
|
||||
|
||||
CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters);
|
||||
CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters);
|
||||
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
|
||||
+ " startLatLon=" + parameters.startName + ",endLatLon=" + parameters.endName +
|
||||
@@ -778,8 +779,8 @@ public class BusOrderModel {
|
||||
public void closeBeautificationMode() {
|
||||
if (FunctionBuildConfig.isDemoMode) {//收车结束美化
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false; //是否强制绘制引导线
|
||||
CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(false);// 同步给乘客屏
|
||||
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false);//是否自动启动自驾
|
||||
CallerAutoPilotControlManager.INSTANCE.setIgnoreConditionDraw(false);// 同步给乘客屏
|
||||
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false);//是否自动启动自驾
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为false");
|
||||
}
|
||||
}
|
||||
@@ -861,7 +862,7 @@ public class BusOrderModel {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为true(每次滑动出发)");
|
||||
} else if (backgroundCurrentStationIndex > 0 && backgroundCurrentStationIndex < stationList.size() - 1) {
|
||||
//美化模式下 中间站点到站 引导线要一直绘制,所以此处不出强制绘制不传false
|
||||
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false);
|
||||
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false);
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:false(到达中间站)");
|
||||
clearStartAutopilotTag();
|
||||
} else {
|
||||
@@ -952,8 +953,8 @@ public class BusOrderModel {
|
||||
|
||||
private void startBeautificationMode() {
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true;
|
||||
CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(true);
|
||||
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(true);
|
||||
CallerAutoPilotControlManager.INSTANCE.setIgnoreConditionDraw(true);
|
||||
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(true);
|
||||
}
|
||||
|
||||
public void clearBusStationDatas() {
|
||||
@@ -992,7 +993,7 @@ public class BusOrderModel {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "单程结束====");
|
||||
CallerAutoPilotManager.INSTANCE.cancelAutoPilot();
|
||||
CallerAutoPilotControlManager.INSTANCE.cancelAutoPilot();
|
||||
|
||||
endTask();
|
||||
}
|
||||
|
||||
@@ -233,9 +233,9 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(MessagePad.GnssInfo location) {
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
if (null != location) {
|
||||
runOnUIThread(() -> mView.updateSpeedView((float) location.getVehicleSpeed()));
|
||||
runOnUIThread(() -> mView.updateSpeedView((float) location.getGnssSpeed()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.och.bus.util
|
||||
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
|
||||
@@ -31,6 +31,6 @@ object BusSendTripInfoManager{
|
||||
d(SceneConstant.M_BUS + "BusSendTripInfoManager", "type: "+ type
|
||||
+", lineName: "+ lineName +", departureStopName: "+ departureStopName
|
||||
+ ", arrivalStopName: "+arrivalStopName+", isLastStop: "+isLastStop)
|
||||
CallerAutoPilotManager.sendTripInfo(type,lineName,departureStopName, arrivalStopName, isLastStop)
|
||||
CallerAutoPilotControlManager.sendTripInfo(type,lineName,departureStopName, arrivalStopName, isLastStop)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.mogo.och.bus.util;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils;
|
||||
import com.mogo.och.bus.bean.BusRoutesResult;
|
||||
@@ -198,7 +198,7 @@ public class BusTrajectoryManager {
|
||||
// mAutoPilotLine.setTimestamp(1654761600000L); //20220609 16:00
|
||||
// mAutoPilotLine.setVehicleModel("红旗H9");
|
||||
|
||||
CallerAutoPilotManager.INSTANCE.sendTrajectoryDownloadReq(mAutoPilotLine);
|
||||
CallerAutoPilotControlManager.INSTANCE.sendTrajectoryDownloadReq(mAutoPilotLine);
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "sendTrajectoryReq(): "
|
||||
+ GsonUtils.toJson(mAutoPilotLine));
|
||||
}
|
||||
|
||||
@@ -5,35 +5,63 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_72">
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_speed"
|
||||
android:layout_width="@dimen/dp_616"
|
||||
android:layout_height="@dimen/dp_320"
|
||||
android:layout_marginLeft="@dimen/dp_13"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_speed"
|
||||
android:layout_width="@dimen/dp_616"
|
||||
android:layout_height="@dimen/dp_320"
|
||||
android:layout_marginLeft="@dimen/dp_13"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView
|
||||
android:id="@+id/bus_arc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<!--浓雾预警动画-->
|
||||
<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车辆标志-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
||||
android:layout_width="@dimen/module_vip_width"
|
||||
android:layout_height="@dimen/module_vip_height"
|
||||
android:layout_marginStart="@dimen/dp_640"
|
||||
android:layout_marginTop="@dimen/dp_80"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_640"
|
||||
android:layout_marginTop="@dimen/dp_80"/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
@@ -77,7 +105,7 @@
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
|
||||
tools:visibility="visible"/>
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!--消息盒子选择入口-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
|
||||
@@ -87,8 +115,7 @@
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="25dp"
|
||||
app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon" />
|
||||
<!--消息盒子打开视图-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView
|
||||
android:id="@+id/viewDriverMsgBoxList"
|
||||
@@ -120,7 +147,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--接管提示-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.takeover.TakeOverView
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.TakeOverView
|
||||
android:layout_width="@dimen/hmi_take_over_request_width"
|
||||
android:layout_height="@dimen/hmi_take_over_request_height"
|
||||
android:layout_marginTop="@dimen/hmi_take_over_request_m_top"
|
||||
@@ -143,12 +170,12 @@
|
||||
android:id="@+id/module_mogo_och_autopilot_status"
|
||||
android:layout_width="@dimen/module_mogo_och_autopilot_status_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_och_autopilot_status_bg_height"
|
||||
app:layout_constraintTop_toBottomOf="@+id/fl_speed"
|
||||
android:background="@drawable/bus_autopilot_status_bg"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginLeft="@dimen/dp_13"
|
||||
android:background="@drawable/bus_autopilot_status_bg"
|
||||
android:gravity="center"
|
||||
tools:visibility="visible" >
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/fl_speed"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_autopilot_btn_iv"
|
||||
@@ -175,74 +202,74 @@
|
||||
android:id="@+id/module_mogo_och_station_panel_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginLeft="@dimen/dp_13"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_autopilot_status"
|
||||
app:layout_goneMarginTop="@dimen/module_mogo_och_station_panel_container_margin_top_no_call" />
|
||||
|
||||
<include
|
||||
android:id="@+id/module_mogo_och_bus_test_bar"
|
||||
layout="@layout/bus_test_bar_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
layout="@layout/bus_test_bar_view"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_station_panel_container"
|
||||
app:layout_constraintLeft_toLeftOf="@id/module_mogo_och_station_panel_container"
|
||||
tools:visibility="visible"/>
|
||||
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_station_panel_container"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!--切换地图远近事件 @dimen/module_switch_map -->
|
||||
<LinearLayout
|
||||
android:id="@+id/bus_switch_model_layout"
|
||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||
app:layout_goneMarginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||
app:layout_goneMarginLeft="@dimen/module_mogo_och_margin_left"
|
||||
android:background="@drawable/bus_switch_map_bg"
|
||||
android:elevation="@dimen/bus_dp_10"
|
||||
android:padding="@dimen/bus_dp_20"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_mogo_och_arrived_tv"
|
||||
app:layout_constraintLeft_toRightOf="@+id/module_mogo_och_arrived_tv"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
<LinearLayout
|
||||
android:id="@+id/bus_switch_model_layout"
|
||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||
android:background="@drawable/bus_switch_map_bg"
|
||||
android:elevation="@dimen/bus_dp_10"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/bus_dp_20"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_mogo_och_arrived_tv"
|
||||
app:layout_constraintLeft_toRightOf="@+id/module_mogo_och_arrived_tv"
|
||||
app:layout_goneMarginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||
app:layout_goneMarginLeft="@dimen/module_mogo_och_margin_left">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_switch_model_icon"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="60dp" />
|
||||
</LinearLayout>
|
||||
<!-- <CheckedTextView-->
|
||||
<!-- android:id="@+id/module_mogo_och_operation_status"-->
|
||||
<!-- android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"-->
|
||||
<!-- android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"-->
|
||||
<!-- android:background="@drawable/bus_operation_status_bg"-->
|
||||
<!-- android:elevation="@dimen/dp_10"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="出车"-->
|
||||
<!-- android:textAlignment="center"-->
|
||||
<!-- android:textColor="@color/bus_autopilot_text_color_selector"-->
|
||||
<!-- android:textSize="@dimen/module_mogo_och_autopilot_status_text_size"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- android:layout_marginLeft="@dimen/module_mogo_och_margin_left"-->
|
||||
<!-- android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintLeft_toLeftOf="parent"/>-->
|
||||
<ImageView
|
||||
android:id="@+id/bus_switch_model_icon"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="60dp" />
|
||||
</LinearLayout>
|
||||
<!-- <CheckedTextView-->
|
||||
<!-- android:id="@+id/module_mogo_och_operation_status"-->
|
||||
<!-- android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"-->
|
||||
<!-- android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"-->
|
||||
<!-- android:background="@drawable/bus_operation_status_bg"-->
|
||||
<!-- android:elevation="@dimen/dp_10"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="出车"-->
|
||||
<!-- android:textAlignment="center"-->
|
||||
<!-- android:textColor="@color/bus_autopilot_text_color_selector"-->
|
||||
<!-- android:textSize="@dimen/module_mogo_och_autopilot_status_text_size"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- android:layout_marginLeft="@dimen/module_mogo_och_margin_left"-->
|
||||
<!-- android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintLeft_toLeftOf="parent"/>-->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_mogo_och_arrived_tv"
|
||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||
android:background="@drawable/bus_operation_status_bg_selector"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:text="@string/bus_arrived_str"
|
||||
android:gravity="center"
|
||||
android:text="@string/bus_arrived_str"
|
||||
android:textColor="@color/bus_autopilot_text_color_selector"
|
||||
android:textSize="@dimen/module_mogo_och_arrived_text_size"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_mogo_och_setting_layout"
|
||||
@@ -254,6 +281,7 @@
|
||||
android:elevation="@dimen/dp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/bus_switch_model_layout">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
@@ -287,8 +315,8 @@
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:background="@drawable/bus_operation_status_bg_selector"
|
||||
android:elevation="@dimen/dp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_badcase_rl">
|
||||
|
||||
@@ -378,4 +406,15 @@
|
||||
,btnAutopilotRunning,btnAutopilotRoute"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.mogo.eagle.core.function.smp.view.SmallMapView
|
||||
android:id="@+id/smallMapView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="30dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -60,19 +60,17 @@ dependencies {
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
api rootProject.ext.dependencies.mogoutils
|
||||
api rootProject.ext.dependencies.mogocommons
|
||||
api rootProject.ext.dependencies.mogo_core_data
|
||||
api rootProject.ext.dependencies.mogo_core_function_call
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_v2x
|
||||
api rootProject.ext.dependencies.mogo_core_function_hmi
|
||||
api rootProject.ext.dependencies.mogo_core_function_map
|
||||
}else {
|
||||
api project(":core:mogo-core-utils")
|
||||
api project(":foudations:mogo-commons")
|
||||
api project(':core:mogo-core-data')
|
||||
api project(':core:mogo-core-function-call')
|
||||
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-map')
|
||||
}
|
||||
|
||||
implementation project(':libraries:mogo-adas')
|
||||
compileOnly project(':libraries:mogo-adas')
|
||||
|
||||
}
|
||||
@@ -3,8 +3,9 @@ package com.mogo.och.common.module.biz.model
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
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.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils
|
||||
import com.mogo.eagle.core.utilcode.util.SharedPrefs
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
@@ -17,7 +18,6 @@ import com.mogo.och.common.module.biz.constant.TaxiLoginStatusEnum
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceManager
|
||||
import com.mogo.och.common.module.utils.ToastUtilsOch
|
||||
import mogo.telematics.pad.MessagePad
|
||||
|
||||
/**
|
||||
* Created by pangfan on 2021/8/19
|
||||
@@ -36,7 +36,7 @@ object OchCommonLoginModel : IMoGoChassisLocationGCJ02Listener {
|
||||
fun init(context: Context) {
|
||||
mContext = context.applicationContext
|
||||
// 达到起始站围栏监听
|
||||
CallerChassisLocationGCJ20ListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
fun hasInit(): Boolean {
|
||||
@@ -46,7 +46,7 @@ object OchCommonLoginModel : IMoGoChassisLocationGCJ02Listener {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) {
|
||||
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
|
||||
gnssInfo?.let {
|
||||
mLongitude = it.longitude
|
||||
mLatitude = it.latitude
|
||||
@@ -65,7 +65,7 @@ object OchCommonLoginModel : IMoGoChassisLocationGCJ02Listener {
|
||||
mContext = null
|
||||
iTaxiLoginCallback = null
|
||||
// 注销到达起始站围栏监听
|
||||
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,20 +4,14 @@ import android.content.Context;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatisticsListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotStatisticsListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.och.common.module.callback.OchAdasStartFailureCallback;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotAbility;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatistics;
|
||||
|
||||
import chassis.Chassis;
|
||||
import system_master.SystemStatusInfo;
|
||||
|
||||
/**
|
||||
* Created on 2022/10/9
|
||||
* 工控机状态信息回调(判断是否能否启动自动驾驶的回调)
|
||||
@@ -78,36 +72,9 @@ public class OCHAdasAbilityManager implements IMoGoAutopilotActionsListener, IMo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotAbility(@Nullable AutopilotAbility ability) {
|
||||
isAutopilotAbility = true;
|
||||
autopilotAbilityReason = null;
|
||||
if (ability.gear == null || ability.gear == Chassis.GearPosition.GEAR_P ||
|
||||
ability.gear == Chassis.GearPosition.GEAR_R) {
|
||||
isAutopilotAbility = false;
|
||||
autopilotAbilityReason = "挡位不正常";
|
||||
}
|
||||
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) &&
|
||||
ability.gear == Chassis.GearPosition.GEAR_N){ //bus档位不正常
|
||||
isAutopilotAbility = false;
|
||||
autopilotAbilityReason = "挡位不正常";
|
||||
}
|
||||
|
||||
if (isAutopilotAbility)
|
||||
if (ability.brake > 0) {
|
||||
isAutopilotAbility = false;
|
||||
autopilotAbilityReason = "制动踏板被踩下";
|
||||
}
|
||||
if (isAutopilotAbility)
|
||||
if (ability.statusInfo.getSysState() == SystemStatusInfo.SystemState.SYS_STARTING) {
|
||||
isAutopilotAbility = false;
|
||||
autopilotAbilityReason = "系统正在启动";
|
||||
}
|
||||
if (isAutopilotAbility)
|
||||
if (ability.statusInfo.getSysState() == SystemStatusInfo.SystemState.SYS_EXITING) {
|
||||
isAutopilotAbility = false;
|
||||
autopilotAbilityReason = "系统正在关闭";
|
||||
}
|
||||
public void onAutopilotAbility(boolean isAutopilotAbility, String unableAutopilotReason) {
|
||||
this.isAutopilotAbility = isAutopilotAbility;
|
||||
this.autopilotAbilityReason = unableAutopilotReason;
|
||||
Logger.d(TAG, "是否可以启动自动驾驶=" + isAutopilotAbility + " 原因=" + autopilotAbilityReason);
|
||||
}
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ public class CoordinateCalculateRouteUtil {
|
||||
for (MessagePad.Location m : models) {
|
||||
LatLng mogoLatLng = coordinateConverterWgsToGcj(mContext, m);
|
||||
MogoLocation location = new MogoLocation();
|
||||
location.setBearing((float) m.getHeading());
|
||||
location.setHeading((float) m.getHeading());
|
||||
location.setLatitude(mogoLatLng.latitude);
|
||||
location.setLongitude(mogoLatLng.longitude);
|
||||
list.add(location);
|
||||
@@ -231,7 +231,7 @@ public class CoordinateCalculateRouteUtil {
|
||||
*/
|
||||
public static Map<Integer,List<MogoLocation>> getRemainPointListByCompareNew(int preIndex,
|
||||
List<MogoLocation> mRoutePoints,
|
||||
MessagePad.GnssInfo realLocation) {
|
||||
MogoLocation realLocation) {
|
||||
Map<Integer,List<MogoLocation>> routePonits = new HashMap<>();
|
||||
List<MogoLocation> latePoints = new ArrayList<>(); // 剩余轨迹集合
|
||||
int currentIndex = 0; //记录疑似点
|
||||
@@ -245,8 +245,8 @@ public class CoordinateCalculateRouteUtil {
|
||||
for (int i= 0; i < mRoutePoints.size(); i++){
|
||||
MogoLocation latLng = mRoutePoints.get(i);
|
||||
//todo 先看index对应点的方向和realLocation方向是否一致, 方向角度不能过90度
|
||||
if (realLocation.getHeading() == realLocation.getHeading() - latLng.getBearing() ||
|
||||
Math.abs(realLocation.getHeading() - latLng.getBearing()) <= 90){
|
||||
if (realLocation.getHeading() == realLocation.getHeading() - latLng.getHeading() ||
|
||||
Math.abs(realLocation.getHeading() - latLng.getHeading()) <= 90){
|
||||
float diff = CoordinateUtils.calculateLineDistance(realLocation.getLongitude(),
|
||||
realLocation.getLatitude(),
|
||||
latLng.getLongitude(),latLng.getLatitude());
|
||||
@@ -276,7 +276,7 @@ public class CoordinateCalculateRouteUtil {
|
||||
}
|
||||
|
||||
public static int getArrivedPointIndexNew(int preIndex, List<MogoLocation> mRoutePoints,
|
||||
MessagePad.GnssInfo realLocation) {
|
||||
MogoLocation realLocation) {
|
||||
int currentIndex = 0; //记录疑似点 //基础点
|
||||
MogoLocation baseLatLng = mRoutePoints.get(0);
|
||||
float baseDiffDis = CoordinateUtils.calculateLineDistance(realLocation.getLongitude(),
|
||||
@@ -285,8 +285,8 @@ public class CoordinateCalculateRouteUtil {
|
||||
|
||||
for (int i = 0; i < mRoutePoints.size(); i++) {
|
||||
MogoLocation latLng = mRoutePoints.get(i);
|
||||
if (realLocation.getHeading() == realLocation.getHeading() - latLng.getBearing() ||
|
||||
Math.abs(realLocation.getHeading() - latLng.getBearing()) <= 90){
|
||||
if (realLocation.getHeading() == realLocation.getHeading() - latLng.getHeading() ||
|
||||
Math.abs(realLocation.getHeading() - latLng.getHeading()) <= 90){
|
||||
float diff = CoordinateUtils.calculateLineDistance(realLocation.getLongitude(),
|
||||
realLocation.getLatitude(),
|
||||
latLng.getLongitude(), latLng.getLatitude());
|
||||
|
||||
@@ -60,7 +60,6 @@ dependencies {
|
||||
}else {
|
||||
implementation project(":core:mogo-core-utils")
|
||||
implementation project(":foudations:mogo-commons")
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
implementation project(':core:function-impl:mogo-core-function-hmi')
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
<!--V2X预警红色边框-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
|
||||
android:id="@+id/flV2XWarningView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -39,6 +38,13 @@
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SteeringWheelView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--Vip车辆标志-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
||||
android:layout_width="@dimen/module_vip_width"
|
||||
@@ -50,7 +56,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--接管提示-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.takeover.TakeOverView
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.TakeOverView
|
||||
android:layout_width="@dimen/hmi_take_over_request_width"
|
||||
android:layout_height="@dimen/hmi_take_over_request_height"
|
||||
android:layout_marginTop="@dimen/hmi_take_over_request_m_top"
|
||||
@@ -223,7 +229,7 @@
|
||||
tools:visibility="gone" />
|
||||
|
||||
<!--左右转向灯-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.turnlight.TurnLightViewStatus
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.TurnLightViewStatus
|
||||
android:id="@+id/turnLightView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -233,7 +239,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--刹车ui-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.turnlight.BrakeViewStatus
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.BrakeViewStatus
|
||||
android:id="@+id/brakeView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -243,7 +249,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
|
||||
@@ -51,9 +51,12 @@ dependencies {
|
||||
|
||||
implementation rootProject.ext.dependencies.rxjava
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
implementation rootProject.ext.dependencies.androidxcardview
|
||||
implementation project(":OCH:mogo-och-common-module")
|
||||
implementation rootProject.ext.dependencies.androidxrecyclerview
|
||||
implementation rootProject.ext.dependencies.androidxcardview
|
||||
|
||||
implementation project(":OCH:mogo-och-common-module")
|
||||
compileOnly project(":libraries:mogo-map")
|
||||
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.mogo.och.sweeper;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_SWEEPER;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
@@ -8,10 +7,6 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
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.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.och.sweeper.constant.SweeperConst;
|
||||
@@ -34,21 +29,8 @@ public class SweeperProvider implements IMogoOCH {
|
||||
private int containerId;
|
||||
private FragmentActivity activity;
|
||||
|
||||
/**
|
||||
* 进入鹰眼模式,设置手势缩放地图失效
|
||||
*/
|
||||
private void stepIntoVrMode(){
|
||||
CallerLogger.INSTANCE.d( M_SWEEPER + TAG, "进入vr模式" );
|
||||
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
||||
if (controller != null) {
|
||||
controller.stepInVrMode(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener("OchSweeper"
|
||||
, StatusDescriptor.VR_MODE, statusChangedListener);
|
||||
}
|
||||
|
||||
private void showFragment() {
|
||||
@@ -70,22 +52,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
|
||||
public void createCoverage(FragmentActivity activity, int containerId) {
|
||||
|
||||
@@ -100,11 +66,9 @@ public class SweeperProvider implements IMogoOCH {
|
||||
@Nullable
|
||||
@Override
|
||||
public Fragment createCoverage(@Nullable FragmentActivity fragmentActivity, @Nullable Integer integer) {
|
||||
|
||||
this.containerId = integer;
|
||||
this.activity = fragmentActivity;
|
||||
|
||||
// UiThreadHandler.postDelayed(this::stepIntoVrMode, 5_000L );
|
||||
showFragment();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.och.sweeper.callback;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
|
||||
/**
|
||||
* Created on 2021/9/10
|
||||
@@ -11,7 +11,7 @@ public interface ISweeperControllerStatusCallback {
|
||||
// 是否vr map模式
|
||||
void onVRModeChanged(boolean isVRMode);
|
||||
// 自车定位
|
||||
void onCarLocationChanged(MessagePad.GnssInfo location);
|
||||
void onCarLocationChanged(MogoLocation location);
|
||||
//开始开启自动驾驶
|
||||
void startOpenAutopilot();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
package com.mogo.och.sweeper.fragment;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
|
||||
import static com.mogo.och.sweeper.constant.SweeperConst.TIMER_START_AUTOPILOT_INTERVAL;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
@@ -18,6 +24,9 @@ import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
||||
import com.mogo.eagle.core.function.smp.view.SmallMapView;
|
||||
import com.mogo.eagle.core.function.view.MapBizView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
@@ -39,7 +48,7 @@ import com.mogo.och.sweeper.view.SweeperWorkModeView;
|
||||
public abstract class BaseSweeperTabFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> implements IMogoMapListener,
|
||||
View.OnClickListener {
|
||||
|
||||
private static final String TAG = "BaseOchFragment";
|
||||
private static final String TAG = "BaseSweeperTabFragment";
|
||||
//地图放大缩小
|
||||
private ImageView mSwitchMapModeImage;
|
||||
private FrameLayout mSwitchMapModeLayout;
|
||||
@@ -51,6 +60,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
protected FrameLayout mAICollectBtn;
|
||||
//任务列表面板
|
||||
private FrameLayout flTaskListPanelContainer;
|
||||
private MapBizView mapBizView;
|
||||
private Group groupTestPanel;
|
||||
//清扫车车辆基本信息 速度 档位 转向灯 红绿灯等
|
||||
private SweeperTrafficDataView mTrafficDataView;
|
||||
@@ -67,6 +77,8 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
//
|
||||
private ImageView mRefreshNavi;
|
||||
|
||||
private SmallMapView smallMapView;
|
||||
|
||||
public static final String TYPE_ENTRANCE = "entrance";
|
||||
public boolean isAnimateRunning = false;
|
||||
|
||||
@@ -79,6 +91,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
mapBizView = findViewById(R.id.mapBizView);
|
||||
groupTestPanel = findViewById(R.id.groupTestPanel);
|
||||
mGroupNaviPanel = findViewById(R.id.group_navi_panel);
|
||||
flTaskListPanelContainer = findViewById(R.id.module_mogo_och_task_list_container);
|
||||
@@ -111,6 +124,8 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
findViewById(R.id.btnAutopilotRunning).setOnClickListener(view ->
|
||||
debugAutoPilotStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING)
|
||||
);
|
||||
|
||||
smallMapView = findViewById(R.id.smallMapView);
|
||||
}
|
||||
|
||||
private void updateSwitchMapIcon() {
|
||||
@@ -124,11 +139,47 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_medium);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews(Bundle savedInstanceState) {
|
||||
super.initViews(savedInstanceState);
|
||||
mapBizView.onCreate(savedInstanceState);
|
||||
smallMapView.onCreateView(savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
smallMapView.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
mapBizView.onResume();
|
||||
smallMapView.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() {
|
||||
BDRouteDataTestUtils.converToRouteData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
mapBizView.onDestroy();
|
||||
super.onDestroyView();
|
||||
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
|
||||
}
|
||||
@@ -226,6 +277,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
smallMapView.onDestroy();
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().unregisterHostMapListener(TAG);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ import android.os.Looper;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoSweeperFutianCleanSystemListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
@@ -122,9 +124,9 @@ public class SweeperPresenter extends Presenter<SweeperFragment>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(MessagePad.GnssInfo location) {
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
if (null != location) {
|
||||
runOnUIThread(() -> mView.updateSpeedView((float) location.getVehicleSpeed()));
|
||||
runOnUIThread(() -> mView.updateSpeedView((float) location.getGnssSpeed()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,13 @@ import android.widget.CheckedTextView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoSweeperFutianCleanSystemListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerSweeperFutianCleanSystemListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
@@ -24,8 +30,6 @@ import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import chassis.ChassisStatesOuterClass;
|
||||
import chassis.SpecialVehicleTaskCmdOuterClass;
|
||||
|
||||
@@ -817,7 +821,7 @@ public class SweeperOperatePanelView extends LinearLayout {
|
||||
// onSendCmd
|
||||
mCurrentCmdRequestCallback.onSendCmd();
|
||||
// 发送命令
|
||||
CallerAutoPilotManager.INSTANCE.sendSweeperFuTianTaskCmd(fuTianCleanCmd);
|
||||
CallerAutoPilotControlManager.INSTANCE.sendSweeperFuTianTaskCmd(fuTianCleanCmd);
|
||||
// log发送命令
|
||||
logSweeperCmdValue(fuTianCleanCmd);
|
||||
// 开启倒计时
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.mogo.och.sweeper.util;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils;
|
||||
import com.mogo.och.sweeper.bean.SweeperRoutesResult;
|
||||
@@ -197,7 +197,7 @@ public class SweeperTrajectoryManager {
|
||||
// mAutoPilotLine.setTimestamp(1654761600000L); //20220609 16:00
|
||||
// mAutoPilotLine.setVehicleModel("红旗H9");
|
||||
|
||||
CallerAutoPilotManager.INSTANCE.sendTrajectoryDownloadReq(mAutoPilotLine);
|
||||
CallerAutoPilotControlManager.INSTANCE.sendTrajectoryDownloadReq(mAutoPilotLine);
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "sendTrajectoryReq(): "
|
||||
+ GsonUtils.toJson(mAutoPilotLine));
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.LimitingVelocityView_TAG
|
||||
import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerViewLimitingVelocityListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
|
||||
import com.mogo.och.sweeper.R
|
||||
import kotlinx.android.synthetic.main.sweeper_limiting_speed.view.*
|
||||
|
||||
@@ -29,7 +29,7 @@ class SweeperLimitingVelocityView(
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerViewLimitingVelocityListenerManager.addListener(TAG, this)
|
||||
CallerLimitingVelocityListenerManager.addListener(TAG, this)
|
||||
CallerHmiViewControlListenerManager.addListener(LimitingVelocityView_TAG, this)
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ class SweeperLimitingVelocityView(
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerViewLimitingVelocityListenerManager.removeListener(TAG)
|
||||
CallerLimitingVelocityListenerManager.removeListener(TAG)
|
||||
CallerHmiViewControlListenerManager.removeListener(LimitingVelocityView_TAG)
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import android.view.LayoutInflater
|
||||
import android.widget.LinearLayout
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.TrafficLightEnum
|
||||
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.sweeper.R
|
||||
import kotlinx.android.synthetic.main.sweeper_traffic_light_view.view.*
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_72"
|
||||
android:id="@+id/sweeper_root_View">
|
||||
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<!--车辆基本交通信息-->
|
||||
<com.mogo.och.sweeper.view.SweeperTrafficDataView
|
||||
android:id="@+id/sweeper_arc"
|
||||
@@ -14,16 +20,82 @@
|
||||
android:layout_marginLeft="@dimen/dp_13"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="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车辆标志-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
||||
android:layout_width="@dimen/module_vip_width"
|
||||
android:layout_height="@dimen/module_vip_height"
|
||||
android:layout_marginStart="@dimen/dp_640"
|
||||
android:layout_marginTop="@dimen/dp_80"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!--APP、MAP版本-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.VersionNameView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="45dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!--超视距-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.CameraView
|
||||
android:id="@+id/ivCameraIcon"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginTop="45dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
app:layout_constraintRight_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!--接管提示-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.TakeOverView
|
||||
android:layout_width="@dimen/hmi_take_over_request_width"
|
||||
android:layout_height="@dimen/hmi_take_over_request_height"
|
||||
android:layout_marginTop="@dimen/hmi_take_over_request_m_top"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<!--清扫模式面板-->
|
||||
<com.mogo.och.sweeper.view.SweeperWorkModeView
|
||||
android:id="@+id/sweeper_cl_work_mode"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_41"
|
||||
android:background="@drawable/bg_shape_work_mode"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sweeper_arc"
|
||||
android:visibility="gone"/>
|
||||
<com.mogo.och.sweeper.view.SweeperWorkModeView
|
||||
android:id="@+id/sweeper_cl_work_mode"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_41"
|
||||
android:background="@drawable/bg_shape_work_mode"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sweeper_arc"
|
||||
android:visibility="gone"/>
|
||||
<!--清扫任务当前面板-->
|
||||
<com.mogo.och.sweeper.view.SweeperCurrentTaskInfoView
|
||||
android:id="@+id/sweeper_current_task_view"
|
||||
@@ -60,7 +132,7 @@
|
||||
app:layout_constraintTop_toTopOf="@id/sweeper_cl_work_mode"
|
||||
tools:visibility="visible" />
|
||||
<!--切换地图远近事件-->
|
||||
<FrameLayout
|
||||
<LinearLayout
|
||||
android:id="@+id/sweeper_switch_model_layout"
|
||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
@@ -78,7 +150,26 @@
|
||||
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>
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/module_mogo_och_badcase_rl"
|
||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||
android:background="@drawable/sweeper_operation_status_bg_selector"
|
||||
android:elevation="@dimen/dp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_setting_layout">
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/bad_case_selector" />
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
@@ -99,23 +190,6 @@
|
||||
/>
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/module_mogo_och_badcase_rl"
|
||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||
android:background="@drawable/sweeper_operation_status_bg_selector"
|
||||
android:elevation="@dimen/dp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_setting_layout">
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/bad_case_selector" />
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/module_mogo_och_ai_collet_rl"
|
||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||
@@ -210,52 +284,15 @@
|
||||
,btnAutopilotRunning"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!--Vip车辆标志-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
||||
android:layout_width="@dimen/module_vip_width"
|
||||
android:layout_height="@dimen/module_vip_height"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_640"
|
||||
android:layout_marginTop="@dimen/dp_80"/>
|
||||
|
||||
<!--接管提示-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.takeover.TakeOverView
|
||||
android:layout_width="@dimen/hmi_take_over_request_width"
|
||||
android:layout_height="@dimen/hmi_take_over_request_height"
|
||||
android:layout_marginTop="@dimen/hmi_take_over_request_m_top"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||
<com.mogo.eagle.core.function.smp.view.SmallMapView
|
||||
android:id="@+id/smallMapView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
android:layout_marginRight="30dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
/>
|
||||
|
||||
<!--超视距-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.CameraView
|
||||
android:id="@+id/ivCameraIcon"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginTop="45dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
app:layout_constraintRight_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!--APP、MAP版本-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.VersionNameView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="45dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -55,11 +55,8 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.amapsearch
|
||||
|
||||
implementation project(":OCH:mogo-och-common-module")
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_v2x
|
||||
}else {
|
||||
implementation project(':core:function-impl:mogo-core-function-v2x')
|
||||
}
|
||||
compileOnly project(":libraries:mogo-map")
|
||||
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
@@ -11,7 +11,7 @@ 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.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.taxi.passenger.constant.TaxiPassengerConst;
|
||||
import com.mogo.och.taxi.passenger.ui.TaxiPassengerBaseFragment;
|
||||
@@ -19,8 +19,6 @@ import com.mogo.och.taxi.passenger.ui.TaxiPassengerBaseFragment;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -29,7 +27,7 @@ public
|
||||
* 网约车-出租车-乘客端
|
||||
*/
|
||||
@Route(path = TaxiPassengerConst.PATH)
|
||||
class MogoOCHTaxiPassenger implements IMogoOCH, IMogoStatusChangedListener {
|
||||
class MogoOCHTaxiPassenger implements IMogoOCH {
|
||||
|
||||
private static final String TAG = "MogoOCHTaxiPassenger";
|
||||
private TaxiPassengerBaseFragment ochTaxiPassengerFragment;
|
||||
@@ -39,7 +37,6 @@ class MogoOCHTaxiPassenger implements IMogoOCH, IMogoStatusChangedListener {
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "init");
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener("ochTaxi", StatusDescriptor.VR_MODE, this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -47,8 +44,7 @@ class MogoOCHTaxiPassenger implements IMogoOCH, IMogoStatusChangedListener {
|
||||
*/
|
||||
private void stepIntoVrMode() {
|
||||
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "进入vr模式");
|
||||
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController())
|
||||
.stepInVrMode(false);
|
||||
CallerMoGoUiSettingManager.INSTANCE.stepInNightMode();//夜间模式 状态栏字体颜色变黑
|
||||
}
|
||||
|
||||
private void showFragment() {
|
||||
@@ -68,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
|
||||
public void createCoverage(FragmentActivity activity, int containerId) {
|
||||
|
||||
@@ -95,15 +80,13 @@ class MogoOCHTaxiPassenger implements IMogoOCH, IMogoStatusChangedListener {
|
||||
public Fragment createCoverage(@Nullable FragmentActivity fragmentActivity, @Nullable Integer integer) {
|
||||
this.mActivity = fragmentActivity;
|
||||
this.mContainerId = integer;
|
||||
|
||||
// UiThreadHandler.postDelayed(() -> stepIntoVrMode(), 5_000L);
|
||||
showFragment();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
// 若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener("ochTaxi", StatusDescriptor.VR_MODE, this);
|
||||
if (mActivity == null) return;
|
||||
mActivity.finish();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.och.taxi.passenger.callback;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
|
||||
/**
|
||||
* Created on 2021/9/10
|
||||
@@ -11,5 +11,5 @@ public interface IOCHTaxiPassengerControllerStatusCallback {
|
||||
// 是否vr map模式
|
||||
void onVRModeChanged(boolean isVRMode);
|
||||
// 自车定位
|
||||
void onCarLocationChanged(MessagePad.GnssInfo location);
|
||||
void onCarLocationChanged(MogoLocation location);
|
||||
}
|
||||
|
||||
@@ -32,9 +32,9 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Liste
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener;
|
||||
import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
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.CallerChassisLocationGCJ20ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager;
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager;
|
||||
@@ -128,7 +128,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
private int delayTime = 2;
|
||||
|
||||
private double mLongitude, mLatitude;
|
||||
private MessagePad.GnssInfo mLocation = null;
|
||||
private MogoLocation mLocation = null;
|
||||
|
||||
private List<MogoLocation> mLocationsModels = new ArrayList<>();
|
||||
|
||||
@@ -241,7 +241,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
IntentManager.getInstance().registerIntentListener( ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ20ListenerManager.INSTANCE.addListener(TAG,mMapLocationListener);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,mMapLocationListener);
|
||||
|
||||
//2021.11.1 自动驾驶路线规划接口
|
||||
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG,moGoAutopilotPlanningListener);
|
||||
@@ -261,7 +261,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
// 注销定位监听
|
||||
CallerChassisLocationGCJ20ListenerManager.INSTANCE.removeListener(TAG);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.removeListener(TAG);
|
||||
|
||||
MogoAiCloudSocketManager.getInstance(mContext)
|
||||
.unregisterLifecycleListener(10010);
|
||||
@@ -436,7 +436,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
}
|
||||
|
||||
// TODO: 2021/9/12
|
||||
public void calculateTravelDistance(MessagePad.GnssInfo carLocation){
|
||||
public void calculateTravelDistance(MogoLocation carLocation){
|
||||
if (checkCurrentOCHOrder() && mCurrentOCHOrder.endSiteGcjPoint.size()>0) {
|
||||
double endLon = mCurrentOCHOrder.endSiteGcjPoint.get(0);
|
||||
double endLat = mCurrentOCHOrder.endSiteGcjPoint.get(1);
|
||||
@@ -477,7 +477,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
// 自车定位
|
||||
private final IMoGoChassisLocationGCJ02Listener mMapLocationListener = new IMoGoChassisLocationGCJ02Listener() {
|
||||
@Override
|
||||
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
|
||||
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
|
||||
//位置变化时,通过围栏判断是否到达x点
|
||||
if (null == gnssInfo) return;
|
||||
if (checkCurrentOCHOrder()) {
|
||||
@@ -713,6 +713,11 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
*/
|
||||
private final ILimitingVelocityListener limitingVelocityListener = new ILimitingVelocityListener(){
|
||||
|
||||
@Override
|
||||
public void onUnion(int limitingVelocity, @NonNull DataSourceType sourceType) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLimitingVelocityChange(int limitingVelocity, DataSourceType dataSourceType) {
|
||||
if (mVeloctityCallback != null){
|
||||
@@ -973,7 +978,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
return;
|
||||
}
|
||||
|
||||
CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters);
|
||||
CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters);
|
||||
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "start autopilot with parameter: %s"
|
||||
, GsonUtil.jsonFromObject(parameters)
|
||||
+ " ,startSiteName=" + mCurrentOCHOrder.startSiteAddr
|
||||
|
||||
@@ -122,7 +122,7 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(MessagePad.GnssInfo location) {
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
// 速度不用展示
|
||||
// LeftMenuOpen.INSTANCE.callCallBack(-1,-1,location.getSpeed());
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
@@ -139,7 +140,7 @@ public class TaxiPassengerServingOrderPresenter extends Presenter<TaxiPassengerS
|
||||
private static final long TIMEINTERVAL = 4000;
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(MessagePad.GnssInfo location) {
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
if (location != null){
|
||||
runOnUIThread(() -> mView.onCarLocationChanged(location));
|
||||
long currentTimeMillis = System.currentTimeMillis();
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.mogo.och.taxi.passenger.ui
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.mogo.commons.mvp.BaseFragment
|
||||
import com.mogo.eagle.core.function.view.OverMapView
|
||||
|
||||
class OverviewFragment : BaseFragment() {
|
||||
|
||||
private var overmapview: OverMapView?=null
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
if (overmapview == null) {
|
||||
overmapview = OverMapView(requireContext())
|
||||
} else {
|
||||
val viewGroup = overmapview?.parent as ViewGroup
|
||||
viewGroup.removeView(overmapview)
|
||||
}
|
||||
overmapview?.onCreateView(savedInstanceState)
|
||||
return overmapview!!
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
overmapview?.onResume()
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
overmapview?.onPause()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
overmapview?.onDestroy()
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return 0
|
||||
}
|
||||
|
||||
override fun getTagName(): String {
|
||||
return TAG
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
|
||||
}
|
||||
|
||||
companion object{
|
||||
private const val TAG = "OverviewFragment"
|
||||
@JvmStatic
|
||||
fun newInstance(): OverviewFragment {
|
||||
val args = Bundle()
|
||||
val fragment = OverviewFragment()
|
||||
fragment.arguments = args
|
||||
return fragment
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,12 +16,12 @@ import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxBubbleView;
|
||||
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.view.MapBizView;
|
||||
import com.mogo.eagle.core.utilcode.util.OverlayViewUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
@@ -54,6 +54,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
|
||||
static final String TAG = "TaxiPassengerBaseFragment";
|
||||
|
||||
private MapBizView mapBizView;
|
||||
private ImageView mAutopilotImage;
|
||||
private ImageView mMapswitchBtn;
|
||||
|
||||
@@ -61,6 +62,8 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
private WeakReference<TaxiPassengerCheckView> mArrivedCheckView;
|
||||
private WeakReference<TaxiPassengerStartAutopilotView> mStartAutopilotView;
|
||||
protected TaxiPassengerServingOrderFragment ochServingOrderFragment = null;
|
||||
|
||||
protected OverviewFragment overviewFragment = null;
|
||||
//消息盒子
|
||||
private PassengerMsgBoxButtonView viewPassengerMsgBoxButton;
|
||||
private PassengerMsgBoxBubbleView viewPassengerMsgBoxBubble;
|
||||
@@ -90,6 +93,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
|
||||
hideEagleConfig();
|
||||
|
||||
mapBizView = findViewById(R.id.mapBizView);
|
||||
mAutopilotImage = findViewById(R.id.module_och_autopilot_iv);
|
||||
mMapswitchBtn = findViewById(R.id.module_och_taxi_swich_map_iv);
|
||||
updateSwitchMapIcon();
|
||||
@@ -118,6 +122,12 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews(Bundle savedInstanceState) {
|
||||
super.initViews(savedInstanceState);
|
||||
mapBizView.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
private void updateSwitchMapIcon() {
|
||||
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
||||
if (controller != null) {
|
||||
@@ -149,6 +159,12 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
}
|
||||
//OverlayLeftViewUtils.INSTANCE.dismissOverlayView();
|
||||
});
|
||||
findViewById(R.id.iv_temp).setOnClickListener(view -> {
|
||||
OverlayLeftViewUtils.INSTANCE.showOverlayView(getActivity(),0,true,-1,true);
|
||||
//showOrHideArrivedEndLayout(true, "北京北京北京", "1527481606997577728");
|
||||
//showOrHidePressengerCheckPager(true, "开始站点开", "开始站点开始站点开始", "2", "京A888888", "18811539480");
|
||||
//OCHFloatWindowManager.getInstance().ShowFloatWindow(getContext());
|
||||
});
|
||||
}
|
||||
|
||||
private void initArrivedView() {
|
||||
@@ -172,6 +188,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
mapBizView.onResume();
|
||||
// mPresenter.startOrStopOrderLoop();
|
||||
// showOrHideServingOrderFragment(true,false);
|
||||
// showOrHideStartAutopilotView(true,true);
|
||||
@@ -241,8 +258,27 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
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
|
||||
public void onDestroyView() {
|
||||
mapBizView.onDestroy();
|
||||
super.onDestroyView();
|
||||
EventBus.getDefault().unregister(this);
|
||||
removeListener();
|
||||
@@ -258,10 +294,12 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void changeOverview(UIStatus uiStatus) {
|
||||
if (uiStatus.status == UIStatus.LIVE) {
|
||||
CallerHmiManager.INSTANCE.hideSmallFragment();
|
||||
// CallerHmiManager.INSTANCE.hideSmallFragment();
|
||||
showOrHideOverMapViewFragment(false);
|
||||
showOrHideServingOrderFragment(true, false);
|
||||
} else if (uiStatus.status == UIStatus.OVERVIEW) {
|
||||
CallerHmiManager.INSTANCE.showSmallFragment();
|
||||
// CallerHmiManager.INSTANCE.showSmallFragment();
|
||||
showOrHideOverMapViewFragment(true);
|
||||
showOrHideServingOrderFragment(false, false);
|
||||
}
|
||||
}
|
||||
@@ -281,7 +319,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
if (isShow) {
|
||||
if (ochServingOrderFragment == null) {
|
||||
ochServingOrderFragment = new TaxiPassengerServingOrderFragment().newInstance();
|
||||
ochServingOrderFragment = TaxiPassengerServingOrderFragment.newInstance();
|
||||
}
|
||||
if (showOrHideLefeMenu) {
|
||||
OverlayLeftViewUtils.INSTANCE.showOverlayView(getActivity(), 0, true, -1, true);
|
||||
@@ -311,7 +349,39 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
}
|
||||
if (showOrHideLefeMenu) {
|
||||
OverlayLeftViewUtils.INSTANCE.dismissOverlayView(true);
|
||||
CallerHmiManager.INSTANCE.hideSmallFragment();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示或隐藏全局概览
|
||||
*
|
||||
* @param isShow
|
||||
*/
|
||||
public void showOrHideOverMapViewFragment(boolean isShow) {
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
if (isShow) {
|
||||
if (overviewFragment == null) {
|
||||
overviewFragment = OverviewFragment.newInstance();
|
||||
}
|
||||
if (overviewFragment.isHidden()) {
|
||||
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
|
||||
.show(overviewFragment).commitAllowingStateLoss();
|
||||
return;
|
||||
}
|
||||
if (overviewFragment.isAdded()) {
|
||||
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
|
||||
.show(overviewFragment).commitAllowingStateLoss();
|
||||
return;
|
||||
}
|
||||
transaction
|
||||
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
|
||||
.add(R.id.fl_container_overview, overviewFragment)
|
||||
.show(overviewFragment).commitAllowingStateLoss();
|
||||
} else {
|
||||
if (overviewFragment != null) {
|
||||
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_CLOSE)
|
||||
.hide(overviewFragment).commitAllowingStateLoss();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,8 +29,9 @@ import com.amap.api.maps.model.MarkerOptions;
|
||||
import com.amap.api.maps.model.Polyline;
|
||||
import com.amap.api.maps.model.PolylineOptions;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
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.CallerChassisLocationGCJ02ListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.taxi.passenger.R;
|
||||
import com.mogo.och.taxi.passenger.callback.ITaxiPassengerMapViewCallback;
|
||||
@@ -39,8 +40,6 @@ import com.mogo.och.taxi.passenger.utils.TaxiPassengerMapAssetStyleUtil;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* 乘客屏小地图
|
||||
*/
|
||||
@@ -105,14 +104,14 @@ public class TaxiPassengerMapDirectionView
|
||||
initAMapView();
|
||||
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ20ListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ20ListenerManager.INSTANCE.removeListener(TAG);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.removeListener(TAG);
|
||||
}
|
||||
|
||||
private void initAMapView() {
|
||||
@@ -180,7 +179,7 @@ public class TaxiPassengerMapDirectionView
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
|
||||
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
|
||||
if (gnssInfo == null){
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
@@ -42,8 +43,6 @@ import com.mogo.och.taxi.passenger.utils.TPRouteDataTestUtils;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/3/8
|
||||
@@ -352,8 +351,8 @@ public class TaxiPassengerServingOrderFragment extends
|
||||
|
||||
}
|
||||
|
||||
public void onCarLocationChanged(MessagePad.GnssInfo location) {
|
||||
updateSpeedView((float) location.getVehicleSpeed());
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
updateSpeedView((float) location.getGnssSpeed());
|
||||
}
|
||||
|
||||
public void onLimitingVelocityChange(int limitingVelocity) {
|
||||
|
||||
@@ -6,8 +6,8 @@ import android.view.LayoutInflater
|
||||
import android.widget.LinearLayout
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.TrafficLightEnum
|
||||
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import kotlinx.android.synthetic.main.taxi_p_traffic_light_view.view.*
|
||||
|
||||
@@ -3,15 +3,19 @@
|
||||
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:layout_marginTop="@dimen/dp_72">
|
||||
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
|
||||
android:id="@+id/steering_wheel"
|
||||
android:layout_width="@dimen/dp_630"
|
||||
android:layout_height="@dimen/dp_630"
|
||||
android:layout_marginLeft="-59dp"
|
||||
android:layout_marginTop="-40dp"
|
||||
android:layout_marginTop="@dimen/dp_32"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -21,15 +25,29 @@
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginLeft="40dp"
|
||||
android:layout_marginTop="48dp"
|
||||
android:layout_marginTop="@dimen/dp_120"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/taxi_p_un_auto_nor"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="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行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
@@ -96,6 +114,7 @@
|
||||
android:id="@+id/btnAutopilotDisable"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_72"
|
||||
android:text="模拟 不可自动驾驶"
|
||||
android:textSize="20sp"
|
||||
android:visibility="gone"
|
||||
@@ -154,7 +173,7 @@
|
||||
android:id="@+id/module_mogo_och_navi_panel_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_120"
|
||||
android:layout_marginTop="@dimen/dp_192"
|
||||
android:layout_marginRight="@dimen/dp_10"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -163,10 +182,15 @@
|
||||
android:id="@+id/traffic_light_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/taxi_p_traffic_light_layout_margin_top"
|
||||
android:layout_marginTop="@dimen/dp_95"
|
||||
android:layout_marginRight="@dimen/taxi_p_traffic_light_layout_margin_right"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_container_overview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -53,12 +53,8 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.amapnavi3dmap
|
||||
|
||||
implementation project(":OCH:mogo-och-common-module")
|
||||
compileOnly project(":libraries:mogo-map")
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_v2x
|
||||
}else {
|
||||
implementation project(':core:function-impl:mogo-core-function-v2x')
|
||||
}
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
@@ -8,10 +8,7 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
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.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.taxi.constant.TaxiConst;
|
||||
import com.mogo.och.taxi.ui.TaxiFragment;
|
||||
@@ -19,8 +16,6 @@ import com.mogo.och.taxi.ui.TaxiFragment;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -29,7 +24,7 @@ public
|
||||
* 网约车-出租车
|
||||
*/
|
||||
@Route( path = TaxiConst.PATH )
|
||||
class TaxiProvider implements IMogoOCH , IMogoStatusChangedListener {
|
||||
class TaxiProvider implements IMogoOCH {
|
||||
|
||||
private static final String TAG = "TaxiProvider";
|
||||
private TaxiFragment ochTaxiFragment;
|
||||
@@ -38,7 +33,6 @@ class TaxiProvider implements IMogoOCH , IMogoStatusChangedListener {
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
CallerLogger.INSTANCE.d( M_TAXI + TAG, "init" );
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener("ochTaxi", StatusDescriptor.VR_MODE,this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -46,7 +40,7 @@ class TaxiProvider implements IMogoOCH , IMogoStatusChangedListener {
|
||||
*/
|
||||
private void stepIntoVrMode() {
|
||||
CallerLogger.INSTANCE.d( M_TAXI + TAG, "进入vr模式" );
|
||||
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).stepInVrMode(false);
|
||||
CallerMoGoUiSettingManager.INSTANCE.stepInNightMode();//夜间模式 状态栏字体颜色变黑
|
||||
}
|
||||
|
||||
private void showFragment() {
|
||||
@@ -66,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
|
||||
public void createCoverage(FragmentActivity activity, int containerId) {
|
||||
|
||||
@@ -93,13 +76,13 @@ class TaxiProvider implements IMogoOCH , IMogoStatusChangedListener {
|
||||
public Fragment createCoverage(@Nullable FragmentActivity fragmentActivity, @Nullable Integer integer) {
|
||||
this.mActivity = fragmentActivity;
|
||||
this.mContainerId = integer;
|
||||
showFragment();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
//若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener("ochTaxi", StatusDescriptor.VR_MODE,this);
|
||||
if (mActivity == null) return;
|
||||
mActivity.finish();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.och.taxi.callback;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
|
||||
/**
|
||||
* Created on 2021/9/10
|
||||
@@ -11,7 +11,7 @@ public interface ITaxiControllerStatusCallback {
|
||||
// 是否vr map模式
|
||||
void onVRModeChanged(boolean isVRMode);
|
||||
// 自车定位
|
||||
void onCarLocationChanged(MessagePad.GnssInfo location);
|
||||
void onCarLocationChanged(MogoLocation location);
|
||||
//开始开启自动驾驶
|
||||
void startOpenAutopilot();
|
||||
}
|
||||
|
||||
@@ -30,9 +30,9 @@ import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
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.CallerChassisLocationGCJ20ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
@@ -133,7 +133,7 @@ public class TaxiModel {
|
||||
private int mPreRouteIndex = 0;
|
||||
|
||||
private double mLongitude, mLatitude;
|
||||
private MessagePad.GnssInfo mLocation = null;
|
||||
private MogoLocation mLocation = null;
|
||||
|
||||
private LoginService loginService;
|
||||
|
||||
@@ -223,7 +223,7 @@ public class TaxiModel {
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
//定位监听, 传false是高德坐标系
|
||||
CallerChassisLocationGCJ20ListenerManager.INSTANCE.addListener(TAG,mMapLocationLIstener);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,mMapLocationLIstener);
|
||||
|
||||
//2021.11.1 自动驾驶路线规划接口
|
||||
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
|
||||
@@ -262,7 +262,7 @@ public class TaxiModel {
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
// 注销地图监听
|
||||
CallerChassisLocationGCJ20ListenerManager.INSTANCE.removeListener(TAG);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.removeListener(TAG);
|
||||
|
||||
OCHSocketMessageManager.INSTANCE.releaseSocketMessageListener(OCHSocketMessageManager.msgMonitorType);
|
||||
|
||||
@@ -823,8 +823,8 @@ public class TaxiModel {
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
// 当美化模式(演示模式)开启时: 订单对应自动驾驶开启后,置true
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true;
|
||||
CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(true);
|
||||
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(true);
|
||||
CallerAutoPilotControlManager.INSTANCE.setIgnoreConditionDraw(true);
|
||||
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(true);
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore:置为true(更新本地order信息)");
|
||||
}
|
||||
|
||||
@@ -833,7 +833,7 @@ public class TaxiModel {
|
||||
if (mCurrentOCHOrder.orderStatus == TaxiOrderStatusEnum.ArriveAtEnd.getCode()){
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "setIPCDemoMode:false");
|
||||
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false);
|
||||
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false);
|
||||
}
|
||||
|
||||
clearAutopilotControlParameters();
|
||||
@@ -870,8 +870,8 @@ public class TaxiModel {
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
// 当美化模式(演示模式)开启时: 取消或订单已完成时,置false
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false;
|
||||
CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(false);
|
||||
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false);
|
||||
CallerAutoPilotControlManager.INSTANCE.setIgnoreConditionDraw(false);
|
||||
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false);
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore:置为false(已完成or清除当前订单)");
|
||||
}
|
||||
}
|
||||
@@ -934,7 +934,7 @@ public class TaxiModel {
|
||||
return;
|
||||
}
|
||||
|
||||
CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters);
|
||||
CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters);
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "start autopilot with parameter: %s",
|
||||
GsonUtil.jsonFromObject(parameters)
|
||||
+ " ,startSiteName=" + mCurrentOCHOrder.startSiteAddr
|
||||
@@ -987,7 +987,7 @@ public class TaxiModel {
|
||||
//结束自动驾驶
|
||||
public void cancelAutopilot() {
|
||||
try {
|
||||
CallerAutoPilotManager.INSTANCE.cancelAutoPilot();
|
||||
CallerAutoPilotControlManager.INSTANCE.cancelAutoPilot();
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "结束自动驾驶");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -995,7 +995,7 @@ public class TaxiModel {
|
||||
}
|
||||
|
||||
//根据围栏判断,是否到达起点
|
||||
private void judgeStartStation(MessagePad.GnssInfo location) {
|
||||
private void judgeStartStation(MogoLocation location) {
|
||||
if (mCurrentOCHOrder == null || mCurrentOCHOrder.startSiteGcjPoint == null
|
||||
|| mCurrentOCHOrder.startSiteGcjPoint.size() < 2) {
|
||||
return;
|
||||
@@ -1054,7 +1054,7 @@ public class TaxiModel {
|
||||
// 自车定位
|
||||
private final IMoGoChassisLocationGCJ02Listener mMapLocationLIstener = new IMoGoChassisLocationGCJ02Listener() {
|
||||
@Override
|
||||
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
|
||||
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
|
||||
//位置变化时,通过围栏判断是否到达x点
|
||||
if (null == gnssInfo) return;
|
||||
if (checkCurrentOCHOrder()) {
|
||||
@@ -1076,7 +1076,7 @@ public class TaxiModel {
|
||||
}
|
||||
};
|
||||
|
||||
private void judgeEndStation(MessagePad.GnssInfo location) {
|
||||
private void judgeEndStation(MogoLocation location) {
|
||||
if (mCurrentOCHOrder == null || mCurrentOCHOrder.endSiteGcjPoint == null
|
||||
|| mCurrentOCHOrder.endSiteGcjPoint.size() < 2) {
|
||||
return;
|
||||
@@ -1172,8 +1172,8 @@ public class TaxiModel {
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
// 当美化模式(演示模式)开启时: 订单对应自动驾驶开启后,置true
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true;
|
||||
CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(true);
|
||||
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(true);
|
||||
CallerAutoPilotControlManager.INSTANCE.setIgnoreConditionDraw(true);
|
||||
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(true);
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore:置为true(到达出发点且已开启自动驾驶)");
|
||||
}
|
||||
}
|
||||
@@ -1243,7 +1243,7 @@ public class TaxiModel {
|
||||
// 2022.10.08 到达目的地时候取消自动起自驾, 服务完成取消引导线和自动驾驶按钮状态
|
||||
// FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false;
|
||||
// CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(false);
|
||||
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false);
|
||||
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false);
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore:置为false(到达目的地)");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
@@ -314,10 +315,10 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(MessagePad.GnssInfo location) {
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
if (null != location){
|
||||
runOnUIThread(() -> {
|
||||
mView.updateSpeedView((float) location.getVehicleSpeed());
|
||||
mView.updateSpeedView((float) location.getGnssSpeed());
|
||||
mView.updateLocation(location.getLatitude(),location.getLongitude());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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 android.animation.ObjectAnimator;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.SystemClock;
|
||||
@@ -31,10 +32,11 @@ 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.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView;
|
||||
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.view.MapBizView;
|
||||
import com.mogo.eagle.core.function.smp.view.SmallMapView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
||||
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 FrameLayout flStationPanelContainer;
|
||||
private FrameLayout flNaviPanelContainer;
|
||||
private MapBizView mapBizView;
|
||||
private Group groupTestPanel;
|
||||
private TextView mSpeedView;
|
||||
private ImageView mAutopilotImage;
|
||||
@@ -86,6 +89,8 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
protected TaxiRottingNaviFragment taxiRottingNaviFragment = null;
|
||||
// protected TaxiTrafficLightView mTrafficLightView;
|
||||
|
||||
protected SmallMapView smallMapView;
|
||||
|
||||
private Handler mHandler = new Handler(Looper.getMainLooper());
|
||||
|
||||
private Integer[] startAutopilotDrawableIds = new Integer[]{
|
||||
@@ -153,6 +158,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
mapBizView = findViewById(R.id.mapBizView);
|
||||
groupTestPanel = findViewById(R.id.groupTestPanel);
|
||||
ctvAutopilotStatusRL = findViewById(R.id.module_mogo_och_autopilot_status);
|
||||
ctvAutopilotStatusRL.setBackground(getResources().getDrawable(R.drawable.taxi_autopilot_bg_selector));
|
||||
@@ -290,6 +296,29 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
viewDriverMsgBoxBubble.isShowData(true);
|
||||
}
|
||||
});
|
||||
|
||||
smallMapView = findViewById(R.id.smallMapView);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews(Bundle savedInstanceState) {
|
||||
super.initViews(savedInstanceState);
|
||||
mapBizView.onCreate(savedInstanceState);
|
||||
smallMapView.onCreateView(savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
mapBizView.onResume();
|
||||
smallMapView.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
mapBizView.onPause();
|
||||
smallMapView.onPause();
|
||||
}
|
||||
|
||||
protected void onChangeOperationStatus() {
|
||||
@@ -309,12 +338,31 @@ 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
|
||||
public void onDestroyView() {
|
||||
mapBizView.onDestroy();
|
||||
super.onDestroyView();
|
||||
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
smallMapView.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRecordResult(@Nullable RecordPanelOuterClass.RecordPanel recordPanel) {
|
||||
// if (!HmiBuildConfig.isShowBadCaseView && recordPanel != null && recordPanel.getType() == 1 && recordPanel.getStat() == 100) {
|
||||
@@ -564,11 +612,11 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
transaction.commitAllowingStateLoss();
|
||||
mCloseNaviIcon.setVisibility(View.VISIBLE);
|
||||
flNaviPanelContainer.setVisibility(View.VISIBLE);
|
||||
CallerSmpManager.hidePanel();//隐藏小地图
|
||||
smallMapView.setVisibility(View.GONE);
|
||||
} else {
|
||||
mCloseNaviIcon.setVisibility(View.GONE);
|
||||
flNaviPanelContainer.setVisibility(View.GONE);
|
||||
CallerSmpManager.showPanel();//显示小地图
|
||||
smallMapView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -607,12 +655,12 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
transaction.commitAllowingStateLoss();
|
||||
mCloseNaviIcon.setVisibility(View.VISIBLE);
|
||||
flNaviPanelContainer.setVisibility(View.VISIBLE);
|
||||
CallerSmpManager.hidePanel();//隐藏小地图
|
||||
smallMapView.setVisibility(View.GONE);
|
||||
} else {
|
||||
closeRouteViewIFHadeAdd();
|
||||
mCloseNaviIcon.setVisibility(View.GONE);
|
||||
flNaviPanelContainer.setVisibility(View.GONE);
|
||||
CallerSmpManager.showPanel();//显示小地图
|
||||
smallMapView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
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.map.CallerHDMapManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
@@ -673,7 +672,7 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
|
||||
}
|
||||
|
||||
private void clearSmallMapRouteLine() {
|
||||
CallerSmpManager.clearPolyline();
|
||||
// CallerSmpManager.clearPolyline();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -765,7 +764,7 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
|
||||
.latitude(station.get(1))
|
||||
.longitude(station.get(0));
|
||||
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);
|
||||
if (null != centerLine && marker != null) {// 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致
|
||||
marker.setRotateAngle(centerLine.getAngle().floatValue());
|
||||
|
||||
@@ -29,8 +29,9 @@ import com.amap.api.maps.model.MarkerOptions;
|
||||
import com.amap.api.maps.model.Polyline;
|
||||
import com.amap.api.maps.model.PolylineOptions;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
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.CallerChassisLocationGCJ02ListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.taxi.R;
|
||||
import com.mogo.och.taxi.utils.TaxiMapAssetStyleUtil;
|
||||
@@ -38,8 +39,6 @@ import com.mogo.och.taxi.utils.TaxiMapAssetStyleUtil;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* taxi司机端前往目的地小地图导航
|
||||
*/
|
||||
@@ -99,14 +98,14 @@ public class TaxiMapDirectionView
|
||||
initAMapView();
|
||||
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ20ListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ20ListenerManager.INSTANCE.removeListener(TAG);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.removeListener(TAG);
|
||||
}
|
||||
|
||||
private void initAMapView() {
|
||||
@@ -176,7 +175,7 @@ public class TaxiMapDirectionView
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
|
||||
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
|
||||
if (gnssInfo == null){
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3,10 +3,9 @@ package com.mogo.och.taxi.utils;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRespBean;
|
||||
import com.mogo.och.taxi.constant.TaxiConst;
|
||||
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum;
|
||||
@@ -201,7 +200,7 @@ public class TaxiTrajectoryManager {
|
||||
// mAutoPilotLine.setTimestamp(1654761600000L); //20220609 16:00
|
||||
// mAutoPilotLine.setVehicleModel("红旗H9");
|
||||
|
||||
CallerAutoPilotManager.INSTANCE.sendTrajectoryDownloadReq(mAutoPilotLine);
|
||||
CallerAutoPilotControlManager.INSTANCE.sendTrajectoryDownloadReq(mAutoPilotLine);
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "sendTrajectoryReq(): "
|
||||
+ GsonUtils.toJson(mAutoPilotLine));
|
||||
}
|
||||
|
||||
@@ -6,6 +6,11 @@
|
||||
android:layout_height="match_parent"
|
||||
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
|
||||
android:id="@+id/module_mogo_och_speed_layout"
|
||||
android:layout_height="@dimen/taxi_tab_speed_width_height"
|
||||
@@ -80,6 +85,28 @@
|
||||
|
||||
</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车辆标志-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
||||
android:layout_width="@dimen/module_vip_width"
|
||||
@@ -91,7 +118,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
@@ -177,7 +204,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--接管提示-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.takeover.TakeOverView
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.TakeOverView
|
||||
android:layout_width="@dimen/hmi_take_over_request_width"
|
||||
android:layout_height="@dimen/hmi_take_over_request_height"
|
||||
android:layout_marginTop="@dimen/hmi_take_over_request_m_top"
|
||||
@@ -377,4 +404,15 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:src="@drawable/taxi_close_navi_icon"/>
|
||||
|
||||
<com.mogo.eagle.core.function.smp.view.SmallMapView
|
||||
android:id="@+id/smallMapView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="30dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -61,6 +61,9 @@ if (!isAndroidTestBuild()) {
|
||||
crash_fix {
|
||||
enable true
|
||||
}
|
||||
memory_leak {
|
||||
enable true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -338,21 +341,44 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.lancetx_runtime
|
||||
implementation rootProject.ext.dependencies.mogocustommap
|
||||
implementation project(':core:function-impl:mogo-core-function-startup')
|
||||
implementation project(':libraries:map-usbcamera')
|
||||
// // 暂不使用Shizuku-API
|
||||
// implementation rootProject.ext.dependencies.shizuku_provider
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.ttspad
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_hmi
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_map
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_v2x
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_datacenter
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_devatools
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_chat
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_biz
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
|
||||
androidTestImplementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
androidTestImplementation rootProject.ext.dependencies.mogo_core_res
|
||||
} else {
|
||||
implementation project(':tts:tts-pad')
|
||||
implementation project(':core:function-impl:mogo-core-function-hmi')
|
||||
implementation project(':core:function-impl:mogo-core-function-map')
|
||||
implementation project(':core:function-impl:mogo-core-function-v2x')
|
||||
implementation project(':core:function-impl:mogo-core-function-datacenter')
|
||||
implementation project(':core:function-impl:mogo-core-function-devatools')
|
||||
implementation project(':core:function-impl:mogo-core-function-chat')
|
||||
implementation project(':core:function-impl:mogo-core-function-biz')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':core:mogo-core-res')
|
||||
implementation project(':foudations:mogo-commons')
|
||||
|
||||
androidTestImplementation project(':core:mogo-core-function-call')
|
||||
androidTestImplementation project(':core:mogo-core-res')
|
||||
|
||||
}
|
||||
|
||||
|
||||
apply from: "./functions/och.gradle"
|
||||
|
||||
androidTestImplementation rootProject.ext.dependencies.androidx_test_core
|
||||
|
||||
@@ -4,7 +4,7 @@ import androidx.test.core.app.ActivityScenario
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.filters.LargeTest
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.MoGoHmiFragment
|
||||
import com.mogo.eagle.core.function.hmi.ui.MoGoHmiProvider
|
||||
import com.mogo.eagle.core.function.main.MainLauncherActivity
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.flow.*
|
||||
@@ -121,15 +121,15 @@ class AutoPilotBadCaseTest {
|
||||
delay(TimeUnit.HOURS.toMillis(2))
|
||||
}
|
||||
|
||||
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiFragment = suspendCancellableCoroutine {
|
||||
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiProvider = suspendCancellableCoroutine {
|
||||
launch.onActivity { itx ->
|
||||
val executor = Executors.newSingleThreadScheduledExecutor()
|
||||
executor.scheduleAtFixedRate({
|
||||
var find =
|
||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
|
||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
|
||||
while (find == null) {
|
||||
find =
|
||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
|
||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
|
||||
|
||||
}
|
||||
while (!find.isResumed) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import androidx.test.core.app.ActivityScenario
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.filters.LargeTest
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.MoGoHmiFragment
|
||||
import com.mogo.eagle.core.function.hmi.ui.MoGoHmiProvider
|
||||
import com.mogo.eagle.core.function.main.MainLauncherActivity
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.runBlocking
|
||||
@@ -35,15 +35,15 @@ class MapDataCollectTest {
|
||||
CallerMapDataCollectorManager.setIsInit()
|
||||
delay(TimeUnit.HOURS.toMillis(1))
|
||||
}
|
||||
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiFragment = suspendCancellableCoroutine {
|
||||
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiProvider = suspendCancellableCoroutine {
|
||||
launch.onActivity { itx ->
|
||||
val executor = Executors.newSingleThreadScheduledExecutor()
|
||||
executor.scheduleAtFixedRate({
|
||||
var find =
|
||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
|
||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
|
||||
while (find == null) {
|
||||
find =
|
||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
|
||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
|
||||
|
||||
}
|
||||
while (!find.isResumed) {
|
||||
|
||||
@@ -81,15 +81,15 @@ class ReminderTest {
|
||||
delay(3000000)
|
||||
}
|
||||
|
||||
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiFragment = suspendCancellableCoroutine {
|
||||
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiProvider = suspendCancellableCoroutine {
|
||||
launch.onActivity { itx ->
|
||||
val executor = Executors.newSingleThreadScheduledExecutor()
|
||||
executor.scheduleAtFixedRate({
|
||||
var find =
|
||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
|
||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
|
||||
while (find == null) {
|
||||
find =
|
||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
|
||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
|
||||
}
|
||||
while (!find.isResumed) {
|
||||
Thread.sleep(500)
|
||||
|
||||
@@ -136,15 +136,15 @@ class RoadAITest {
|
||||
|
||||
}
|
||||
|
||||
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiFragment = suspendCancellableCoroutine {
|
||||
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiProvider = suspendCancellableCoroutine {
|
||||
launch.onActivity { itx ->
|
||||
val executor = Executors.newSingleThreadScheduledExecutor()
|
||||
executor.scheduleAtFixedRate({
|
||||
var find =
|
||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
|
||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
|
||||
while (find == null) {
|
||||
find =
|
||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
|
||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
|
||||
}
|
||||
while (!find.isResumed) {
|
||||
Thread.sleep(500)
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.mogo.functions.test
|
||||
import androidx.test.core.app.ActivityScenario
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.filters.LargeTest
|
||||
import com.mogo.eagle.core.function.hmi.ui.MoGoHmiFragment
|
||||
import com.mogo.eagle.core.function.hmi.ui.MoGoHmiProvider
|
||||
import com.mogo.eagle.core.function.main.MainLauncherActivity
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -44,15 +44,15 @@ class TipToastLeakTest {
|
||||
delay(TimeUnit.SECONDS.toMillis(2))
|
||||
}
|
||||
|
||||
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiFragment = suspendCancellableCoroutine {
|
||||
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiProvider = suspendCancellableCoroutine {
|
||||
launch.onActivity { itx ->
|
||||
val executor = Executors.newSingleThreadScheduledExecutor()
|
||||
executor.scheduleAtFixedRate({
|
||||
var find =
|
||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
|
||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
|
||||
while (find == null) {
|
||||
find =
|
||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
|
||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiProvider } as? MoGoHmiProvider
|
||||
|
||||
}
|
||||
while (!find.isResumed) {
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
tools:replace="android:label">
|
||||
<meta-data
|
||||
android:name="design_width_in_dp"
|
||||
android:value="5120"/>
|
||||
android:value="2560"/>
|
||||
<meta-data
|
||||
android:name="design_height_in_dp"
|
||||
android:value="3200"/>
|
||||
android:value="1600"/>
|
||||
|
||||
<!-- <provider-->
|
||||
<!-- android:name="com.rousetime.android_startup.provider.StartupProvider"-->
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
package com.mogo.launcher.lancet
|
||||
|
||||
import android.database.sqlite.*
|
||||
import androidx.annotation.*
|
||||
import com.knightboost.lancet.api.*
|
||||
import com.knightboost.lancet.api.annotations.*
|
||||
import com.knightboost.lancet.api.annotations.Weaver
|
||||
|
||||
/**
|
||||
* 此类主要用来修正三方库引起的崩溃
|
||||
*/
|
||||
@Keep
|
||||
@Weaver
|
||||
@Group("leak_canary_crash_fix")
|
||||
class LeakCanaryCrashFix {
|
||||
|
||||
@Insert
|
||||
@TargetClass("leakcanary.internal.activity.db.ScopedLeaksDb\$DbOpener")
|
||||
@TargetMethod(methodName = "getReadableDatabase")
|
||||
fun proxyGetReadableSQLiteDb(): SQLiteDatabase? {
|
||||
try {
|
||||
return Origin.call() as SQLiteDatabase?
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
@Insert
|
||||
@TargetClass("leakcanary.internal.activity.db.ScopedLeaksDb\$DbOpener")
|
||||
@TargetMethod(methodName = "getWritableDatabase")
|
||||
fun proxyGetWritableSQLiteDb(): SQLiteDatabase? {
|
||||
try {
|
||||
return Origin.call() as SQLiteDatabase?
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
@Insert
|
||||
@TargetClass("leakcanary.internal.activity.db.ScopedLeaksDb\$DbOpener")
|
||||
@TargetMethod(methodName = "close")
|
||||
fun proxyClose() {
|
||||
try {
|
||||
Origin.callVoid()
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
@Insert
|
||||
@TargetClass("leakcanary.internal.activity.db.Io\$execute\$2")
|
||||
@TargetMethod(methodName = "run")
|
||||
fun proxyRun() {
|
||||
try {
|
||||
Origin.callVoid()
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
140
app/src/main/java/com/mogo/launcher/lancet/MemoryLeakFix.kt
Normal file
140
app/src/main/java/com/mogo/launcher/lancet/MemoryLeakFix.kt
Normal file
@@ -0,0 +1,140 @@
|
||||
package com.mogo.launcher.lancet
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.Dialog
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import androidx.annotation.*
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.fragment.app.*
|
||||
import androidx.lifecycle.*
|
||||
import androidx.lifecycle.Lifecycle.Event
|
||||
import androidx.lifecycle.Lifecycle.Event.ON_DESTROY
|
||||
import com.knightboost.lancet.api.*
|
||||
import com.knightboost.lancet.api.annotations.*
|
||||
import com.knightboost.lancet.api.annotations.Weaver
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import io.netty.util.internal.ConcurrentSet
|
||||
import java.lang.ref.*
|
||||
import java.lang.reflect.Modifier
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
@Keep
|
||||
@Weaver
|
||||
@Group("memory_leak")
|
||||
class MemoryLeakFix {
|
||||
|
||||
@Insert
|
||||
@ImplementedInterface("java.lang.Runnable")
|
||||
@TargetMethod(methodName = "run")
|
||||
fun runProxy() {
|
||||
if (AccessSyntheticUtils.isTargetAlive(This.get())) {
|
||||
Origin.callVoid()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class AccessSyntheticUtils {
|
||||
|
||||
companion object {
|
||||
|
||||
private val fields = ConcurrentHashMap<String, WeakReference<Any>>()
|
||||
private val observers = ConcurrentSet<String>()
|
||||
|
||||
@JvmStatic
|
||||
fun isTargetAlive(obj: Any): Boolean {
|
||||
try {
|
||||
val clazz = obj.javaClass
|
||||
if (!clazz.isAnonymousClass) {
|
||||
return true
|
||||
}
|
||||
val key = clazz.name
|
||||
return (fields[key] ?: clazz.declaredFields.find {
|
||||
it.isSynthetic &&
|
||||
((it.modifiers and Modifier.STATIC) == 0) &&
|
||||
(View::class.java.isAssignableFrom(it.type) or
|
||||
Context::class.java.isAssignableFrom(it.type) or
|
||||
Fragment::class.java.isAssignableFrom(it.type) or
|
||||
android.app.Fragment::class.java.isAssignableFrom(it.type) or
|
||||
Dialog::class.java.isAssignableFrom(it.type)
|
||||
)
|
||||
}?.let {
|
||||
it.isAccessible = true
|
||||
val wf = WeakReference(it.get(obj), ReferenceQueue())
|
||||
fields[key] = wf
|
||||
wf
|
||||
})?.also {
|
||||
if (it.isEnqueued) {
|
||||
//对像被垃圾回收了
|
||||
fields.remove(key)
|
||||
}
|
||||
}?.get()?.let { t ->
|
||||
var lifecycle: Lifecycle? = null
|
||||
val ret = when (t) {
|
||||
is View -> {
|
||||
lifecycle = t.lifecycleOwner.lifecycle
|
||||
ViewCompat.isAttachedToWindow(t)
|
||||
}
|
||||
is Activity -> {
|
||||
lifecycle = t.findViewById<View>(android.R.id.content)?.lifecycleOwner?.lifecycle
|
||||
!t.isFinishing && !t.isDestroyed
|
||||
}
|
||||
is Fragment -> {
|
||||
lifecycle = t.lifecycle
|
||||
!t.isDetached
|
||||
}
|
||||
is android.app.Fragment -> {
|
||||
lifecycle = t.view?.lifecycleOwner?.lifecycle
|
||||
!t.isDetached
|
||||
}
|
||||
is Dialog -> {
|
||||
t.window?.decorView?.let {
|
||||
v ->
|
||||
lifecycle = v.lifecycleOwner.lifecycle
|
||||
ViewCompat.isAttachedToWindow(v)
|
||||
} ?: false
|
||||
}
|
||||
else -> {
|
||||
true
|
||||
}
|
||||
}
|
||||
if (!ret) {
|
||||
assignFinalFieldNull(obj, t.javaClass)
|
||||
} else {
|
||||
val l = lifecycle
|
||||
if (l != null && !observers.contains(key)) {
|
||||
observers.add(key)
|
||||
l.addObserver(object : LifecycleEventObserver {
|
||||
override fun onStateChanged(source: LifecycleOwner, event: Event) {
|
||||
if (event == ON_DESTROY) {
|
||||
assignFinalFieldNull(obj, t.javaClass)
|
||||
observers.remove(key)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
ret
|
||||
} ?: true
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
private fun assignFinalFieldNull(obj: Any, fieldType: Class<*>) {
|
||||
try {
|
||||
obj.javaClass.declaredFields.find {
|
||||
it.isSynthetic &&
|
||||
((it.modifiers and Modifier.STATIC) == 0) && it.type == fieldType
|
||||
}?.also {
|
||||
it.isAccessible = true
|
||||
it.set(obj, null)
|
||||
}
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -180,7 +180,7 @@ public class DataDistribution {
|
||||
|
||||
public String cutDown(String str) {
|
||||
if (isCutDown && str.length() > 650) {
|
||||
str = str.substring(0, 650) + "\n(已缩短。如需查看完整数据,请勾选日志存储复选框)";
|
||||
str = str.substring(0, 650) + "\n(已缩短。如需查看完整数据,请勾选日志缩短复选框)";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,10 @@ public class ConfigAdapter extends BaseAdapter<Config, ConfigAdapter.ViewHolder>
|
||||
}
|
||||
viewHolder.name.setText(data.name);
|
||||
viewHolder.value.setText(data.value);
|
||||
|
||||
if (data.color == -1) {
|
||||
data.color = R.color.colorSlateGray;
|
||||
}
|
||||
viewHolder.value.setTextColor(mContext.getResources().getColor(data.color));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -48,6 +48,10 @@ public abstract class BaseAdapter<D, VH extends BaseViewHolder> extends Recycler
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public List<D> getData() {
|
||||
return mDatas;
|
||||
}
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener<D> listener) {
|
||||
mItemClick = listener;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,26 @@
|
||||
package com.zhidao.adas.client.bean;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class Config {
|
||||
public final String name;
|
||||
public final String value;
|
||||
public String value;
|
||||
public int color = -1;
|
||||
|
||||
public Config(String name, String value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Config config = (Config) o;
|
||||
return Objects.equals(name, config.name);
|
||||
}
|
||||
|
||||
public void cover(Config config) {
|
||||
this.value = config.value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,6 @@ import com.zhidao.support.adas.high.AdasOptions;
|
||||
import com.zhidao.support.adas.high.OnAdasConnectStatusListener;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.OnMultiDeviceListener;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotAbility;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatistics;
|
||||
import com.zhidao.support.adas.high.bean.VersionCompatibility;
|
||||
import com.zhidao.support.adas.high.common.ByteUtil;
|
||||
@@ -120,7 +119,6 @@ import java.util.Locale;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
import bag_manager.BagManagerOuterClass;
|
||||
import chassis.Chassis;
|
||||
import chassis.ChassisStatesOuterClass;
|
||||
import function_state_management.FunctionStates;
|
||||
import io.netty.channel.Channel;
|
||||
@@ -182,8 +180,6 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
private ListPopupWindow listPopupWindow;
|
||||
private FloatWindow floatWindow;
|
||||
private View include_title;
|
||||
private boolean isAutopilotAbility = true;
|
||||
private String autopilotAbilityReason;
|
||||
private List<SpecialVehicleBean> specialVehicleBeanList;//特种车辆
|
||||
private long errorDataUpdateTime = 0;
|
||||
// @Override
|
||||
@@ -857,47 +853,12 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotAbility(AutopilotAbility ability) {
|
||||
isAutopilotAbility = true;
|
||||
autopilotAbilityReason = null;
|
||||
if (ability.gear == null || ability.gear == Chassis.GearPosition.GEAR_P || ability.gear == Chassis.GearPosition.GEAR_R) {
|
||||
isAutopilotAbility = false;
|
||||
autopilotAbilityReason = "挡位不正常";
|
||||
public void onAutopilotAbility(boolean isAutopilotAbility, String unableAutopilotReason) {
|
||||
if (fromFragment instanceof VersionFragment) {
|
||||
VersionFragment fragment = (VersionFragment) fromFragment;
|
||||
fragment.autopilotAbility(isAutopilotAbility, unableAutopilotReason);
|
||||
}
|
||||
if (isAutopilotAbility)
|
||||
if (ability.brake > 0) {
|
||||
isAutopilotAbility = false;
|
||||
autopilotAbilityReason = "制动踏板被踩下";
|
||||
}
|
||||
if (isAutopilotAbility)
|
||||
if (ability.statusInfo == null) {
|
||||
isAutopilotAbility = false;
|
||||
autopilotAbilityReason = "系统Topic不正常";
|
||||
}
|
||||
if (isAutopilotAbility)
|
||||
if (ability.statusInfo.getSysState() == SystemStatusInfo.SystemState.SYS_STARTING) {
|
||||
isAutopilotAbility = false;
|
||||
autopilotAbilityReason = "系统正在启动";
|
||||
}
|
||||
if (isAutopilotAbility)
|
||||
if (ability.statusInfo.getSysState() == SystemStatusInfo.SystemState.SYS_EXITING) {
|
||||
isAutopilotAbility = false;
|
||||
autopilotAbilityReason = "系统正在关闭";
|
||||
}
|
||||
if (isAutopilotAbility)
|
||||
if (ability.statusInfo.getSysState() == SystemStatusInfo.SystemState.SYS_FAULT) {
|
||||
isAutopilotAbility = false;
|
||||
autopilotAbilityReason = "系统异常";
|
||||
}
|
||||
if (isAutopilotAbility)
|
||||
for (SystemStatusInfo.HealthInfo healthInfo : ability.statusInfo.getHealthInfoList()) {
|
||||
if (healthInfo.getState() == SystemStatusInfo.HealthState.FAULT) {
|
||||
isAutopilotAbility = false;
|
||||
autopilotAbilityReason = healthInfo.getName() + " 节点异常";
|
||||
break;
|
||||
}
|
||||
}
|
||||
Log.i(TAG, "是否可以启动自动驾驶=" + isAutopilotAbility + " 原因=" + autopilotAbilityReason);
|
||||
Log.i(TAG, "是否可以启动自动驾驶=" + isAutopilotAbility + " 原因=" + unableAutopilotReason);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1004,7 +965,12 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
BasicInfoReq info = new BasicInfoReq(header, basicInfoReq, sdf);
|
||||
DataDistribution.getInstance().addData(info);
|
||||
AdasManager.getInstance().sendBasicInfoResp("", 0, com.zhidao.support.adas.high.common.Constants.TERMINAL_ROLE.DEBUG);
|
||||
showToastCenter("收到车机基础信息请求:" + info.toString());
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
showToastCenter("收到车机基础信息请求:" + info.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -30,6 +30,7 @@ import com.zhidao.adas.client.adapter.InterfaceAdapter;
|
||||
import com.zhidao.adas.client.base.BaseFragment;
|
||||
import com.zhidao.adas.client.bean.Config;
|
||||
import com.zhidao.adas.client.bean.InterfaceModel;
|
||||
import com.zhidao.adas.client.utils.RandomColor;
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.bean.VersionCompatibility;
|
||||
import com.zhidao.support.adas.high.common.Constants;
|
||||
@@ -211,11 +212,47 @@ public class VersionFragment extends BaseFragment {
|
||||
VersionCompatibility versionCompatibility = AdasManager.getInstance().getVersionCompatibility();
|
||||
list.add(new Config("版本兼容性:", versionCompatibility == null ? null : versionCompatibility.toString()));
|
||||
}
|
||||
|
||||
list.add(new Config("ADAS LIB版本:", AdasManager.getInstance().getAdasVersion()));
|
||||
list.add(new Config("APP构建时间:", BuildConfig.BUILD_TIME));
|
||||
list.add(getAutopilotAbilityConfig(""));
|
||||
adapter.setData(list);
|
||||
}
|
||||
|
||||
private Config getAutopilotAbilityConfig(String value) {
|
||||
return new Config("能否启动自动驾驶:", value);
|
||||
}
|
||||
|
||||
public void autopilotAbility(boolean isAutopilotAbility, String unableAutopilotReason) {
|
||||
List<Config> list = adapter.getData();
|
||||
if (list != null) {
|
||||
Config temp = getAutopilotAbilityConfig(isAutopilotAbility + ",原因:" + unableAutopilotReason);
|
||||
int index = list.indexOf(temp);
|
||||
if (index < 0) {
|
||||
list.add(temp);
|
||||
if (getActivity() != null)
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
adapter.notifyItemInserted(list.size() - 1);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Config config = list.get(index);
|
||||
config.cover(temp);
|
||||
config.color = RandomColor.randomColor();
|
||||
if (getActivity() != null)
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
adapter.notifyItemChanged(index);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRefreshView() {
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.zhidao.adas.client.utils;
|
||||
|
||||
import com.zhidao.adas.client.R;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
|
||||
public class RandomColor {
|
||||
//随机颜色,且不与上一次重复
|
||||
private static Random randomColor;
|
||||
private static int tempColorIndex;
|
||||
private static int[] colors = {R.color.color1, R.color.color2, R.color.color3, R.color.color4, R.color.color5};
|
||||
|
||||
public static int randomColor() {
|
||||
randomColorTemp();
|
||||
return colors[tempColorIndex];
|
||||
}
|
||||
|
||||
private static void randomColorTemp() {
|
||||
if (randomColor == null)
|
||||
randomColor = new Random();
|
||||
int colorInt = randomColor.nextInt(colors.length);
|
||||
if (tempColorIndex == colorInt) {
|
||||
randomColorTemp();
|
||||
} else {
|
||||
tempColorIndex = colorInt;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,11 @@
|
||||
<color name="connect_status_connected">#32CD32</color>
|
||||
<color name="connect_status_disconnected">#DC143C</color>
|
||||
<color name="connect_status_connecting">#FF00FF</color>
|
||||
<color name="connect_status_disconnecting">#DAA520</color>
|
||||
<color name="connect_status_disconnecting">#3333FF </color>
|
||||
<color name="connect_status_search_address">#1E90FF</color>
|
||||
<color name="color1">#FFC0CB</color>
|
||||
<color name="color2">#FF8F00</color>
|
||||
<color name="color3">#FFE500</color>
|
||||
<color name="color4">#B9ED3E</color>
|
||||
<color name="color5">#2EEDEB</color>
|
||||
</resources>
|
||||
|
||||
@@ -45,7 +45,6 @@ import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.AdasOptions;
|
||||
import com.zhidao.support.adas.high.OnAdasConnectStatusListener;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotAbility;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatistics;
|
||||
import com.zhidao.support.adas.high.bean.VersionCompatibility;
|
||||
import com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS;
|
||||
@@ -589,6 +588,11 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotAbility(boolean isAutopilotAbility, String unableAutopilotReason) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void initAdas() {
|
||||
CupidLogUtils.e(TAG, "--->初始化");
|
||||
@@ -857,10 +861,6 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotAbility(AutopilotAbility ability) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartAutopilotFailed(MogoReportMsg.MogoReportMessage message) {
|
||||
|
||||
@@ -35,7 +35,7 @@ buildscript {
|
||||
classpath 'com.mogo.cloud:systrace:1.0.1'
|
||||
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18'
|
||||
classpath 'com.mogo.sticky:service:1.0.8'
|
||||
classpath 'io.github.knight-zxw:lancet-plugin:0.0.1'
|
||||
classpath 'io.github.knight-zxw:lancet-plugin:0.0.4'
|
||||
|
||||
// classpath ("com.tencent.matrix:matrix-gradle-plugin:0.6.6") { changing = true }
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ ext {
|
||||
|
||||
|
||||
//========================= LancetX ===================
|
||||
lancetx_runtime : "io.github.knight-zxw:lancet-runtime:0.0.1",
|
||||
lancetx_runtime : "io.github.knight-zxw:lancet-runtime:0.0.4",
|
||||
|
||||
//========================= autosize ======================
|
||||
androidautoSize : 'com.github.JessYanCoding:AndroidAutoSize:v1.2.1',
|
||||
|
||||
@@ -57,6 +57,9 @@ dependencies {
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
implementation rootProject.ext.dependencies.androidxroomruntime
|
||||
kapt rootProject.ext.dependencies.androidxroomcompiler
|
||||
implementation rootProject.ext.dependencies.androidxroomktx
|
||||
|
||||
implementation project(':foudations:mogo-commons')
|
||||
implementation project(':core:mogo-core-data')
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.eagle.function.biz
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.camera.CameraEntity
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.biz.IMoGoFuncBizProvider
|
||||
@@ -10,9 +11,9 @@ import com.mogo.eagle.function.biz.dispatch.DispatchAutoPilotManager.Companion.d
|
||||
import com.mogo.eagle.function.biz.monitoring.CronTaskManager.Companion.cronTaskManager
|
||||
import com.mogo.eagle.function.biz.notice.NoticeSocketManager.Companion.noticeSocketManager
|
||||
import com.mogo.eagle.function.biz.notice.network.NoticeNetWorkManager
|
||||
import com.mogo.eagle.function.biz.v2x.speedlimit.SpeedLimitDispatcher
|
||||
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.trafficlight.core.MogoTrafficLightManager
|
||||
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightDispatcher
|
||||
import com.mogo.eagle.function.biz.v2x.vip.VipCarManager
|
||||
|
||||
@Route(path = MogoServicePaths.PATH_FUNC_BIZ)
|
||||
@@ -28,8 +29,6 @@ class FuncBizProvider : IMoGoFuncBizProvider {
|
||||
|
||||
MogoTrafficLightManager.INSTANCE.initServer(context)
|
||||
VipCarManager.INSTANCE.initServer(context)
|
||||
TrafficLightDispatcher.INSTANCE.initServer(context) //todo 宏宇 放入dataCenter
|
||||
SpeedLimitDispatcher.INSTANCE.initLimit(context) //todo 宏宇,放入dataCenter
|
||||
// RedLightWarningManager.INSTANCE.listenTrafficLight()
|
||||
}
|
||||
|
||||
@@ -68,13 +67,24 @@ class FuncBizProvider : IMoGoFuncBizProvider {
|
||||
cronTaskManager.clear()
|
||||
}
|
||||
|
||||
override fun fetchInfStructures() {
|
||||
OverViewDataManager.fetchInfStructures()
|
||||
}
|
||||
|
||||
override fun getAllV2XEvents() {
|
||||
OverViewDataManager.getAllV2XEventsByLineId(MoGoAiCloudClientConfig.getInstance().sn)
|
||||
}
|
||||
|
||||
override fun initOverViewDb(context: Context) {
|
||||
OverviewDb.getDb(context)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
noticeSocketManager.release()
|
||||
dispatchAutoPilotManager.release()
|
||||
cronTaskManager.release()
|
||||
|
||||
VipCarManager.INSTANCE.destroy()
|
||||
TrafficLightDispatcher.INSTANCE.destroy()
|
||||
// RedLightWarningManager.INSTANCE.onDestroy()
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
|
||||
import com.mogo.eagle.core.function.api.hmi.autopilot.IMoGoCheckAutoPilotBtnListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
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.getAutoPilotStatusInfo
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
|
||||
@@ -130,7 +130,7 @@ class DispatchAutoPilotManager private constructor() :
|
||||
AutopilotControlParameters.AutoPilotLonLat(it.endLat, it.endLon)
|
||||
currentAutopilot.vehicleType = 10
|
||||
CallerLogger.d(SceneConstant.Companion.M_DISPATCH + TAG, "开启自动驾驶====$currentAutopilot")
|
||||
CallerAutoPilotManager.startAutoPilot(currentAutopilot)
|
||||
CallerAutoPilotControlManager.startAutoPilot(currentAutopilot)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.mogo.commons.constants.HostConst
|
||||
import com.mogo.commons.utils.RetryWithDelay
|
||||
import com.mogo.eagle.core.data.camera.CameraEntity
|
||||
import com.mogo.eagle.core.data.camera.ReqLiveCarBean
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
@@ -90,7 +90,7 @@ class CronTaskManager {
|
||||
* 请求路口一定范围内的设备信息(包含:摄像头、灯)
|
||||
*/
|
||||
private fun requestDeviceList() {
|
||||
CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()?.let { location ->
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()?.let { location ->
|
||||
disposable = MoGoRetrofitFactory.getInstance(HostConst.getEagleHost())
|
||||
.create(ICameraListServices::class.java)
|
||||
.getDeviceList(location.longitude, location.latitude, 500)
|
||||
@@ -124,7 +124,7 @@ class CronTaskManager {
|
||||
}
|
||||
|
||||
private fun requestCarCameraList() {
|
||||
CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()?.let { location ->
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()?.let { location ->
|
||||
carDisposable = MoGoRetrofitFactory.getInstance(HostConst.getEagleHost())
|
||||
.create(ICameraListServices::class.java)
|
||||
.getCarCameraList(ReqLiveCarBean(location.longitude, location.latitude))
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
package com.mogo.eagle.core.function.overview
|
||||
package com.mogo.eagle.function.biz.v2x.overview
|
||||
|
||||
import androidx.lifecycle.*
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.constants.HostConst
|
||||
import com.mogo.eagle.core.data.map.Infrastructure
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.overview.db.OverviewDb
|
||||
import com.mogo.eagle.core.function.overview.remote.OverViewServiceApi
|
||||
import com.mogo.eagle.core.function.overview.remote.V2XEvent
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizListenerManager
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.function.biz.v2x.overview.db.OverviewDb
|
||||
import com.mogo.eagle.function.biz.v2x.overview.remote.OverViewServiceApi
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
object OverViewDataManager {
|
||||
@@ -26,37 +28,8 @@ object OverViewDataManager {
|
||||
OverviewDb.getDb(AbsMogoApplication.getApp()).overviewDao()
|
||||
}
|
||||
|
||||
private val _infStructures = MutableLiveData<List<Infrastructure>>()
|
||||
private val _V2XEvents = MutableLiveData<List<V2XEvent>>()
|
||||
private var disposable: Disposable? = null
|
||||
|
||||
val infStructures
|
||||
get() = _infStructures
|
||||
|
||||
private val _infStructuresMap = _infStructures
|
||||
.switchMap { infStructures ->
|
||||
liveData {
|
||||
val map = HashMap<String, ArrayList<Infrastructure>>()
|
||||
infStructures.forEach {
|
||||
val geoHash = it.geoHash
|
||||
if (geoHash == null) {
|
||||
return@forEach
|
||||
} else {
|
||||
if (!map.containsKey(geoHash)) {
|
||||
val list = ArrayList<Infrastructure>()
|
||||
list.add(it)
|
||||
map[geoHash] = list
|
||||
} else {
|
||||
map[geoHash]?.add(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
emit(map)
|
||||
}
|
||||
}
|
||||
val infStructuresMap
|
||||
get() = _infStructuresMap
|
||||
|
||||
fun fetchInfStructures() {
|
||||
ProcessLifecycleOwner.get().lifecycleScope.launch {
|
||||
val data = try {
|
||||
@@ -67,8 +40,27 @@ object OverViewDataManager {
|
||||
e.printStackTrace()
|
||||
null
|
||||
}
|
||||
data?.let {
|
||||
_infStructures.value = it
|
||||
data?.let { infStructures ->
|
||||
withContext(Dispatchers.Default) {
|
||||
val map = HashMap<String, ArrayList<Infrastructure>>()
|
||||
infStructures.forEach {
|
||||
val geoHash = it.geoHash
|
||||
if (geoHash == null) {
|
||||
return@forEach
|
||||
} else {
|
||||
if (!map.containsKey(geoHash)) {
|
||||
val list = ArrayList<Infrastructure>()
|
||||
list.add(it)
|
||||
map[geoHash] = list
|
||||
} else {
|
||||
map[geoHash]?.add(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
withContext(Dispatchers.Main) {
|
||||
CallerFuncBizListenerManager.invokeInfStructures(map)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,13 +105,11 @@ object OverViewDataManager {
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe {
|
||||
it?.apply {
|
||||
_V2XEvents.value = this
|
||||
CallerFuncBizListenerManager.invokeV2XEvents(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun getV2XEventLiveData() = _V2XEvents
|
||||
|
||||
fun stopQueryV2XEvents() {
|
||||
disposable?.dispose()
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.overview.db
|
||||
package com.mogo.eagle.function.biz.v2x.overview.db
|
||||
|
||||
import androidx.room.Dao
|
||||
import androidx.room.Query
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.overview.db
|
||||
package com.mogo.eagle.function.biz.v2x.overview.db
|
||||
|
||||
import android.content.Context
|
||||
import androidx.room.Database
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.overview.remote
|
||||
package com.mogo.eagle.function.biz.v2x.overview.remote
|
||||
|
||||
import io.reactivex.Observable
|
||||
import retrofit2.http.GET
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.mogo.eagle.function.biz.v2x.overview.remote
|
||||
|
||||
import androidx.annotation.Keep
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.data.v2x.V2XEvent
|
||||
|
||||
|
||||
@Keep
|
||||
data class V2XEventResult (
|
||||
@SerializedName("result")
|
||||
var result: Result?
|
||||
): BaseData()
|
||||
|
||||
@Keep
|
||||
data class Result(
|
||||
@SerializedName("eventList")
|
||||
var v2XEventList: List<V2XEvent>?
|
||||
)
|
||||
@@ -6,27 +6,27 @@ import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_IVP_G
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||
import com.mogo.eagle.core.data.trafficlight.*
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightStatusHelper.getCurrentRoadTrafficLight
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.api.vip.IMoGoVipSetListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.api.v2x.IMoGoVipSetListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallVipSetListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||
import com.mogo.eagle.core.utilcode.util.LocationUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.function.biz.v2x.trafficlight.core.MogoTrafficLightManager
|
||||
import com.zhjt.service_biz.BizConfig
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import kotlin.math.abs
|
||||
import kotlin.math.ceil
|
||||
import kotlin.math.floor
|
||||
@@ -44,7 +44,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
// 是否已进入到路口(停止线处)
|
||||
private var isEnter = false
|
||||
|
||||
private var mLocation: MessagePad.GnssInfo? = null
|
||||
private var mLocation: MogoLocation? = null
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -84,7 +84,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
|
||||
fun listenTrafficLight() {
|
||||
CallerTrafficLightListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationGCJ20ListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)
|
||||
CallVipSetListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
// 路口100m闯红灯预警
|
||||
mLocation?.let {
|
||||
// 单位m/s
|
||||
val speed = it.vehicleSpeed
|
||||
val speed = it.gnssSpeed
|
||||
// 车停止或者速度非常慢,可能返回负数或者很小的值,需要过滤
|
||||
CallerLogger.d("$M_V2X$TAG", "speed is:$speed")
|
||||
if (speed <= 2.5f) return// 小于等于9km/h不处理
|
||||
@@ -218,11 +218,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
CallerHmiManager.warningV2X(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.content,
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.tts,
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
|
||||
null,
|
||||
true,
|
||||
5000L
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.tts
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -258,11 +254,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
CallerHmiManager.warningV2X(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
content,
|
||||
tts,
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
null,
|
||||
true,
|
||||
5000L
|
||||
tts
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -274,10 +266,10 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
fun onDestroy() {
|
||||
CallVipSetListenerManager.removeListener(TAG)
|
||||
CallerTrafficLightListenerManager.removeListener(TAG)
|
||||
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) {
|
||||
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
|
||||
gnssInfo?.let {
|
||||
mLocation = it
|
||||
}
|
||||
|
||||
@@ -3,11 +3,12 @@ package com.mogo.eagle.function.biz.v2x.trafficlight.core
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.data.trafficlight.*
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_LOOP_SEARCH_CROSS_ROAD
|
||||
@@ -15,7 +16,6 @@ import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandl
|
||||
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_CROSS_ROAD
|
||||
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_TRAFFIC_LIGHT
|
||||
import com.mogo.eagle.function.biz.v2x.trafficlight.network.TrafficLightNetWorkModel
|
||||
import mogo.telematics.pad.MessagePad
|
||||
|
||||
class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
|
||||
|
||||
@@ -30,7 +30,7 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
|
||||
|
||||
private var mContext: Context? = null
|
||||
private val trafficLightNetWorkModel = TrafficLightNetWorkModel()
|
||||
private var mLocation: MessagePad.GnssInfo? = null
|
||||
private var mLocation: MogoLocation? = null
|
||||
private var roadIDResult: RoadIDResult? = null
|
||||
private var trafficLightResult: TrafficLightResult? = null
|
||||
|
||||
@@ -41,7 +41,7 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
|
||||
|
||||
fun initServer(context: Context) {
|
||||
mContext = context
|
||||
CallerChassisLocationGCJ20ListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)
|
||||
mThreadHandler =
|
||||
TrafficLightThreadHandler(Looper.getMainLooper(), {
|
||||
//第一次查询路口时,如果红绿灯显示,则隐藏掉
|
||||
@@ -75,7 +75,6 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
|
||||
trafficLightNetWorkModel.requestTrafficLight(
|
||||
it.latitude, it.longitude, it.heading, road, { result ->
|
||||
trafficLightResult = result
|
||||
// TrafficLightHMIManager.INSTANCE.updateTrafficLight(result)
|
||||
CallerTrafficLightListenerManager.invokeTrafficLightStatus(result)
|
||||
},
|
||||
{ errorMsg ->
|
||||
@@ -174,7 +173,7 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
|
||||
trafficLightResult = null
|
||||
}
|
||||
|
||||
override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) {
|
||||
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
|
||||
gnssInfo?.let {
|
||||
mLocation = it
|
||||
checkOutOfRange()
|
||||
|
||||
@@ -19,13 +19,12 @@ import com.mogo.eagle.core.data.trafficlight.currentRoadTrafficLight
|
||||
import com.mogo.eagle.core.data.trafficlight.isGreen
|
||||
import com.mogo.eagle.core.data.trafficlight.isRed
|
||||
import com.mogo.eagle.core.data.v2x.VipMessage
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallVipSetListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
@@ -211,15 +210,13 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
showWarning(
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.poiType,
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.content,
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.tts,
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.poiType
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.tts
|
||||
)
|
||||
} else {
|
||||
showWarning(
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.poiType,
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.content,
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.tts,
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.poiType
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.tts
|
||||
)
|
||||
}
|
||||
return@turnLightToGreen
|
||||
@@ -230,8 +227,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
showWarning(
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType,
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.content + ", 稍后重试",
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.tts,
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.tts
|
||||
)
|
||||
return@turnLightToGreen
|
||||
}
|
||||
@@ -251,8 +247,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
showWarning(
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType,
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.content + time,
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.tts,
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.tts
|
||||
)
|
||||
} else {
|
||||
CallerLogger.d(
|
||||
@@ -272,7 +267,6 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
v2xType: String,
|
||||
alertContent: CharSequence,
|
||||
ttsContent: String,
|
||||
tag: String
|
||||
) {
|
||||
if (alertContent.toString().isEmpty() || ttsContent.isEmpty()) {
|
||||
Log.d("MsgBox-VipCarManager", "alertContent或ttsContent为空!")
|
||||
@@ -280,15 +274,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(MsgBoxType.V2X, V2XMsg(v2xType, alertContent.toString(), ttsContent))
|
||||
)
|
||||
CallerHmiManager.warningV2X(
|
||||
v2xType, alertContent, ttsContent, tag,
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {}
|
||||
override fun onDismiss() {}
|
||||
},
|
||||
true,
|
||||
5000L
|
||||
)
|
||||
CallerHmiManager.warningV2X(v2xType, alertContent, ttsContent)
|
||||
}
|
||||
|
||||
fun destroy() {
|
||||
|
||||
@@ -15,7 +15,7 @@ import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_DEFAULT
|
||||
import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_VEHICLE_TEAM
|
||||
import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_VOICE
|
||||
import com.mogo.eagle.core.function.api.chat.biz.IMType.*
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.chat.facade.analytics.ChatAnalyticsFacade
|
||||
import com.mogo.eagle.core.function.chat.facade.audio.AudioFocusFacade
|
||||
import com.mogo.eagle.core.function.chat.facade.bridge.BridgeApi
|
||||
@@ -581,7 +581,7 @@ object MoGoChatFacade: IMoGoChatFacade {
|
||||
}
|
||||
//告之服务器给发送方下发接收通话消息
|
||||
try {
|
||||
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||
val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val response = serverApi.requestConnectStatus(ConnectStatusParam(MoGoAiCloudClientConfig.getInstance().sn, sn, roomId, PUSH_MSG_AGREE_ENTER, CALL_TYPE_VOICE.type).also {
|
||||
it.nickName = mySelf.get().name
|
||||
it.headImgUrl = mySelf.get().icon
|
||||
@@ -812,7 +812,7 @@ object MoGoChatFacade: IMoGoChatFacade {
|
||||
}
|
||||
val response = serverApi.inviteJoinVehicleTeam(CallRequestParam().also {
|
||||
val user = mySelf.get()
|
||||
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||
val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
it.snSender = mySn
|
||||
it.snReceiver = sn
|
||||
it.nickName = user.name
|
||||
@@ -958,7 +958,7 @@ object MoGoChatFacade: IMoGoChatFacade {
|
||||
}
|
||||
//告之服务器给发送方下发接收通话消息
|
||||
try {
|
||||
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||
val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val response = serverApi.requestConnectStatus(ConnectStatusParam(MoGoAiCloudClientConfig.getInstance().sn, sn, roomId, PUSH_MSG_AGREE_ENTER, CALL_TYPE_VEHICLE_TEAM.type).also {
|
||||
it.nickName = mySelf.get().name
|
||||
it.headImgUrl = mySelf.get().icon
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.eagle.core.data.chat.UserInfo
|
||||
import com.mogo.eagle.core.function.api.chat.biz.ChatConsts
|
||||
import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_VOICE
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.chat.facade.net.bean.*
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
@@ -69,7 +69,7 @@ internal class ChatServiceModel {
|
||||
val map = hashMapOf<String, String>()
|
||||
val sn = MoGoAiCloudClientConfig.getInstance().sn
|
||||
|
||||
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||
val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
if (location != null) {
|
||||
params.lon = location.longitude
|
||||
params.lat = location.latitude
|
||||
@@ -103,7 +103,7 @@ internal class ChatServiceModel {
|
||||
|
||||
suspend fun requestRoomInfo(param: CallRequestParam): BaseResponse<RoomInfo> {
|
||||
val map = hashMapOf<String, String>()
|
||||
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||
val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
if (location != null) {
|
||||
param.lat = location.latitude
|
||||
param.lon = location.longitude
|
||||
|
||||
@@ -57,6 +57,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.mogoaicloudtelematic
|
||||
|
||||
implementation rootProject.ext.dependencies.mogoobu
|
||||
implementation rootProject.ext.dependencies.amapnavi3dmap
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
|
||||
@@ -4,6 +4,9 @@ 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.datacenter.IDataCenterProvider
|
||||
import com.mogo.eagle.core.function.datacenter.location.MoGoLocationDispatcher
|
||||
import com.mogo.eagle.core.function.datacenter.v2x.SpeedLimitDispatcher
|
||||
import com.mogo.eagle.core.function.datacenter.v2x.TrafficLightDispatcher
|
||||
|
||||
@Route(path = MogoServicePaths.PATH_DATA_CENTER_MODULE)
|
||||
class DataCenterProvider: IDataCenterProvider {
|
||||
@@ -12,10 +15,16 @@ class DataCenterProvider: IDataCenterProvider {
|
||||
get() = "DataCenterProvider"
|
||||
|
||||
override fun init(context: Context?) {
|
||||
MoGoLocationDispatcher.initListener()
|
||||
|
||||
context?.let {
|
||||
TrafficLightDispatcher.INSTANCE.initServer(it)
|
||||
SpeedLimitDispatcher.INSTANCE.initLimit(it)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
||||
TrafficLightDispatcher.INSTANCE.destroy()
|
||||
SpeedLimitDispatcher.INSTANCE.destroy()
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LO
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.data.trafficlight.toTrafficLightDetail
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotControlProvider
|
||||
import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider
|
||||
import com.mogo.eagle.core.function.datacenter.autopilot.adapter.MoGoAdasListenerImpl
|
||||
import com.mogo.eagle.core.function.datacenter.autopilot.adapter.MoGoAdasMsgConnectStatusListenerImpl
|
||||
@@ -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.IPC_CONNECTION_STATUS
|
||||
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.zhjt.service.chain.ChainLog
|
||||
import com.zhjt.service.chain.TracingConstants
|
||||
@@ -67,8 +68,9 @@ import java.util.concurrent.TimeUnit
|
||||
* @date 2021/9/22 8:43 下午
|
||||
*/
|
||||
@Route(path = MogoServicePaths.PATH_AUTO_PILOT)
|
||||
class MoGoAutopilotProvider :
|
||||
IMoGoAutopilotProvider, IMoGoMapDataCollectProvider.OnMapCollectCmdListener,
|
||||
class MoGoAutopilotControlProvider :
|
||||
IMoGoAutopilotControlProvider,
|
||||
IMoGoMapDataCollectProvider.OnMapCollectCmdListener,
|
||||
IMoGoAutopilotCarConfigListener {
|
||||
private val TAG = "MoGoAutoPilotProvider"
|
||||
private var mContext: Context? = null
|
||||
@@ -104,6 +106,7 @@ class MoGoAutopilotProvider :
|
||||
.setIpcConnectionMode(AdasOptions.IPC_CONNECTION_MODE.FIXATION)
|
||||
.setIpcFixationIP(AdasManager.getInstance().getIPCFixationIPList(mContext))
|
||||
.setClient(false)
|
||||
.setIdentityMode(FunctionBuildConfig.appIdentityMode)
|
||||
// .setSubscribeInterfaceOptions(subscribeInterfaceOptions)//
|
||||
.build()
|
||||
|
||||
@@ -194,6 +197,7 @@ class MoGoAutopilotProvider :
|
||||
val options = AdasOptions
|
||||
.Builder()
|
||||
.setClient(true)
|
||||
.setIdentityMode(FunctionBuildConfig.appIdentityMode)
|
||||
.build()
|
||||
AdasManager.getInstance()
|
||||
.create(options, MoGoAdasMsgConnectStatusListenerImpl())
|
||||
@@ -221,6 +225,7 @@ class MoGoAutopilotProvider :
|
||||
.setIpcConnectionMode(AdasOptions.IPC_CONNECTION_MODE.FIXATION)
|
||||
.setIpcFixationIP(AdasManager.getInstance().getIPCFixationIPList(mContext))
|
||||
.setClient(false)// 乘客端直连工控机改为false
|
||||
.setIdentityMode(FunctionBuildConfig.appIdentityMode)
|
||||
.build()
|
||||
AdasManager.getInstance().create(options, MoGoAdasMsgConnectStatusListenerImpl())
|
||||
//////////////////////////////////注意先后顺序,AdasManager.getInstance().create后才可以设置监听/////////////////////////////////////////////
|
||||
@@ -716,7 +721,20 @@ class MoGoAutopilotProvider :
|
||||
}
|
||||
|
||||
override fun sendSweeperFuTianTaskCmd(fuTianTaskCmd: SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd) {
|
||||
Log.d(TAG, "---- sendSweeperFuTianTaskCmd ----")
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,8 +45,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListen
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordConfig
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordResult
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotStatisticsListenerManager.invokeAutopilotStatistics
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager.invokeChassisLocationGCJ02
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.invokeChassisLocationWGS84
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager.invokePNCActions
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager.invokeAutopilotRotting
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningTrajectoryListenerManager.invokeAutopilotTrajectory
|
||||
@@ -61,7 +59,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.support.obu.ObuScene
|
||||
import com.zhidao.support.adas.high.AdasManager
|
||||
import com.zhidao.support.adas.high.OnAdasListener
|
||||
import com.zhidao.support.adas.high.bean.AutopilotAbility
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatistics
|
||||
import com.zhidao.support.adas.high.common.ProtocolStatus
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
@@ -135,10 +132,8 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
override fun onGnssInfo(header: MessagePad.Header, gnssInfo: MessagePad.GnssInfo) {
|
||||
// WGS84坐标系高精度位置信息
|
||||
invokeChassisLocationWGS84(gnssInfo)
|
||||
// GCJ02高德坐标系位置信息
|
||||
invokeChassisLocationGCJ02(gnssInfo)
|
||||
CallerChassisGnssListenerManager.invokeChassisGnssListener(gnssInfo)
|
||||
|
||||
if (gnssInfo != null) {
|
||||
if (1 == FunctionBuildConfig.gpsProvider) {
|
||||
// 同步给MAP地图
|
||||
@@ -614,8 +609,8 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
* 是否可以启动自动驾驶
|
||||
* 使用方法查看:app_ipc_monitoring/uiMainActivity/onAutopilotAbility
|
||||
*/
|
||||
override fun onAutopilotAbility(ability: AutopilotAbility?) {
|
||||
invokeAutopilotAbility(ability)
|
||||
override fun onAutopilotAbility(isAutopilotAbility: Boolean, unableAutopilotReason: String?) {
|
||||
invokeAutopilotAbility(isAutopilotAbility, unableAutopilotReason)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.mogo.commons.debug.DebugConfig.*
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.cloud.IMoGoCloudListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
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.cloud.CallerCloudListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
@@ -52,13 +52,13 @@ class MoGoAdasMsgConnectStatusListenerImpl :
|
||||
// 同步SN给工控机
|
||||
syncBasicInfoToAutopilot()
|
||||
//每次工控机连接成功后,需同步当前设置的美化模式状态
|
||||
CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode)
|
||||
CallerAutoPilotControlManager.setDemoMode(FunctionBuildConfig.isDemoMode)
|
||||
//当连接状态是关闭美化模式时,同步给工控机
|
||||
if (!FunctionBuildConfig.isDemoMode) {
|
||||
CallerAutoPilotManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
|
||||
CallerAutoPilotControlManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
|
||||
}
|
||||
//每次工控机连接成功后,需同步当前设置的雨天模式状态
|
||||
CallerAutoPilotManager.setRainMode(FunctionBuildConfig.isRainMode)
|
||||
CallerAutoPilotControlManager.setRainMode(FunctionBuildConfig.isRainMode)
|
||||
} else if (ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.DISCONNECTED) {
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "webSocket 连接失败 reason:$reason")
|
||||
if (connectStatus) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.mogo.eagle.core.function.datacenter.autopilot.server
|
||||
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
@@ -26,6 +26,6 @@ class AsyncDataToAutopilotServer private constructor() : IMoGoTrafficLightListen
|
||||
}
|
||||
|
||||
override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) {
|
||||
CallerAutoPilotManager.sendTrafficLightData(trafficLightResult)
|
||||
CallerAutoPilotControlManager.sendTrafficLightData(trafficLightResult)
|
||||
}
|
||||
}
|
||||
@@ -8,9 +8,9 @@ import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager.setDemoMode
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager.setIgnoreConditionDraw
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setDemoMode
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setIgnoreConditionDraw
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
@@ -174,7 +174,7 @@ class TeleMsgHandler : IMsgHandler {
|
||||
|
||||
private fun queryCarConfig() {
|
||||
invokeNettyConnResult("乘客屏请求司机屏向工控机查询配置信息")
|
||||
CallerAutoPilotManager.getCarConfig()
|
||||
CallerAutoPilotControlManager.getCarConfig()
|
||||
}
|
||||
|
||||
override fun handleClientConn2Server(channel: Channel?) {
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.mogo.eagle.core.function.datacenter.location
|
||||
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import mogo.telematics.pad.MessagePad
|
||||
|
||||
/**
|
||||
* 位置回调监听
|
||||
*/
|
||||
interface IMoGoLocationListener {
|
||||
/**
|
||||
* 位置改变回调用
|
||||
* @param gnssInfo 位置信息
|
||||
* @param sourceType 数据来源
|
||||
*/
|
||||
fun onLocationChanged(gnssInfo: MessagePad.GnssInfo, sourceType: DataSourceType)
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user