Merge branch 'dev_arch_opt_3.0' into dev_robosweeper-d_app-module_221230_1.1.0

# Conflicts:
#	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/presenter/SweeperPresenter.java
#	OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/SweeperOperatePanelView.java
#	app_ipc_monitoring/src/main/java/com/zhidao/adas/client/DataDistribution.java
#	app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/MainActivity.java
#	app_mogo_magic_ring/src/main/java/com/zhidao/adas/magic/ui/MainActivity.java
#	core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoHandAdasMsgManager.java
#	core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/bindingcar/BindingcarProvider.java
#	core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt
#	core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/can/CanImpl.kt
#	core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt
#	core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java
#	core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TrafficDataView.java
#	core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotVehicleStateListener.kt
#	core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotVehicleStateListenerManager.kt
#	libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/OnAdasListener.java
#	libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/MyMessageFactory.java
#	libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/VehicleStateMessage.java
This commit is contained in:
donghongyu
2023-01-17 18:09:06 +08:00
1903 changed files with 34839 additions and 33745 deletions

View File

@@ -55,16 +55,15 @@ dependencies {
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
implementation rootProject.ext.dependencies.mogoutils
implementation rootProject.ext.dependencies.mogocommons
implementation rootProject.ext.dependencies.modulecommon
implementation rootProject.ext.dependencies.mogo_core_data
implementation rootProject.ext.dependencies.mogo_core_function_call
implementation rootProject.ext.dependencies.mogo_core_function_v2x
implementation rootProject.ext.dependencies.mogo_core_function_hmi
}else {
implementation project(":core:mogo-core-utils")
implementation project(':foudations:mogo-aicloud-services-sdk')
implementation project(":foudations:mogo-commons")
implementation project(':modules:mogo-module-common')
implementation project(':core:mogo-core-data')
implementation project(":core:mogo-core-utils")
implementation project(':core:mogo-core-function-call')
implementation project(':core:function-impl:mogo-core-function-v2x')
implementation project(':core:function-impl:mogo-core-function-hmi')

View File

@@ -9,9 +9,9 @@ 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.map.MogoMapUIController;
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
import com.mogo.och.bus.passenger.ui.BusPassengerRouteFragment;
@@ -20,6 +20,8 @@ import org.jetbrains.annotations.Nullable;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P;
import java.util.Objects;
/**
* 网约车-Bus-乘客端
*
@@ -82,9 +84,7 @@ public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener
*/
private void stepIntoVrMode() {
CallerLogger.INSTANCE.d( M_TAXI_P + TAG, "进入vr模式" );
MogoMapUIController.getInstance()
.stepInVrMode( true ); // 白天模式
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).stepInVrMode(true); // 白天模式
CallerMoGoUiSettingManager.INSTANCE.stepInDayMode();//白天模式 状态栏字体颜色变黑
}

View File

@@ -1,6 +1,6 @@
package com.mogo.och.bus.passenger.callback;
import com.mogo.eagle.core.data.map.MogoLocation;
import mogo.telematics.pad.MessagePad;
/**
* Created on 2022/3/31
@@ -11,5 +11,5 @@ public interface IBusPassengerControllerStatusCallback {
// 是否vr map模式
void onVRModeChanged(boolean isVRMode);
// 自车定位
void onCarLocationChanged(MogoLocation location);
void onCarLocationChanged(MessagePad.GnssInfo location);
}

View File

@@ -23,7 +23,7 @@ class BusPassengerConst {
}
// OCH arouter 路由path
const val PATH = "/och/api"
const val PATH = "/passenger/api"
// 轮询line
const val LOOP_LINE_2S = 2 * 1000L

View File

@@ -1,5 +1,9 @@
package com.mogo.och.bus.passenger.model;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.QUERY_BUS_P_STATION_DELAY;
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_STOPPED;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
@@ -21,11 +25,13 @@ import com.mogo.commons.module.status.StatusDescriptor;
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.IMoGoAutopilotPlanningListener;
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.api.map.listener.IMoGoMapLocationListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
import com.mogo.eagle.core.network.utils.GsonUtil;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
@@ -49,6 +55,7 @@ import com.mogo.och.bus.passenger.network.BusPassengerServiceManager;
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
import com.mogo.och.common.module.manager.AbnormalFactorsLoopManager;
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
@@ -60,10 +67,6 @@ import mogo.telematics.pad.MessagePad;
import mogo_msg.MogoReportMsg;
import system_master.SystemStatusInfo;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.QUERY_BUS_P_STATION_DELAY;
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_STOPPED;
/**
* Created on 2022/3/31
*/
@@ -88,7 +91,7 @@ public class BusPassengerModel {
private IBusPassegerDriverStatusCallback mDriverStatusCallback; //出车收车状态
private IBusPassengerRouteLineInfoCallback mRouteLineInfoCallback; // bus路线信息更新
private MogoLocation mLocation = null;
private MessagePad.GnssInfo mLocation = null;
private BusPassengerRoutesResult routesResult = null;
@@ -271,10 +274,10 @@ public class BusPassengerModel {
IntentManager.getInstance().registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener );
// 定位监听
CallerMapLocationListenerManager.INSTANCE.addListener(TAG, mMapLocationListener,false);
CallerChassisLocationGCJ20ListenerManager.INSTANCE.addListener(TAG, mMapLocationListener);
//2021.11.1 自动驾驶路线规划接口
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG,moGoAutopilotPlanningListener);
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG,moGoAutopilotPlanningListener);
AbnormalFactorsLoopManager.INSTANCE.startLoopAbnormalFactors(mContext);
}
@@ -289,7 +292,7 @@ public class BusPassengerModel {
.unregisterLifecycleListener(10010);
CallerAutoPilotStatusListenerManager.INSTANCE.removeListener(mGoAutopilotStatusListener);
CallerAutopilotPlanningListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
CallerPlanningRottingListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
AbnormalFactorsLoopManager.INSTANCE.stopLoopAbnormalFactors();
}
@@ -318,13 +321,13 @@ public class BusPassengerModel {
}
};
private final IMoGoMapLocationListener mMapLocationListener = new IMoGoMapLocationListener() {
private final IMoGoChassisLocationGCJ02Listener mMapLocationListener = new IMoGoChassisLocationGCJ02Listener() {
@Override
public void onLocationChanged(@Nullable MogoLocation location, int from, boolean isGps) {
if (null == location) return;
mLocation = location;
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
if (null == gnssInfo) return;
mLocation = gnssInfo;
for (IBusPassengerControllerStatusCallback callback :mControllerStatusCallbackMap.values()){
callback.onCarLocationChanged(location);
callback.onCarLocationChanged(gnssInfo);
}
}
};
@@ -396,11 +399,7 @@ public class BusPassengerModel {
}
};
private final IMoGoAutopilotPlanningListener moGoAutopilotPlanningListener = new IMoGoAutopilotPlanningListener(){
@Override
public void onAutopilotTrajectory(@NonNull List<MessagePad.TrajectoryPoint> trajectoryInfos) {
}
private final IMoGoPlanningRottingListener moGoAutopilotPlanningListener = new IMoGoPlanningRottingListener(){
@Override
public void onAutopilotRotting(@Nullable MessagePad.GlobalPathResp routeList) {

View File

@@ -26,6 +26,8 @@ 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
*/
@@ -110,7 +112,7 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
}
@Override
public void onCarLocationChanged(MogoLocation location) {
public void onCarLocationChanged(MessagePad.GnssInfo location) {
if (location != null){
runOnUIThread(() -> mView.onCarLocationChanged(location));
}

View File

@@ -1,5 +1,7 @@
package com.mogo.och.bus.passenger.ui;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
import android.content.Context;
import android.os.Bundle;
import android.util.AttributeSet;
@@ -25,9 +27,8 @@ 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.map.listener.IMoGoMapLocationListener;
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.och.bus.passenger.R;
import com.mogo.och.bus.passenger.callback.IBusPassengerMapViewCallback;
@@ -36,14 +37,16 @@ import com.mogo.och.bus.passenger.utils.BusPassengerMapAssetStyleUtil;
import java.util.ArrayList;
import java.util.List;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
import mogo.telematics.pad.MessagePad;
/**
* 乘客屏小地图
*/
public class BusPassengerMapDirectionView
extends RelativeLayout
implements IMoGoMapLocationListener, IBusPassengerMapDirectionView, AMap.OnCameraChangeListener {
implements IMoGoChassisLocationGCJ02Listener,
IBusPassengerMapDirectionView,
AMap.OnCameraChangeListener {
//小地图名称
public static final String TAG = "TPMapDirectionView";
@@ -101,14 +104,14 @@ public class BusPassengerMapDirectionView
initAMapView();
// 注册定位监听
CallerMapLocationListenerManager.INSTANCE.addListener(TAG, this, false);
CallerChassisLocationGCJ20ListenerManager.INSTANCE.addListener(TAG, this);
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
// 注册定位监听
CallerMapLocationListenerManager.INSTANCE.removeListener(TAG, false);
CallerChassisLocationGCJ20ListenerManager.INSTANCE.removeListener(TAG);
}
private void initAMapView() {
@@ -171,19 +174,18 @@ public class BusPassengerMapDirectionView
return true;
}
@Override
public void onLocationChanged(@org.jetbrains.annotations.Nullable MogoLocation location, int from, boolean isGps) {
if (location == null) {
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
if (gnssInfo == null) {
return;
}
// CallerLogger.INSTANCE.d(M_BUS_P + TAG, "onCarLocationChanged2 :" + location.getLatitude() + ":" + location.getLongitude());
LatLng currentLatLng = new LatLng(location.getLatitude(), location.getLongitude());
LatLng currentLatLng = new LatLng(gnssInfo.getLatitude(), gnssInfo.getLongitude());
//更新车辆位置
if (mCarMarker != null) {
// CallerLogger.INSTANCE.d(M_BUS_P + TAG, "location.getBearing() = " + location.getBearing());
mCarMarker.setRotateAngle(360 - location.getBearing());
mCarMarker.setRotateAngle((float) (360 - gnssInfo.getHeading()));
mCarMarker.setPosition(currentLatLng);
mCarMarker.setToTop();
}
@@ -208,7 +210,6 @@ public class BusPassengerMapDirectionView
}
@Override
public void drawablePolyline() {
if (mPolyline != null) {

View File

@@ -1,5 +1,7 @@
package com.mogo.och.bus.passenger.ui;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
@@ -14,7 +16,6 @@ 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.data.map.MogoLocation;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
@@ -31,7 +32,7 @@ import com.mogo.och.common.module.wigets.MarqueeTextView;
import java.util.ArrayList;
import java.util.List;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
import mogo.telematics.pad.MessagePad;
/**
* @author: wangmingjun
@@ -301,8 +302,8 @@ public class BusPassengerRouteFragment extends
lastBearing = bearing;
}
public void onCarLocationChanged(MogoLocation location) {
updateSpeedView(location.getSpeed());
public void onCarLocationChanged(MessagePad.GnssInfo location) {
updateSpeedView((float) location.getVehicleSpeed());
}
public void updateSpeedView(float speed){

View File

@@ -59,14 +59,12 @@ dependencies {
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
implementation rootProject.ext.dependencies.mogoutils
implementation rootProject.ext.dependencies.mogocommons
implementation rootProject.ext.dependencies.modulecommon
implementation rootProject.ext.dependencies.mogo_core_data
implementation rootProject.ext.dependencies.mogo_core_function_call
implementation rootProject.ext.dependencies.mogo_core_function_hmi
}else {
implementation project(":core:mogo-core-utils")
implementation project(":foudations:mogo-commons")
implementation project(':modules:mogo-module-common')
implementation project(':core:mogo-core-data')
implementation project(':core:mogo-core-function-call')
implementation project(':core:function-impl:mogo-core-function-hmi')

View File

@@ -13,14 +13,16 @@ 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.MogoMapUIController;
import com.mogo.och.bus.constant.BusConst;
import com.mogo.och.bus.fragment.BusFragment;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Objects;
/**
* 网约车小巴业务实现入口
*
@@ -40,8 +42,7 @@ public class BusProvider implements IMogoOCH {
*/
private void stepIntoVrMode() {
CallerLogger.INSTANCE.d(M_BUS + TAG, "进入vr模式");
MogoMapUIController.getInstance()
.stepInVrMode(false);
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).stepInVrMode(false);
}
@Override

View File

@@ -2,6 +2,8 @@ package com.mogo.och.bus.callback;
import com.mogo.eagle.core.data.map.MogoLocation;
import mogo.telematics.pad.MessagePad;
/**
* Created on 2021/9/10
*
@@ -11,7 +13,7 @@ public interface IBusControllerStatusCallback {
// 是否vr map模式
void onVRModeChanged(boolean isVRMode);
// 自车定位
void onCarLocationChanged(MogoLocation location);
void onCarLocationChanged(MessagePad.GnssInfo location);
//开始开启自动驾驶
void startOpenAutopilot();
}

View File

@@ -23,7 +23,7 @@ class BusConst {
}
// OCH arouter 路由path
const val PATH = "/och/api"
const val PATH = "/driver/api"
// 测试用的广播
const val BROADCAST_TEST_BUS_CONTROL_TYPE_EXTRA_KEY = "sceneType"

View File

@@ -4,9 +4,7 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS
import static com.mogo.och.bus.constant.BusConst.TIMER_START_AUTOPILOT_INTERVAL;
import android.animation.ObjectAnimator;
import android.content.Intent;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -21,12 +19,9 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.Group;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.mvp.IView;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.mvp.Presenter;
import com.mogo.commons.voice.AIAssist;
import com.mogo.eagle.core.data.config.HmiBuildConfig;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
@@ -34,27 +29,23 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
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.hmi.ui.widget.TrafficDataView;
import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.MogoMapUIController;
import com.mogo.map.MogoMarkerManager;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.listener.MogoMapListenerHandler;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.och.bus.R;
import com.mogo.och.bus.bean.BusRoutesResult;
import com.mogo.och.bus.constant.BusConst;
import com.mogo.och.bus.model.BusOrderModel;
import com.mogo.och.bus.util.BDRouteDataTestUtils;
import com.mogo.och.bus.view.SlidePanelView;
import com.mogo.och.common.module.utils.SoundPoolHelper;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.ThreadMode;
import mogo.telematics.pad.MessagePad;
import record_cache.RecordPanelOuterClass;
@@ -68,7 +59,7 @@ import record_cache.RecordPanelOuterClass;
*/
public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> implements IMogoMapListener, IMoGoAutopilotRecordListener {
private static final String TAG = "BaseOchFragment";
private static final String TAG = "BaseBusTabFragment";
protected SlidePanelView slidePanelView;
private RelativeLayout ctvAutopilotStatus;
@@ -83,8 +74,6 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
private TrafficDataView mTrafficDataView;
// private BusTrafficLightView mTrafficLightView;
public static final String TYPE_ENTRANCE = "entrance";
//远景和中景的切换
private ImageView mSwitchMapModeImage;
private LinearLayout mSwitchMapModeLayout;
@@ -133,26 +122,21 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
updateSwitchMapIcon();
mSwitchMapModeLayout.setOnClickListener(new OnPreventFastClickListener() {
@Override
public void onClickImpl(View v) {
//切换地图的远近视图
if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isLongSight()) {
// 2.11.0去掉
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).visibleAllMarkers();
MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
} else if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isMediumSight()) {
// 2.11.0去掉
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
// .inVisibleWithoutMarkers(DataTypes.TYPE_MARKER_ADAS, BusConst.TYPE_MARKER_BUS_ORDER);
MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
} else {
// 2.11.0去掉
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).visibleAllMarkers();
MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
if (controller != null) {
//切换地图的远近视图
if (controller.getCurrentMapVisualAngle().isLongSight()) {
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
} else {
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
}
}
}
});
@@ -188,7 +172,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
);
findViewById(R.id.btnAutopilotRoute).setOnClickListener(view -> debugArrivedRoute());
tvArrived.setOnClickListener(view -> {
onArriveStation();
});
@@ -226,12 +210,15 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
protected abstract void onArriveStation();
private void updateSwitchMapIcon() {
if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isLongSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
} else if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isMediumSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
} else {
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
if (controller != null) {
if (controller.getCurrentMapVisualAngle().isLongSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
} else {
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
}
}
}
@@ -267,7 +254,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
protected abstract void debugArrivedStation();
private void initListener() {
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().registerMogoMapListener(TYPE_ENTRANCE, this);
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().registerHostMapListener(TAG, this);
}
/**
@@ -376,15 +363,15 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
// 主动开启自动驾驶中不为2为0、1则继续loading
return;
}
if (isAnimateRunning){
if (isAnimateRunning) {
stopAnimAndUpdateBtnStatus();
}else {
} else {
setAutopilotBtnStatus(autopilotStatus);
}
}
public void stopAnimAndUpdateBtnStatus(){
public void stopAnimAndUpdateBtnStatus() {
stopAutopilotAnimation();
updateAutopilotStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState());
}
@@ -494,7 +481,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
@Override
public void onDestroy() {
super.onDestroy();
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().unregisterMogoMapListener(TYPE_ENTRANCE);
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().unregisterHostMapListener(TAG);
}
@Override

View File

@@ -19,10 +19,10 @@ 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;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.map.MogoMarkerManager;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.och.bus.R;
@@ -43,6 +43,7 @@ import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.List;
import java.util.Objects;
/**
@@ -456,42 +457,35 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
*/
private void setOrRemoveMapMaker(boolean isAdd, String uuid, double lat, double longi,int resourceId) {
if (isAdd) {
Runnable setMapMarkerRunnable = new Runnable() {
@Override
public void run() {
CallerLogger.INSTANCE.d(M_BUS + "setMapMaker= "+Thread.currentThread().getName(),
uuid + "=latitude=" + lat + ",longitude=" + longi);
Runnable setMapMarkerRunnable = () -> {
CallerLogger.INSTANCE.d(M_BUS + "setMapMaker= "+Thread.currentThread().getName(),
uuid + "=latitude=" + lat + ",longitude=" + longi);
MogoMarkerOptions options = new MogoMarkerOptions()
.owner(BusConst.TYPE_MARKER_BUS_ORDER)
.anchor(0.5f, 0.5f)
.set3DMode(true)
.gps(true)
.controlAngle(true)
.icon3DRes(resourceId)
.latitude(lat)
.longitude(longi);
IMogoMarker marker = MogoMarkerManager.getInstance(AbsMogoApplication.getApp()) .addMarker(uuid, options);
CenterLine centerLine = CallerHDMapManager.INSTANCE.getCenterLineInfo(
longi,lat,-1);
if (null != centerLine && marker != null) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致 地图未初始化会返回空
marker.setRotateAngle(centerLine.getAngle().floatValue());
}
MogoMarkerOptions options = new MogoMarkerOptions()
.owner(BusConst.TYPE_MARKER_BUS_ORDER)
.anchor(0.5f, 0.5f)
.set3DMode(true)
.gps(true)
.controlAngle(true)
.icon3DRes(resourceId)
.latitude(lat)
.longitude(longi);
IMogoMarker marker = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerManager(AbsMogoApplication.getApp())).addMarker(uuid, options);
CenterLine centerLine = CallerHDMapManager.INSTANCE.getCenterLineInfo(
longi,lat,-1);
if (null != centerLine && marker != null) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致 地图未初始化会返回空
marker.setRotateAngle(centerLine.getAngle().floatValue());
}
};
OCHThreadPoolManager.getsInstance().execute(setMapMarkerRunnable);
}else {
Runnable removeMapMarkerRunnable = new Runnable() {
@Override
public void run() {
CallerLogger.INSTANCE.d(M_BUS + "RemoveMapMaker="+Thread.currentThread().getName(),
uuid+"=latitude="+lat+",longitude="+longi);
MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).removeMarkers(uuid);
}
Runnable removeMapMarkerRunnable = () -> {
CallerLogger.INSTANCE.d(M_BUS + "RemoveMapMaker="+Thread.currentThread().getName(),
uuid+"=latitude="+lat+",longitude="+longi);
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerManager(AbsMogoApplication.getApp())).removeMarkers(uuid);
};
OCHThreadPoolManager.getsInstance().execute(removeMapMarkerRunnable);
}
}

View File

@@ -24,13 +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.IMoGoAutopilotPlanningListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
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.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
@@ -151,12 +151,12 @@ public class BusOrderModel {
mContext = AbsMogoApplication.getApp();
loginService = (LoginService) ARouter.getInstance().build(OchCommonConst.LOGINSERVICE).navigation();
// 定位监听
CallerMapLocationListenerManager.INSTANCE.addListener(TAG, mMapLocationListener, false);
CallerChassisLocationGCJ20ListenerManager.INSTANCE.addListener(TAG, mMapLocationListener);
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
//自动驾驶路线规划接口
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
//开启自驾后 异常信息返回
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(mAdasStartFailureListener);
@@ -266,12 +266,7 @@ public class BusOrderModel {
this.mControllerStatusCallback = callback;
}
private final IMoGoAutopilotPlanningListener moGoAutopilotPlanningListener = new IMoGoAutopilotPlanningListener() {
@Override
public void onAutopilotTrajectory(@NonNull List<MessagePad.TrajectoryPoint> trajectoryInfos) {
}
private final IMoGoPlanningRottingListener moGoAutopilotPlanningListener = new IMoGoPlanningRottingListener() {
@Override
public void onAutopilotRotting(MessagePad.GlobalPathResp routeList) {
@@ -339,7 +334,7 @@ public class BusOrderModel {
CallerMapLocationListenerManager.INSTANCE.removeListener(TAG,false);
//自动驾驶路线规划接口
CallerAutopilotPlanningListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
CallerPlanningRottingListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
loginService = null;
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(null);
@@ -381,25 +376,25 @@ public class BusOrderModel {
};
// 自车定位
private final IMoGoMapLocationListener mMapLocationListener = new IMoGoMapLocationListener() {
private final IMoGoChassisLocationGCJ02Listener mMapLocationListener = new IMoGoChassisLocationGCJ02Listener() {
@Override
public void onLocationChanged(@Nullable MogoLocation location, int from, boolean isGps) {
if (null == location) return;
mLongitude = location.getLongitude();
mLatitude = location.getLatitude();
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
if (null == gnssInfo) return;
mLongitude = gnssInfo.getLongitude();
mLatitude = gnssInfo.getLatitude();
if (mControllerStatusCallback != null) {
mControllerStatusCallback.onCarLocationChanged(location);
mControllerStatusCallback.onCarLocationChanged(gnssInfo);
}
//是否到站的围栏判断 离站状态并且自动驾驶还未触发到站
if (isGoingToNextStation && !isArrivedStation) {
judgeArrivedStation(location);
judgeArrivedStation(gnssInfo);
}
}
};
//根据围栏判断,是否到达站点
private void judgeArrivedStation(MogoLocation location) {
private void judgeArrivedStation(MessagePad.GnssInfo location) {
if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) {
CallerLogger.INSTANCE.e(M_BUS + TAG, "到站数组越界");

View File

@@ -233,9 +233,9 @@ public class BusPresenter extends Presenter<BusFragment>
}
@Override
public void onCarLocationChanged(MogoLocation location) {
public void onCarLocationChanged(MessagePad.GnssInfo location) {
if (null != location) {
runOnUIThread(() -> mView.updateSpeedView(location.getSpeed()));
runOnUIThread(() -> mView.updateSpeedView((float) location.getVehicleSpeed()));
}
}

View File

@@ -60,7 +60,6 @@ dependencies {
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
implementation rootProject.ext.dependencies.mogoutils
implementation rootProject.ext.dependencies.mogocommons
implementation rootProject.ext.dependencies.modulecommon
implementation rootProject.ext.dependencies.mogo_core_data
implementation rootProject.ext.dependencies.mogo_core_function_call
implementation rootProject.ext.dependencies.mogo_core_function_v2x
@@ -68,7 +67,6 @@ dependencies {
}else {
implementation project(":core:mogo-core-utils")
implementation project(":foudations:mogo-commons")
implementation project(':modules:mogo-module-common')
implementation project(':core:mogo-core-data')
implementation project(':core:mogo-core-function-call')
implementation project(':core:function-impl:mogo-core-function-v2x')

View File

@@ -3,20 +3,22 @@ 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.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
import com.mogo.eagle.core.utilcode.util.NetworkUtils
import com.mogo.eagle.core.utilcode.util.SharedPrefs
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.map.navi.IMogoCarLocationChangedListener2
import com.mogo.module.common.MogoApisHandler
import com.mogo.och.common.module.R
import com.mogo.och.common.module.biz.bean.TaxiLoginReqBean
import com.mogo.och.common.module.biz.bean.TaxiLoginRespBean
import com.mogo.och.common.module.biz.callback.ITaxiLoginCallback
import com.mogo.och.common.module.biz.constant.TaxiLoginStatusEnum
import com.mogo.och.common.module.biz.constant.LoginStatusManager
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
@@ -25,7 +27,7 @@ import com.mogo.och.common.module.utils.ToastUtilsOch
* 网约车 - 出租车业务逻辑处理
*/
@SuppressLint("StaticFieldLeak")
object OchCommonLoginModel{
object OchCommonLoginModel : IMoGoChassisLocationGCJ02Listener {
private val TAG = "TaxiLoginModel"
private var mContext: Context? = null
@@ -35,20 +37,21 @@ object OchCommonLoginModel{
fun init(context: Context) {
mContext = context.applicationContext
// 达到起始站围栏监听
MogoApisHandler.getInstance().apis.registerCenterApi.registerCarLocationChangedListener(TAG, mCarLocationChangedListener2)
CallerChassisLocationGCJ20ListenerManager.addListener(TAG, this)
}
fun hasInit():Boolean{
if(mContext==null&& iTaxiLoginCallback==null){
return false;
fun hasInit(): Boolean {
if (mContext == null && iTaxiLoginCallback == null) {
return false
}
return true
}
// 自车定位
private val mCarLocationChangedListener2 = IMogoCarLocationChangedListener2 { location ->
mLongitude = location.longitude
mLatitude = location.latitude
override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) {
gnssInfo?.let {
mLongitude = it.longitude
mLatitude = it.latitude
}
}
fun getiTaxiLoginCallback(): ITaxiLoginCallback? {
@@ -63,8 +66,7 @@ object OchCommonLoginModel{
mContext = null
iTaxiLoginCallback = null
// 注销到达起始站围栏监听
MogoApisHandler.getInstance().apis.registerCenterApi
.unregisterCarLocationChangedListener(TAG, mCarLocationChangedListener2)
CallerMapLocationListenerManager.removeListener(TAG, false)
}
/**
@@ -95,7 +97,7 @@ object OchCommonLoginModel{
}
override fun onFail(code: Int, msg: String) {
ToastUtilsOch.showWithCodeMessage(code,msg)
ToastUtilsOch.showWithCodeMessage(code, msg)
}
})
}
@@ -113,7 +115,7 @@ object OchCommonLoginModel{
ToastUtils.showShort(mContext?.getString(R.string.module_och_taxi_login_login_success))
LoginStatusManager.setLoginStatus(TaxiLoginStatusEnum.Login)
mContext?.let {
SharedPrefs.getInstance(it).putString("och_account",phone)
SharedPrefs.getInstance(it).putString("och_account", phone)
}
iTaxiLoginCallback?.loginSuccess()
} else {
@@ -132,9 +134,10 @@ object OchCommonLoginModel{
}
override fun onFail(code: Int, msg: String) {
ToastUtilsOch.showWithCodeMessage(code,msg)
ToastUtilsOch.showWithCodeMessage(code, msg)
}
})
}
}
}

View File

@@ -12,7 +12,10 @@ import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.data.BaseData
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.och.common.module.R
import com.mogo.och.common.module.biz.network.interceptor.transformTry
import io.reactivex.Observable
@@ -59,23 +62,22 @@ object OchCommonServiceManager {
) {
val sn = MoGoAiCloudClientConfig.getInstance().sn
var taxiLoginRespBeanObservable: Observable<TaxiLoginRespBean>? = null
when (DebugConfig.getProductFlavor()) {
"fPadLenovoOchTaxi" -> {
//出租车司机
taxiLoginRespBeanObservable = mOCHTaxiServiceApi.gotoLoginBycode4Taxi(
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) &&
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
//出租车司机
taxiLoginRespBeanObservable = mOCHTaxiServiceApi.gotoLoginBycode4Taxi(
MoGoAiCloudClientConfig.getInstance().serviceAppId,
MoGoAiCloudClientConfig.getInstance().token,
TaxiLoginReqBean(phone, code, sn, location4Login)
).transformTry()
}
"fPadLenovoOchBus" -> {
//小巴车司机
taxiLoginRespBeanObservable = mOCHTaxiServiceApi.gotoLoginBycode4Bus(
).transformTry()
} else if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) &&
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
//小巴车司机
taxiLoginRespBeanObservable = mOCHTaxiServiceApi.gotoLoginBycode4Bus(
MoGoAiCloudClientConfig.getInstance().serviceAppId,
MoGoAiCloudClientConfig.getInstance().token,
TaxiLoginReqBean(phone, code, sn, location4Login)
).transformTry()
}
).transformTry()
}
taxiLoginRespBeanObservable?.subscribe(OchCommonSubscribeImpl(context, callback, "gotoLoginBycode"))
}
@@ -90,23 +92,22 @@ object OchCommonServiceManager {
callback: OchCommonServiceCallback<BaseData>?
) {
var logout: Observable<BaseData>? = null
when (DebugConfig.getProductFlavor()) {
"fPadLenovoOchTaxi" -> {
//出租车司机
logout = mOCHTaxiServiceApi.logout4Taxi(
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) &&
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
//出租车司机
logout = mOCHTaxiServiceApi.logout4Taxi(
MoGoAiCloudClientConfig.getInstance().serviceAppId,
MoGoAiCloudClientConfig.getInstance().token,
TaxiLogoutReqBean(MoGoAiCloudClientConfig.getInstance().sn, location4Login)
).transformTry()
}
"fPadLenovoOchBus" -> {
//小巴车司机
logout = mOCHTaxiServiceApi.logout4Bus(
).transformTry()
} else if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) &&
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
//小巴车司机
logout = mOCHTaxiServiceApi.logout4Bus(
MoGoAiCloudClientConfig.getInstance().serviceAppId,
MoGoAiCloudClientConfig.getInstance().token,
TaxiLogoutReqBean(MoGoAiCloudClientConfig.getInstance().sn, location4Login)
).transformTry()
}
).transformTry()
}
logout?.subscribe(OchCommonSubscribeImpl(context, callback, "logout"))
}
@@ -128,19 +129,18 @@ object OchCommonServiceManager {
return
}
var flavor = ""
when (DebugConfig.getProductFlavor()) {
"fPadLenovoOchTaxi" -> {
//出租车司机
flavor = "taxi"
}
"fPadLenovoOchBus" -> {
//小巴车司机
flavor = "bus"
}
"fPadLenovoOchBusPassenger" -> {
//小巴车乘客
flavor = "bus/passenger"
}
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) &&
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
//出租车司机
flavor = "taxi"
} else if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) &&
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
//小巴车司机
flavor = "bus"
}else if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) &&
AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
//小巴车乘客
flavor = "bus/passenger"
}
mOCHTaxiServiceApi.queryDriverServiceStatusAndLoginStatus(
flavor,

View File

@@ -21,13 +21,18 @@ import com.alibaba.android.arouter.launcher.ARouter
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.debug.DebugConfig
import com.mogo.commons.mvp.MvpDialogFragment
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.KeyboardUtils
import com.mogo.och.common.module.R
import com.mogo.och.common.module.biz.bean.TaxiLoginReqBean
import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.och.common.module.biz.network.OchCommonServiceManager
import com.mogo.och.common.module.biz.network.interceptor.transformTry
import com.mogo.och.common.module.biz.presenter.OchCommonLoginPresenter
import com.mogo.och.common.module.biz.provider.LoginService
@@ -89,13 +94,14 @@ class TaxiLoginDialogFragment :
}
private fun initBg() {
when (DebugConfig.getProductFlavor()) {
"fPadLenovoOchTaxi" -> {
acivLoginBg.setImageResource(R.drawable.taxi_ic_login_bg)
}
"fPadLenovoOchBus" -> {
acivLoginBg.setImageResource(R.drawable.bus_ic_login_bg)
}
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) &&
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
//出租车司机
acivLoginBg.setImageResource(R.drawable.taxi_ic_login_bg)
} else if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) &&
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
//小巴车司机
acivLoginBg.setImageResource(R.drawable.bus_ic_login_bg)
}
}

View File

@@ -7,6 +7,7 @@ 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.data.config.FunctionBuildConfig
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.i
import com.mogo.eagle.core.utilcode.util.NetworkUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
@@ -69,7 +70,8 @@ object AbnormalFactorsLoopManager : IMogoStatusChangedListener {
if (!locationStatusPermsStatus) toastStr += "定位服务异常 "
if (!networkStatus) toastStr += " 网络异常 "
if (!socketStatus && !DebugConfig.getProductFlavor().contains("Passenger")) toastStr += " 长链接异常 "
//乘客屏不显示长链接异常
if (!socketStatus && !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) toastStr += " 长链接异常 "
i(TAG, "abnormal_factors_Str = $toastStr")

View File

@@ -4,11 +4,12 @@ import android.content.Context;
import androidx.annotation.Nullable;
import com.mogo.commons.debug.DebugConfig;
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;
@@ -86,7 +87,7 @@ public class OCHAdasAbilityManager implements IMoGoAutopilotActionsListener, IMo
autopilotAbilityReason = "挡位不正常";
}
if (DebugConfig.getProductFlavor() == "fPadLenovoOchBus" &&
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) &&
ability.gear == Chassis.GearPosition.GEAR_N){ //bus档位不正常
isAutopilotAbility = false;
autopilotAbilityReason = "挡位不正常";

View File

@@ -1,6 +1,7 @@
package com.mogo.och.common.module.utils
import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_SWEEPER
@@ -8,29 +9,27 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_TAXI_P
object CallerLoggerUtils {
var flavorTag = when (DebugConfig.getProductFlavor()) {
"fPadLenovoOchTaxi" -> {
//出租车司机
M_TAXI
}
"fPadLenovoOchBus" -> {
//小巴车司机
M_BUS
}
"fPadLenovoOchTaxiPassenger" -> {
//出租车乘客
M_TAXI_P
}
"fPadLenovoOchBusPassenger" -> {
//小巴车乘客
M_BUS_P
}
"fPadLenovoOchSweeper" -> {
//清扫车
M_SWEEPER
}
else -> {
""
}
var flavorTag =if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)&&
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
//出租车司机
M_TAXI
}else if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)&&
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
//小巴车司机
M_BUS
}else if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)&&
AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)){
//出租车乘客
M_TAXI_P
}else if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)&&
AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)){
//小巴车乘客
M_BUS_P
}else if (AppIdentityModeUtils.isSweeper(FunctionBuildConfig.appIdentityMode)){
//清扫车
M_SWEEPER
}
else{
""
}
}

View File

@@ -231,7 +231,7 @@ public class CoordinateCalculateRouteUtil {
*/
public static Map<Integer,List<MogoLocation>> getRemainPointListByCompareNew(int preIndex,
List<MogoLocation> mRoutePoints,
MogoLocation realLocation) {
MessagePad.GnssInfo 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.getBearing() == realLocation.getBearing() - latLng.getBearing() ||
Math.abs(realLocation.getBearing() - latLng.getBearing()) <= 90){
if (realLocation.getHeading() == realLocation.getHeading() - latLng.getBearing() ||
Math.abs(realLocation.getHeading() - latLng.getBearing()) <= 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,
MogoLocation realLocation) {
MessagePad.GnssInfo 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.getBearing() == realLocation.getBearing() - latLng.getBearing() ||
Math.abs(realLocation.getBearing() - latLng.getBearing()) <= 90){
if (realLocation.getHeading() == realLocation.getHeading() - latLng.getBearing() ||
Math.abs(realLocation.getHeading() - latLng.getBearing()) <= 90){
float diff = CoordinateUtils.calculateLineDistance(realLocation.getLongitude(),
realLocation.getLatitude(),
latLng.getLongitude(), latLng.getLatitude());

View File

@@ -42,13 +42,11 @@ dependencies {
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
implementation rootProject.ext.dependencies.mogoutils
implementation rootProject.ext.dependencies.mogocommons
implementation rootProject.ext.dependencies.modulecommon
implementation rootProject.ext.dependencies.mogo_core_data
implementation rootProject.ext.dependencies.mogo_core_function_call
}else {
implementation project(":core:mogo-core-utils")
implementation project(":foudations:mogo-commons")
implementation project(':modules:mogo-module-common')
implementation project(':core:mogo-core-data')
implementation project(':core:mogo-core-function-call')
}

View File

@@ -12,5 +12,5 @@ class OCHConstants {
/**
* arouter 路由地址
*/
public static final String PATH = "/och/api";
public static final String PATH = "/driver/api";
}

View File

@@ -58,14 +58,12 @@ dependencies {
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
implementation rootProject.ext.dependencies.mogoutils
implementation rootProject.ext.dependencies.mogocommons
implementation rootProject.ext.dependencies.modulecommon
implementation rootProject.ext.dependencies.mogo_core_data
implementation rootProject.ext.dependencies.mogo_core_function_call
implementation rootProject.ext.dependencies.mogo_core_function_hmi
}else {
implementation project(":core:mogo-core-utils")
implementation project(":foudations:mogo-commons")
implementation project(':modules:mogo-module-common')
implementation project(':core:mogo-core-data')
implementation project(':core:mogo-core-function-call')
implementation project(':core:function-impl:mogo-core-function-hmi')

View File

@@ -11,14 +11,16 @@ 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.MogoMapUIController;
import com.mogo.och.sweeper.constant.SweeperConst;
import com.mogo.och.sweeper.fragment.SweeperFragment;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Objects;
/**
* 清扫车业务实现入口
*
@@ -38,7 +40,7 @@ public class SweeperProvider implements IMogoOCH {
*/
private void stepIntoVrMode(){
CallerLogger.INSTANCE.d( M_BUS + TAG, "进入vr模式" );
MogoMapUIController.getInstance()
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController())
.stepInVrMode(false);
}

View File

@@ -1,6 +1,6 @@
package com.mogo.och.sweeper.callback;
import com.mogo.eagle.core.data.map.MogoLocation;
import mogo.telematics.pad.MessagePad;
/**
* Created on 2021/9/10
@@ -11,7 +11,7 @@ public interface ISweeperControllerStatusCallback {
// 是否vr map模式
void onVRModeChanged(boolean isVRMode);
// 自车定位
void onCarLocationChanged(MogoLocation location);
void onCarLocationChanged(MessagePad.GnssInfo location);
//开始开启自动驾驶
void startOpenAutopilot();
}

View File

@@ -23,7 +23,7 @@ class SweeperConst {
}
// OCH arouter 路由path
const val PATH = "/och/api"
const val PATH = "/driver/api"
// 测试用的广播
const val BROADCAST_TEST_SWEEPER_CONTROL_TYPE_EXTRA_KEY = "sceneType"

View File

@@ -22,13 +22,18 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
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.hmi.ui.widget.TrafficDataView;
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;
import com.mogo.map.MogoMapUIController;
import com.mogo.map.MogoMarkerManager;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.listener.MogoMapListenerHandler;
import com.mogo.map.marker.IMogoMarkerManager;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.och.sweeper.R;
import com.mogo.och.sweeper.constant.SweeperConst;
import com.mogo.och.sweeper.ui.SweeperOperatePanelView;
@@ -53,7 +58,7 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS
*/
public abstract class BaseSweeperTabFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> implements IMogoMapListener{
private static final String TAG = "BaseOchFragment";
private static final String TAG = "BaseSweeperTabFragment";
protected RelativeLayout mSettingBtn;
protected RelativeLayout mBadcaseBtn;
@@ -67,8 +72,6 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
//清扫车模式选择面板
private SweeperOperatePanelView mOperatePanel;
public static final String TYPE_ENTRANCE = "entrance";
//远景和中景的切换
private ImageView mSwitchMapModeImage;
private LinearLayout mSwitchMapModeLayout;
@@ -98,23 +101,27 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
@Override
public void onClickImpl(View v) {
//切换地图的远近视图
if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isLongSight()) {
// 2.11.0去掉
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
IMogoMarkerManager markerManager = CallerMapUIServiceManager.INSTANCE.getMarkerManager(AbsMogoApplication.getApp());
if (controller != null && markerManager != null) {
//切换地图的远近视图
if (controller.getCurrentMapVisualAngle().isLongSight()) {
// 2.11.0去掉
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).visibleAllMarkers();
MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_medium);
} else if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isMediumSight()) {
// 2.11.0去掉
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_medium);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
// 2.11.0去掉
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
// .inVisibleWithoutMarkers(DataTypes.TYPE_MARKER_ADAS, BusConst.TYPE_MARKER_BUS_ORDER);
MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_long);
} else {
// 2.11.0去掉
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_long);
} else {
// 2.11.0去掉
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).visibleAllMarkers();
MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_long);
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_long);
}
}
}
});
@@ -169,12 +176,15 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
}
private void updateSwitchMapIcon() {
if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isLongSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_long);
} else if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isMediumSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_medium);
} else {
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_medium);
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
if (controller != null) {
if (controller.getCurrentMapVisualAngle().isLongSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_long);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_medium);
} else {
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_medium);
}
}
}
@@ -186,7 +196,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
}
}
private void initListener() {
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().registerMogoMapListener(TYPE_ENTRANCE, this);
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().registerHostMapListener(TAG, this);
}
public View getPanelView() {
@@ -234,7 +244,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
@Override
public void onDestroy() {
super.onDestroy();
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().unregisterMogoMapListener(TYPE_ENTRANCE);
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().unregisterHostMapListener(TAG);
}
@Override

View File

@@ -4,18 +4,14 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS
import static com.mogo.och.sweeper.constant.SweeperConst.STATION_STATUS_STOPPED;
import android.content.Context;
import android.location.Location;
import android.os.Handler;
import android.os.Message;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.amap.api.maps.model.LatLng;
import com.elegant.network.utils.GsonUtil;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.module.status.IMogoStatusChangedListener;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.commons.module.status.StatusDescriptor;
@@ -23,39 +19,34 @@ import com.mogo.commons.voice.AIAssist;
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.IMoGoAutopilotPlanningListener;
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
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.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
import com.mogo.och.sweeper.bean.QueryLeaveAwayPassengersResponse;
import com.mogo.och.sweeper.bean.SweeperOperationStatusResponse;
import com.mogo.och.sweeper.bean.SweeperRoutePlanningUpdateReqBean;
import com.mogo.och.sweeper.bean.SweeperRoutesResponse;
import com.mogo.och.sweeper.bean.SweeperRoutesResult;
import com.mogo.och.sweeper.bean.SweeperStationBean;
import com.mogo.och.sweeper.bean.QueryLeaveAwayPassengersResponse;
import com.mogo.och.sweeper.callback.ICarOperationStatusCallback;
import com.mogo.och.sweeper.callback.ISweeperControllerStatusCallback;
import com.mogo.och.sweeper.callback.IRefreshSweeperStationsCallback;
import com.mogo.och.sweeper.callback.ISlidePannelHideCallback;
import com.mogo.och.sweeper.callback.ISweeperControllerStatusCallback;
import com.mogo.och.sweeper.constant.SweeperConst;
import com.mogo.och.sweeper.net.SweeperServiceManager;
import com.mogo.och.sweeper.net.ISweeperServiceCallback;
import com.mogo.och.sweeper.net.SweeperServiceManager;
import com.mogo.och.sweeper.presenter.SweeperModelLoopManager;
import com.mogo.och.sweeper.util.SweeperAnalyticsManager;
import com.mogo.och.sweeper.util.SweeperTrajectoryManager;
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
import com.mogo.och.common.module.utils.PinYinUtil;
import com.zhjt.service.chain.ChainLog;
import com.zhjt.service.chain.TracingConstants;
import java.io.IOException;
import java.util.ArrayList;
@@ -132,12 +123,12 @@ public class SweeperOrderModel {
public void init() {
mContext = AbsMogoApplication.getApp();
// 定位监听
CallerMapLocationListenerManager.INSTANCE.addListener(TAG,mMapLocationListener,false);
CallerChassisLocationGCJ20ListenerManager.INSTANCE.addListener(TAG,mMapLocationListener);
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
//自动驾驶路线规划接口
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
//2022.1.28
@@ -195,12 +186,7 @@ public class SweeperOrderModel {
this.mControllerStatusCallback = callback;
}
private final IMoGoAutopilotPlanningListener moGoAutopilotPlanningListener = new IMoGoAutopilotPlanningListener() {
@Override
public void onAutopilotTrajectory(@NonNull List<MessagePad.TrajectoryPoint> trajectoryInfos) {
}
private final IMoGoPlanningRottingListener moGoAutopilotPlanningListener = new IMoGoPlanningRottingListener() {
@Override
public void onAutopilotRotting(MessagePad.GlobalPathResp routeList) {
@@ -265,7 +251,7 @@ public class SweeperOrderModel {
CallerMapLocationListenerManager.INSTANCE.removeListener(TAG,false);
//自动驾驶路线规划接口
CallerAutopilotPlanningListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
CallerPlanningRottingListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
}
private Object readResolve() {
@@ -286,25 +272,25 @@ public class SweeperOrderModel {
};
// 自车定位
private final IMoGoMapLocationListener mMapLocationListener = new IMoGoMapLocationListener() {
private final IMoGoChassisLocationGCJ02Listener mMapLocationListener = new IMoGoChassisLocationGCJ02Listener() {
@Override
public void onLocationChanged(@Nullable MogoLocation location, int from, boolean isGps) {
if (null == location) return;
mLongitude = location.getLongitude();
mLatitude = location.getLatitude();
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
if (null == gnssInfo) return;
mLongitude = gnssInfo.getLongitude();
mLatitude = gnssInfo.getLatitude();
if (mControllerStatusCallback != null) {
mControllerStatusCallback.onCarLocationChanged(location);
mControllerStatusCallback.onCarLocationChanged(gnssInfo);
}
//是否到站的围栏判断 离站状态并且自动驾驶还未触发到站
if (isGoingToNextStation && !isArrivedStation) {
judgeStartStation(location);
judgeStartStation(gnssInfo);
}
}
};
//根据围栏判断,是否到达起点
private void judgeStartStation(MogoLocation location) {
private void judgeStartStation(MessagePad.GnssInfo location) {
if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) {
return;

View File

@@ -1,15 +1,22 @@
package com.mogo.och.sweeper.presenter;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
import android.os.Looper;
import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.och.sweeper.bean.SweeperStationBean;
import com.mogo.och.sweeper.callback.ISweeperControllerStatusCallback;
import com.mogo.och.sweeper.callback.ICarOperationStatusCallback;
import com.mogo.och.sweeper.callback.IRefreshSweeperStationsCallback;
import com.mogo.och.sweeper.callback.ISlidePannelHideCallback;
import com.mogo.och.sweeper.callback.ISweeperControllerStatusCallback;
import com.mogo.och.sweeper.fragment.SweeperFragment;
import com.mogo.och.sweeper.model.SweeperOrderModel;
import com.mogo.och.sweeper.util.SweeperTrajectoryManager;
@@ -120,9 +127,9 @@ public class SweeperPresenter extends Presenter<SweeperFragment>
}
@Override
public void onCarLocationChanged(MogoLocation location) {
public void onCarLocationChanged(MessagePad.GnssInfo location) {
if (null != location) {
runOnUIThread(() -> mView.updateSpeedView(location.getSpeed()));
runOnUIThread(() -> mView.updateSpeedView((float) location.getVehicleSpeed()));
}
}

View File

@@ -26,9 +26,9 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoSweeperFutianCleanSystemListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager;
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;
@@ -764,43 +764,7 @@ public class SweeperOperatePanelView extends LinearLayout {
/**
* 底盘数据透传listener
*/
private final IMoGoAutopilotVehicleStateListener mIMoGoAutopilotVehicleStateListener = new IMoGoAutopilotVehicleStateListener() {
@Override
public void onBMSSystemStates(@NonNull ChassisStatesOuterClass.BMSSystemStates bmsSystemStates) {
}
@Override
public void onAutopilotDataException(long timestamp) {
}
@Override
public void onAutopilotLightSwitchData(@Nullable Chassis.LightSwitch lightSwitch) {
}
@Override
public void onAutopilotBrakeLightData(boolean brakeLight) {
}
@Override
public void onAutopilotSteeringData(float steering) {
}
@Override
public void onAutopilotGearData(@NonNull Chassis.GearPosition gear) {
}
@Override
public void onAutopilotAcc(float carAcc) {
}
@Override
public void onAutopilotThrottle(float throttle) {
}
@Override
public void onAutopilotBrake(float brake) {
}
private final IMoGoSweeperFutianCleanSystemListener mIMoGoAutopilotVehicleStateListener = new IMoGoSweeperFutianCleanSystemListener() {
@Override
public void onSweeperFutianCleanSystemState(@NonNull ChassisStatesOuterClass.SweeperFuTianTaskSystemStates cleanSystemState) {
@@ -835,7 +799,7 @@ public class SweeperOperatePanelView extends LinearLayout {
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
CallerAutopilotVehicleStateListenerManager.INSTANCE.addListener(TAG, mIMoGoAutopilotVehicleStateListener);
CallerSweeperFutianCleanSystemListenerManager.INSTANCE.addListener(TAG, mIMoGoAutopilotVehicleStateListener);
// 最终调试时需要打开
syncVehicleStateAndRecoverOperatePanelStates();
// Mock VehicleState 数据回调
@@ -847,7 +811,7 @@ public class SweeperOperatePanelView extends LinearLayout {
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
CallerAutopilotVehicleStateListenerManager.INSTANCE.removeListener(TAG);
CallerSweeperFutianCleanSystemListenerManager.INSTANCE.removeListener(TAG);
}
/**

View File

@@ -53,11 +53,11 @@ dependencies {
implementation rootProject.ext.dependencies.androidxconstraintlayout
implementation rootProject.ext.dependencies.amapnavi3dmap
implementation rootProject.ext.dependencies.amapsearch
implementation project(":OCH:mogo-och-common-module")
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
implementation rootProject.ext.dependencies.mogoutils
implementation rootProject.ext.dependencies.mogocommons
implementation rootProject.ext.dependencies.modulecommon
implementation rootProject.ext.dependencies.mogo_core_data
implementation rootProject.ext.dependencies.mogo_core_function_call
implementation rootProject.ext.dependencies.mogo_core_function_v2x
@@ -65,7 +65,6 @@ dependencies {
}else {
implementation project(":core:mogo-core-utils")
implementation project(":foudations:mogo-commons")
implementation project(':modules:mogo-module-common')
implementation project(':core:mogo-core-data')
implementation project(':core:mogo-core-function-call')
implementation project(':core:function-impl:mogo-core-function-v2x')

View File

@@ -11,14 +11,16 @@ 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.MogoMapUIController;
import com.mogo.och.taxi.passenger.constant.TaxiPassengerConst;
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
@@ -45,7 +47,7 @@ class MogoOCHTaxiPassenger implements IMogoOCH, IMogoStatusChangedListener {
*/
private void stepIntoVrMode() {
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "进入vr模式");
MogoMapUIController.getInstance()
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController())
.stepInVrMode(false);
}

View File

@@ -1,6 +1,6 @@
package com.mogo.och.taxi.passenger.callback;
import com.mogo.eagle.core.data.map.MogoLocation;
import mogo.telematics.pad.MessagePad;
/**
* Created on 2021/9/10
@@ -11,5 +11,5 @@ public interface IOCHTaxiPassengerControllerStatusCallback {
// 是否vr map模式
void onVRModeChanged(boolean isVRMode);
// 自车定位
void onCarLocationChanged(MogoLocation location);
void onCarLocationChanged(MessagePad.GnssInfo location);
}

View File

@@ -23,7 +23,7 @@ class TaxiPassengerConst {
}
// OCH arouter 路由path
const val PATH = "/och/api"
const val PATH = "/passenger/api"
// 上报心跳轮询ms
const val LOOP_PERIOD_60S = 60 * 1000L

View File

@@ -2,6 +2,7 @@ package com.mogo.och.taxi.passenger.model;
import android.content.Context;
import com.amap.api.services.core.AMapException;
import com.amap.api.services.core.LatLonPoint;
import com.amap.api.services.geocoder.GeocodeResult;
import com.amap.api.services.geocoder.GeocodeSearch;
@@ -52,7 +53,11 @@ public class TaxiPassengerGeocodeSearchModel implements GeocodeSearch.OnGeocodeS
public void initGeocodeSearch(){
//通过经纬度逆地理编码得到位置
mGeocodeSearch = new GeocodeSearch(mContext);
try {
mGeocodeSearch = new GeocodeSearch(mContext);
} catch (AMapException e) {
e.printStackTrace();
}
mGeocodeSearch.setOnGeocodeSearchListener(this);
timer = new Timer();
timerTask = new TimerTask() {

View File

@@ -1,5 +1,7 @@
package com.mogo.och.taxi.passenger.model;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
@@ -23,13 +25,14 @@ import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
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.IMoGoAutopilotPlanningListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
import com.mogo.eagle.core.function.api.v2x.LimitingVelocityListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
import com.mogo.eagle.core.function.call.v2x.CallLimitingVelocityListenerManager;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
@@ -38,11 +41,11 @@ import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
import com.mogo.och.common.module.callback.OchAdasStartFailureCallback;
import com.mogo.och.common.module.manager.AbnormalFactorsLoopManager;
import com.mogo.och.common.module.manager.OCHAdasAbilityManager;
import com.mogo.och.common.module.map.AmapNaviToDestinationModel;
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
import com.mogo.och.common.module.utils.PinYinUtil;
import com.mogo.och.taxi.passenger.bean.TaxiPassengerBaseRespBean;
@@ -50,8 +53,8 @@ import com.mogo.och.taxi.passenger.bean.TaxiPassengerOrderQueryRemainingResp;
import com.mogo.och.taxi.passenger.bean.TaxiPassengerOrderQueryRespBean;
import com.mogo.och.taxi.passenger.bean.TaxiPassengerOrdersInServiceQueryRespBean;
import com.mogo.och.taxi.passenger.bean.TaxiPassengerQueryOrderRouteResp;
import com.mogo.och.taxi.passenger.bean.TaxiPassengerStartReqBean;
import com.mogo.och.taxi.passenger.bean.TaxiPassengerScoreUpdateOrderReqBean;
import com.mogo.och.taxi.passenger.bean.TaxiPassengerStartReqBean;
import com.mogo.och.taxi.passenger.callback.IOCHTaxiPassengerADASStatusCallback;
import com.mogo.och.taxi.passenger.callback.IOCHTaxiPassengerAutopilotPlanningCallback;
import com.mogo.och.taxi.passenger.callback.IOCHTaxiPassengerControllerStatusCallback;
@@ -84,8 +87,6 @@ import mogo.telematics.pad.MessagePad;
import mogo_msg.MogoReportMsg;
import system_master.SystemStatusInfo;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P;
/**
* Created by pangfan on 2021/8/19
*
@@ -123,7 +124,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
private int delayTime = 2;
private double mLongitude, mLatitude;
private MogoLocation mLocation = null;
private MessagePad.GnssInfo mLocation = null;
private List<MogoLocation> mLocationsModels = new ArrayList<>();
@@ -236,10 +237,10 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
IntentManager.getInstance().registerIntentListener( ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
// 定位监听
CallerMapLocationListenerManager.INSTANCE.addListener(TAG,mMapLocationListener,false);
CallerChassisLocationGCJ20ListenerManager.INSTANCE.addListener(TAG,mMapLocationListener);
//2021.11.1 自动驾驶路线规划接口
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG,moGoAutopilotPlanningListener);
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG,moGoAutopilotPlanningListener);
//增加限速监听
CallLimitingVelocityListenerManager.INSTANCE.addListener(TAG,limitingVelocityListener);
@@ -260,7 +261,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
.unregisterLifecycleListener(10010);
CallerAutoPilotStatusListenerManager.INSTANCE.removeListener(mGoAutopilotStatusListener);
CallerAutopilotPlanningListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
CallerPlanningRottingListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
CallLimitingVelocityListenerManager.INSTANCE.removeListener(limitingVelocityListener);
AbnormalFactorsLoopManager.INSTANCE.stopLoopAbnormalFactors();
@@ -427,7 +428,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
}
// TODO: 2021/9/12
public void calculateTravelDistance(MogoLocation carLocation){
public void calculateTravelDistance(MessagePad.GnssInfo carLocation){
if (checkCurrentOCHOrder() && mCurrentOCHOrder.endSiteGcjPoint.size()>0) {
double endLon = mCurrentOCHOrder.endSiteGcjPoint.get(0);
double endLat = mCurrentOCHOrder.endSiteGcjPoint.get(1);
@@ -466,25 +467,26 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
};
// 自车定位
private final IMoGoMapLocationListener mMapLocationListener = new IMoGoMapLocationListener() {
private final IMoGoChassisLocationGCJ02Listener mMapLocationListener = new IMoGoChassisLocationGCJ02Listener() {
@Override
public void onLocationChanged(@Nullable MogoLocation location, int from, boolean isGps) {
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
//位置变化时通过围栏判断是否到达x点
if (null == location) return;
if (null == gnssInfo) return;
if (checkCurrentOCHOrder()) {
if (getCurOrderStatus() == TaxiPassengerOrderStatusEnum.OnTheWayToEnd) {
calculateTravelDistance(location);
calculateTravelDistance(gnssInfo);
}
}
mLongitude = location.getLongitude();
mLatitude = location.getLatitude();
mLongitude = gnssInfo.getLongitude();
mLatitude = gnssInfo.getLatitude();
mLocation = location;
// CallerLogger.INSTANCE.e(M_TAXI_P + TAG,"mLongitude = "+mLongitude+", mLatitude = "+mLatitude);
mLocation = gnssInfo;
// CallerLogger.INSTANCE.e(M_TAXI_P + TAG,"mLongitude = "+mLongitude+", mLatitude = "+mLatitude);
for (IOCHTaxiPassengerControllerStatusCallback callback :mControllerStatusCallbackMap.values()){
callback.onCarLocationChanged(location);
callback.onCarLocationChanged(gnssInfo);
}
}
};
private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener(){
@@ -577,12 +579,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
}
};
private final IMoGoAutopilotPlanningListener moGoAutopilotPlanningListener = new IMoGoAutopilotPlanningListener(){
@Override
public void onAutopilotTrajectory(@NonNull List<MessagePad.TrajectoryPoint> trajectoryInfos) {
}
private final IMoGoPlanningRottingListener moGoAutopilotPlanningListener = new IMoGoPlanningRottingListener(){
@Override
public void onAutopilotRotting(@Nullable MessagePad.GlobalPathResp routeList) {

View File

@@ -27,6 +27,8 @@ import com.mogo.och.taxi.passenger.model.TaxiPassengerModel;
import com.mogo.och.taxi.passenger.ui.TaxiPassengerBaseFragment;
import com.mogo.och.taxi.passenger.ui.leftmenu.LeftMenuOpen;
import mogo.telematics.pad.MessagePad;
/**
* @author: wangmingjun
* @date: 2022/3/4
@@ -120,7 +122,7 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
}
@Override
public void onCarLocationChanged(MogoLocation location) {
public void onCarLocationChanged(MessagePad.GnssInfo location) {
// 速度不用展示
// LeftMenuOpen.INSTANCE.callCallBack(-1,-1,location.getSpeed());
}

View File

@@ -1,6 +1,7 @@
package com.mogo.och.taxi.passenger.presenter;
import android.location.Location;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P;
import android.os.Build;
import android.os.Looper;
@@ -10,8 +11,6 @@ import androidx.lifecycle.LifecycleOwner;
import com.amap.api.maps.model.LatLng;
import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.data.map.MogoLatLng;
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;
@@ -27,7 +26,7 @@ import com.mogo.och.taxi.passenger.ui.TaxiPassengerServingOrderFragment;
import java.util.List;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P;
import mogo.telematics.pad.MessagePad;
/**
* @author: wangmingjun
@@ -140,7 +139,7 @@ public class TaxiPassengerServingOrderPresenter extends Presenter<TaxiPassengerS
private static final long TIMEINTERVAL = 4000;
@Override
public void onCarLocationChanged(MogoLocation location) {
public void onCarLocationChanged(MessagePad.GnssInfo location) {
if (location != null){
runOnUIThread(() -> mView.onCarLocationChanged(location));
long currentTimeMillis = System.currentTimeMillis();

View File

@@ -19,19 +19,20 @@ import com.mogo.eagle.core.function.api.hmi.IMoGoHmiViewProxy;
import com.mogo.eagle.core.function.api.hmi.view.IViewNotification;
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.utilcode.util.OverlayViewUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.MogoMapUIController;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.och.taxi.passenger.R;
import com.mogo.och.taxi.passenger.callback.ITPClickStartAutopilotCallback;
import com.mogo.och.taxi.passenger.event.UIStatus;
import com.mogo.och.taxi.passenger.mulprocess.EmptyService;
import com.mogo.och.taxi.passenger.presenter.BaseTaxiPassengerPresenter;
import com.mogo.och.taxi.passenger.ui.comment.TaxiPassengerArrivedView;
import com.mogo.och.taxi.passenger.ui.leftmenu.OverlayLeftViewUtils;
import com.mogo.och.taxi.passenger.mulprocess.EmptyService;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
@@ -109,43 +110,40 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
return new TaxiPassengerV2XNotificationView(getContext());
}
private void updateSwitchMapIcon(){
if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isLongSight()) {
mMapswitchBtn.setImageResource(R.drawable.taxi_p_switch_map_long);
} else if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isMediumSight()) {
mMapswitchBtn.setImageResource(R.drawable.taxi_p_switch_map_medium);
}else {
mMapswitchBtn.setImageResource(R.drawable.taxi_p_switch_map_medium);
private void updateSwitchMapIcon() {
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
if (controller != null) {
if (controller.getCurrentMapVisualAngle().isLongSight()) {
mMapswitchBtn.setImageResource(R.drawable.taxi_p_switch_map_long);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
mMapswitchBtn.setImageResource(R.drawable.taxi_p_switch_map_medium);
} else {
mMapswitchBtn.setImageResource(R.drawable.taxi_p_switch_map_medium);
}
}
}
private void initListener(){
mMapswitchBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//视角切换
if (MogoMapUIController.getInstance()
.getCurrentMapVisualAngle().isLongSight()) {
// 2.11.0 去掉
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).visibleAllMarkers();
MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
private void initListener() {
mMapswitchBtn.setOnClickListener(v -> {
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
if (controller != null) {
//切换地图的远近视图
if (controller.getCurrentMapVisualAngle().isLongSight()) {
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mMapswitchBtn.setImageResource(R.drawable.taxi_p_switch_map_medium);
} else if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isMediumSight()) {
// 2.11.0 去掉
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).inVisibleWithoutMarkers(DataTypes.TYPE_MARKER_ADAS);
MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
mMapswitchBtn.setImageResource(R.drawable.taxi_p_switch_map_long);
} else {
// 2.11.0去掉
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).visibleAllMarkers();
MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mMapswitchBtn.setImageResource(R.drawable.taxi_p_switch_map_medium);
}
//OverlayLeftViewUtils.INSTANCE.dismissOverlayView();
}
//OverlayLeftViewUtils.INSTANCE.dismissOverlayView();
});
}
private void initArrivedView(){
private void initArrivedView() {
mArrivedEndView = new WeakReference<>(new TaxiPassengerArrivedView(getContext()));
mArrivedEndView.get().setITaxiPassengerScoreCallback((taxiPassengerScoreUpdateOrderReqBean) -> getPresenter().arrivedAndScore(taxiPassengerScoreUpdateOrderReqBean));
}
@@ -173,9 +171,10 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
/**
* VR mode 转换
*
* @param isVRMode
*/
public void switchVRFlatMode(boolean isVRMode){
public void switchVRFlatMode(boolean isVRMode) {
if (mRootView != null) {
mRootView.setVisibility(isVRMode ? View.VISIBLE : View.GONE);
}
@@ -187,6 +186,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
* @param status 2 - running 1 - enable 2 - disable
*/
private int mPrevAPStatus = -1;
public void onAutopilotStatusChanged(int status) {
getActivity().runOnUiThread(() -> {
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING != status) {
@@ -199,7 +199,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
onAutopilotStatusSuccessDone();
}
// 3. 其他过程直接更新
if (mPrevAPStatus != status){
if (mPrevAPStatus != status) {
autopilotStatusAnimchanged(status);
}
mPrevAPStatus = status;
@@ -210,7 +210,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
// mAutopilotTv.setText(isInAutopilot?"自动驾驶":"开启自动驾驶");
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status) {
mAutopilotImage.setImageResource(R.drawable.taxi_p_auto_nor);
} else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == status){
} else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == status) {
mAutopilotImage.setImageResource(R.drawable.taxi_p_un_auto_nor);
} else {
mAutopilotImage.setImageResource(R.drawable.taxi_p_un_auto_nor);
@@ -240,20 +240,21 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
removeListener();
}
private void removeListener(){
if (mStartAutopilotView == null || mStartAutopilotView.get() == null){
private void removeListener() {
if (mStartAutopilotView == null || mStartAutopilotView.get() == null) {
return;
}
mStartAutopilotView.get().setOnClickStartAutopilotBtnCallback(null);
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void changeOverview(UIStatus uiStatus){
if(uiStatus.status==UIStatus.LIVE){
public void changeOverview(UIStatus uiStatus) {
if (uiStatus.status == UIStatus.LIVE) {
CallerHmiManager.INSTANCE.hideSmallFragment();
showOrHideServingOrderFragment(true,false);
}else if(uiStatus.status==UIStatus.OVERVIEW){
showOrHideServingOrderFragment(true, false);
} else if (uiStatus.status == UIStatus.OVERVIEW) {
CallerHmiManager.INSTANCE.showSmallFragment();
showOrHideServingOrderFragment(false,false);
showOrHideServingOrderFragment(false, false);
}
}
@@ -264,25 +265,26 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
/**
* 显示或隐藏订单信息
*
* @param isShow
*/
public void showOrHideServingOrderFragment(boolean isShow,boolean showOrHideLefeMenu){
public void showOrHideServingOrderFragment(boolean isShow, boolean showOrHideLefeMenu) {
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
if (isShow){
if (ochServingOrderFragment == null){
if (isShow) {
if (ochServingOrderFragment == null) {
ochServingOrderFragment = new TaxiPassengerServingOrderFragment().newInstance();
}
if(showOrHideLefeMenu) {
if (showOrHideLefeMenu) {
OverlayLeftViewUtils.INSTANCE.showOverlayView(getActivity(), 0, true, -1, true);
}
if (ochServingOrderFragment.isHidden()){
if (ochServingOrderFragment.isHidden()) {
transaction
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.show(ochServingOrderFragment).commitAllowingStateLoss();
return;
}
if (ochServingOrderFragment.isAdded()){
if (ochServingOrderFragment.isAdded()) {
transaction
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.show(ochServingOrderFragment).commitAllowingStateLoss();
@@ -293,13 +295,13 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
.add(R.id.module_mogo_och_navi_panel_container, ochServingOrderFragment)
.show(ochServingOrderFragment).commitAllowingStateLoss();
}else {
if (ochServingOrderFragment != null){
} else {
if (ochServingOrderFragment != null) {
transaction
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_CLOSE)
.hide(ochServingOrderFragment).commitAllowingStateLoss();
}
if(showOrHideLefeMenu) {
if (showOrHideLefeMenu) {
OverlayLeftViewUtils.INSTANCE.dismissOverlayView(true);
CallerHmiManager.INSTANCE.hideSmallFragment();
}
@@ -311,18 +313,19 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
* 乘客验证成功,页面显示,按钮置于不可点击
* 司机端确认可点击开启自动驾驶, 按钮置为可点击
* 订单前往目的地,页面消失
*
* @param isShow
*/
public void showOrHideStartAutopilotView(boolean isShow, boolean isClickable){
if (isShow){
if (mStartAutopilotView == null || mStartAutopilotView.get() == null){
public void showOrHideStartAutopilotView(boolean isShow, boolean isClickable) {
if (isShow) {
if (mStartAutopilotView == null || mStartAutopilotView.get() == null) {
mStartAutopilotView = new WeakReference<>(new TaxiPassengerStartAutopilotView(getContext()));
}
mStartAutopilotView.get().setOnClickStartAutopilotBtnCallback(this);
OverlayViewUtils.showOverlayView(getActivity(),mStartAutopilotView.get());
OverlayViewUtils.showOverlayView(getActivity(), mStartAutopilotView.get());
updateStartAutopilotBtnStatus(isClickable);
}else {
if (mStartAutopilotView == null || mStartAutopilotView.get() == null){
} else {
if (mStartAutopilotView == null || mStartAutopilotView.get() == null) {
return;
}
mStartAutopilotView.get().setOnClickStartAutopilotBtnCallback(null);
@@ -331,15 +334,15 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
}
}
public void updateStartAutopilotBtnStatus(boolean isClickable){
if (mStartAutopilotView == null || mStartAutopilotView.get() == null){
public void updateStartAutopilotBtnStatus(boolean isClickable) {
if (mStartAutopilotView == null || mStartAutopilotView.get() == null) {
return;
}
mStartAutopilotView.get().handleStartAutopilotBtnStatus(isClickable);
}
public void onAutopilotStatusSuccessDone(){
if (mStartAutopilotView == null || mStartAutopilotView.get() == null){
public void onAutopilotStatusSuccessDone() {
if (mStartAutopilotView == null || mStartAutopilotView.get() == null) {
return;
}
mStartAutopilotView.get().onAutopilotStatusSuccess();
@@ -351,36 +354,38 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
* ② 到达上车点 隐藏到达终点的页面(上一个订单没有评价)
* ③ 到达目的地 显示到达终点的页面
* ④ debug 使用
* @param isShow true 展示 false 隐藏
*
* @param isShow true 展示 false 隐藏
* @param arrivedEndStation 目的地
* @param orderNo 订单No
* @param orderNo 订单No
*/
public void showOrHideArrivedEndLayout(boolean isShow, String arrivedEndStation,String orderNo){
if (isShow){
if(mArrivedEndView==null||mArrivedEndView.get()==null){
public void showOrHideArrivedEndLayout(boolean isShow, String arrivedEndStation, String orderNo) {
if (isShow) {
if (mArrivedEndView == null || mArrivedEndView.get() == null) {
initArrivedView();
}
OverlayViewUtils.showOverlayView(getActivity(),mArrivedEndView.get(),R.style.och_window_anim_alpha);
OverlayViewUtils.showOverlayView(getActivity(), mArrivedEndView.get(), R.style.och_window_anim_alpha);
UiThreadHandler.postDelayed(new Runnable() {
@Override
public void run() {
mArrivedEndView.get().setDataAndStartAnimation(arrivedEndStation,orderNo);
mArrivedEndView.get().setDataAndStartAnimation(arrivedEndStation, orderNo);
}
//如果在全屏 回收需要300毫秒 后期优化使用单独的播放器
},500);
}else {
if(mArrivedEndView==null||mArrivedEndView.get()==null){
}, 500);
} else {
if (mArrivedEndView == null || mArrivedEndView.get() == null) {
return;
}
OverlayViewUtils.dismissOverlayView(mArrivedEndView.get());
}
}
// 20 司机到达上车点
public void preOrderThankPageTenlogic(String startSiteAddr,
String endSiteAddr,
String passengerNum,
String carNumber,
String phone){
String phone) {
showOrHideArrivedEndLayout(false, "", "");
showOrHidePressengerCheckPager(true, startSiteAddr,
endSiteAddr, passengerNum, carNumber, phone);
@@ -399,33 +404,34 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
String phone) {
try {
if (isShow) {
if(mArrivedCheckView==null||mArrivedCheckView.get()==null){
if (mArrivedCheckView == null || mArrivedCheckView.get() == null) {
initCheckView();
}
mArrivedCheckView.get().setData(startSiteAddr, endSiteAddr, passengerNum, carNumber,phone);
mArrivedCheckView.get().setData(startSiteAddr, endSiteAddr, passengerNum, carNumber, phone);
OverlayViewUtils.showOverlayView(getActivity(), mArrivedCheckView.get());
} else {
if(mArrivedCheckView==null||mArrivedCheckView.get()==null){
if (mArrivedCheckView == null || mArrivedCheckView.get() == null) {
return;
}
OverlayViewUtils.dismissOverlayView(mArrivedCheckView.get());
}
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 用户评分后接口回调
* 用户评分后接口回调
*
* @param isSuccess true 打分成功 false 打分失败
*/
public void showArrivedEndLayout2Thank(boolean isSuccess) {
if(mArrivedEndView==null||mArrivedEndView.get()==null){
if (mArrivedEndView == null || mArrivedEndView.get() == null) {
initArrivedView();
}
if(isSuccess){
if (isSuccess) {
mArrivedEndView.get().scoreSuccess();
}else {
} else {
mArrivedEndView.get().scoreFail();
}
}

View File

@@ -29,9 +29,8 @@ 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.map.listener.IMoGoMapLocationListener;
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.och.taxi.passenger.R;
import com.mogo.och.taxi.passenger.callback.ITaxiPassengerMapViewCallback;
@@ -40,12 +39,14 @@ import com.mogo.och.taxi.passenger.utils.TaxiPassengerMapAssetStyleUtil;
import java.util.ArrayList;
import java.util.List;
import mogo.telematics.pad.MessagePad;
/**
* 乘客屏小地图
*/
public class TaxiPassengerMapDirectionView
extends RelativeLayout
implements IMoGoMapLocationListener, ITaxiPassengerMapDirectionView, AMap.OnCameraChangeListener {
implements IMoGoChassisLocationGCJ02Listener, ITaxiPassengerMapDirectionView, AMap.OnCameraChangeListener {
//小地图名称
public static final String TAG = "TPMapDirectionView";
@@ -104,14 +105,14 @@ public class TaxiPassengerMapDirectionView
initAMapView();
// 注册定位监听
CallerMapLocationListenerManager.INSTANCE.addListener(TAG, this, false);
CallerChassisLocationGCJ20ListenerManager.INSTANCE.addListener(TAG, this);
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
// 注册定位监听
CallerMapLocationListenerManager.INSTANCE.removeListener(TAG, false);
CallerChassisLocationGCJ20ListenerManager.INSTANCE.removeListener(TAG);
}
private void initAMapView() {
@@ -178,13 +179,12 @@ public class TaxiPassengerMapDirectionView
return true;
}
@Override
public void onLocationChanged(@org.jetbrains.annotations.Nullable MogoLocation location, int from, boolean isGps) {
if (location == null){
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
if (gnssInfo == null){
return;
}
LatLng currentLatLng = new LatLng(location.getLatitude(), location.getLongitude());
LatLng currentLatLng = new LatLng(gnssInfo.getLatitude(), gnssInfo.getLongitude());
if (mCoordinatesLatLng.size() > 1) {
//圈定地图显示范围
@@ -200,13 +200,13 @@ public class TaxiPassengerMapDirectionView
} else {
//设置希望展示的地图缩放级别
CameraPosition cameraPosition = new CameraPosition.Builder()
.target(mCarMarker.getPosition()).tilt(0).bearing(location.getBearing()).zoom(zoomLevel).build();
.target(mCarMarker.getPosition()).tilt(0).bearing((float) gnssInfo.getHeading()).zoom(zoomLevel).build();
mAMap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
}
//更新车辆位置
if (mCarMarker != null) {
// CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "location.getBearing() = " + location.getBearing());
mCarMarker.setRotateAngle(360 - location.getBearing());
mCarMarker.setRotateAngle((float) (360 - gnssInfo.getHeading()));
mCarMarker.setPosition(currentLatLng);
// CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "onCarLocationChanged2--loacation :" + location.getLatitude()+", "+location.getLongitude());
mCarMarker.setToTop();

View File

@@ -4,7 +4,6 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAX
import android.animation.Animator;
import android.animation.AnimatorInflater;
import android.location.Location;
import android.os.Build;
import android.os.Bundle;
import android.os.Looper;
@@ -22,7 +21,6 @@ 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;
@@ -44,6 +42,8 @@ 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 +352,8 @@ public class TaxiPassengerServingOrderFragment extends
}
public void onCarLocationChanged(MogoLocation location) {
updateSpeedView(location.getSpeed());
public void onCarLocationChanged(MessagePad.GnssInfo location) {
updateSpeedView((float) location.getVehicleSpeed());
}
public void onLimitingVelocityChange(int limitingVelocity) {

View File

@@ -274,9 +274,10 @@ object OverlayLeftViewUtils {
*
*/
fun transmissionIndex(index:Int){
if(!ProcessUtils.isMainProcess(Utils.getApp())) {
// TODO 需要与,杨亚坤,确认为啥要限制仅在主进程
// if(!ProcessUtils.isMainProcess(Utils.getApp())) {
LeftMenuOpen.transmissionIndex(index)
}
// }
}
fun transmissionIndexGet(index: Int){

View File

@@ -136,7 +136,7 @@
android:layout_marginEnd="155dp"
android:layout_marginBottom="231dp"
android:orientation="vertical"
app:bgColor="@color/transparent_white_30"
app:bgColor="@color/color_B3FFFFFF"
app:blurRadius="@dimen/dp_60"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View File

@@ -57,7 +57,6 @@ dependencies {
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
implementation rootProject.ext.dependencies.mogoutils
implementation rootProject.ext.dependencies.mogocommons
implementation rootProject.ext.dependencies.modulecommon
implementation rootProject.ext.dependencies.mogo_core_data
implementation rootProject.ext.dependencies.mogo_core_function_call
implementation rootProject.ext.dependencies.mogo_core_function_v2x
@@ -65,7 +64,6 @@ dependencies {
}else {
implementation project(":core:mogo-core-utils")
implementation project(":foudations:mogo-commons")
implementation project(':modules:mogo-module-common')
implementation project(':core:mogo-core-data')
implementation project(':core:mogo-core-function-call')
implementation project(':core:function-impl:mogo-core-function-v2x')

View File

@@ -4,9 +4,9 @@ import android.content.Context;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.v2x.events.utils.LocationUtils;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.commons.utils.LocationUtils;
import com.mogo.eagle.core.utilcode.util.ColorUtils;
import com.mogo.map.MogoOverlayManager;
import com.mogo.map.overlay.IMogoOverlayManager;
import com.mogo.map.overlay.IMogoPolyline;
import com.mogo.map.overlay.MogoPolylineOptions;
@@ -32,7 +32,7 @@ public class TaxiOverlayManager {
// 引导线颜色
mPolylineColors = new ArrayList<>();
mContext = context;
mogoOverlayManager = MogoOverlayManager.getInstance();
mogoOverlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager(context);
}
/**

View File

@@ -11,15 +11,16 @@ 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.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.MogoMapUIController;
import com.mogo.och.taxi.constant.TaxiConst;
import com.mogo.och.taxi.ui.TaxiFragment;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Objects;
public
/**
* @author congtaowang
@@ -45,8 +46,7 @@ class TaxiProvider implements IMogoOCH , IMogoStatusChangedListener {
*/
private void stepIntoVrMode() {
CallerLogger.INSTANCE.d( M_TAXI + TAG, "进入vr模式" );
MogoMapUIController.getInstance()
.stepInVrMode( false );
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).stepInVrMode(false);
}
private void showFragment() {

View File

@@ -1,6 +1,6 @@
package com.mogo.och.taxi.callback;
import com.mogo.eagle.core.data.map.MogoLocation;
import mogo.telematics.pad.MessagePad;
/**
* Created on 2021/9/10
@@ -11,7 +11,7 @@ public interface ITaxiControllerStatusCallback {
// 是否vr map模式
void onVRModeChanged(boolean isVRMode);
// 自车定位
void onCarLocationChanged(MogoLocation location);
void onCarLocationChanged(MessagePad.GnssInfo location);
//开始开启自动驾驶
void startOpenAutopilot();
}

View File

@@ -23,7 +23,7 @@ class TaxiConst {
}
// OCH arouter 路由path
const val PATH = "/och/api"
const val PATH = "/driver/api"
// 到达起始点围栏
const val ARRIVE_AT_START_STATION_DISTANCE = 15 //围栏由20m改为50m 再次改为15m

View File

@@ -27,12 +27,13 @@ import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
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.IMoGoAutopilotPlanningListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
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.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
@@ -75,8 +76,8 @@ import com.mogo.och.taxi.constant.TaxiOrderStatusEnum;
import com.mogo.och.taxi.constant.TaxiOrderTypeEnum;
import com.mogo.och.taxi.constant.TaxtServingStatusManager;
import com.mogo.och.taxi.network.TaxiServiceManager;
import com.mogo.och.taxi.utils.TaxiAnalyticsManager;
import com.mogo.och.taxi.utils.OrderUtil;
import com.mogo.och.taxi.utils.TaxiAnalyticsManager;
import com.mogo.och.taxi.utils.TaxiTrajectoryManager;
import com.zhjt.service.chain.ChainLog;
import com.zhjt.service.chain.TracingConstants;
@@ -133,7 +134,7 @@ public class TaxiModel {
private int mPreRouteIndex = 0;
private double mLongitude, mLatitude;
private MogoLocation mLocation = null;
private MessagePad.GnssInfo mLocation = null;
private LoginService loginService;
@@ -223,10 +224,10 @@ public class TaxiModel {
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
//定位监听, 传false是高德坐标系
CallerMapLocationListenerManager.INSTANCE.addListener(TAG,mMapLocationLIstener,false);
CallerChassisLocationGCJ20ListenerManager.INSTANCE.addListener(TAG,mMapLocationLIstener);
//2021.11.1 自动驾驶路线规划接口
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
//开启自驾后 异常信息返回
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(mAdasStartFailureListener);
@@ -267,7 +268,7 @@ public class TaxiModel {
OCHSocketMessageManager.INSTANCE.releaseSocketMessageListener(OCHSocketMessageManager.msgMonitorType);
CallerAutoPilotStatusListenerManager.INSTANCE.removeListener(mGoAutopilotStatusListener);
CallerAutopilotPlanningListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
CallerPlanningRottingListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(null);
AbnormalFactorsLoopManager.INSTANCE.stopLoopAbnormalFactors();
@@ -995,7 +996,7 @@ public class TaxiModel {
}
//根据围栏判断,是否到达起点
private void judgeStartStation(MogoLocation location) {
private void judgeStartStation(MessagePad.GnssInfo location) {
if (mCurrentOCHOrder == null || mCurrentOCHOrder.startSiteGcjPoint == null
|| mCurrentOCHOrder.startSiteGcjPoint.size() < 2) {
return;
@@ -1052,31 +1053,31 @@ public class TaxiModel {
};
// 自车定位
private final IMoGoMapLocationListener mMapLocationLIstener = new IMoGoMapLocationListener() {
private final IMoGoChassisLocationGCJ02Listener mMapLocationLIstener = new IMoGoChassisLocationGCJ02Listener() {
@Override
public void onLocationChanged(@Nullable MogoLocation location, int from, boolean isGps) {
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
//位置变化时通过围栏判断是否到达x点
if (null == location) return;
if (null == gnssInfo) return;
if (checkCurrentOCHOrder()) {
if (getCurOrderStatus() == TaxiOrderStatusEnum.OnTheWayToStart) {
judgeStartStation(location);
judgeStartStation(gnssInfo);
}
if (getCurOrderStatus() == TaxiOrderStatusEnum.OnTheWayToEnd &&
mPrevAPStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
judgeEndStation(location);
judgeEndStation(gnssInfo);
}
}
mLongitude = location.getLongitude();
mLatitude = location.getLatitude();
mLocation = location;
mLongitude = gnssInfo.getLongitude();
mLatitude = gnssInfo.getLatitude();
mLocation = gnssInfo;
if (mControllerStatusCallback != null) {
mControllerStatusCallback.onCarLocationChanged(location);
mControllerStatusCallback.onCarLocationChanged(gnssInfo);
}
}
};
private void judgeEndStation(MogoLocation location) {
private void judgeEndStation(MessagePad.GnssInfo location) {
if (mCurrentOCHOrder == null || mCurrentOCHOrder.endSiteGcjPoint == null
|| mCurrentOCHOrder.endSiteGcjPoint.size() < 2) {
return;
@@ -1252,12 +1253,8 @@ public class TaxiModel {
public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) {
}
};
private final IMoGoAutopilotPlanningListener moGoAutopilotPlanningListener = new IMoGoAutopilotPlanningListener() {
@Override
public void onAutopilotTrajectory(@NonNull List<MessagePad.TrajectoryPoint> trajectoryInfos) {
}
private final IMoGoPlanningRottingListener moGoAutopilotPlanningListener = new IMoGoPlanningRottingListener() {
@Override
public void onAutopilotRotting(MessagePad.GlobalPathResp routeList) {

View File

@@ -2,7 +2,6 @@ package com.mogo.och.taxi.presenter;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI;
import android.location.Location;
import android.os.Build;
import android.os.Looper;
@@ -12,7 +11,6 @@ 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;
@@ -20,14 +18,14 @@ import com.mogo.och.common.module.biz.bean.DriverStatusQueryRespBean;
import com.mogo.och.common.module.biz.callback.ILoginCallback;
import com.mogo.och.common.module.biz.constant.LoginStatusManager;
import com.mogo.och.common.module.manager.OCHAdasAbilityManager;
import com.mogo.och.taxi.constant.TaxiConst;
import com.mogo.och.taxi.constant.TaxiDriverRoleEnum;
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum;
import com.mogo.och.taxi.bean.OrderQueryRespBean;
import com.mogo.och.taxi.bean.OrderQueryRouteInfoRespBean;
import com.mogo.och.taxi.callback.ITaxiADASStatusCallback;
import com.mogo.och.taxi.callback.ITaxiControllerStatusCallback;
import com.mogo.och.taxi.callback.ITaxiOrderStatusCallback;
import com.mogo.och.taxi.constant.TaxiConst;
import com.mogo.och.taxi.constant.TaxiDriverRoleEnum;
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum;
import com.mogo.och.taxi.constant.TaxtServingStatusManager;
import com.mogo.och.taxi.model.TaxiModel;
import com.mogo.och.taxi.ui.TaxiFragment;
@@ -36,6 +34,8 @@ import org.jetbrains.annotations.NotNull;
import java.util.List;
import mogo.telematics.pad.MessagePad;
/**
* @author congtaowang
* @since 2021/1/18
@@ -314,10 +314,10 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
}
@Override
public void onCarLocationChanged(MogoLocation location) {
public void onCarLocationChanged(MessagePad.GnssInfo location) {
if (null != location){
runOnUIThread(() -> {
mView.updateSpeedView(location.getSpeed());
mView.updateSpeedView((float) location.getVehicleSpeed());
mView.updateLocation(location.getLatitude(),location.getLongitude());
});
}

View File

@@ -31,14 +31,15 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
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.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.MogoMapUIController;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
import com.mogo.och.common.module.utils.AnimatorDrawableUtil;
import com.mogo.och.taxi.R;
@@ -85,22 +86,22 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
R.drawable.anim_flow_00003, R.drawable.anim_flow_00004, R.drawable.anim_flow_00005,
R.drawable.anim_flow_00006, R.drawable.anim_flow_00007, R.drawable.anim_flow_00008,
R.drawable.anim_flow_00009, R.drawable.anim_flow_00010, R.drawable.anim_flow_00011,
R.drawable.anim_flow_00012, R.drawable.anim_flow_00013,R.drawable.anim_flow_00014,
R.drawable.anim_flow_00012, R.drawable.anim_flow_00013, R.drawable.anim_flow_00014,
R.drawable.anim_flow_00015, R.drawable.anim_flow_00016, R.drawable.anim_flow_00017,
R.drawable.anim_flow_00018,R.drawable.anim_flow_00019, R.drawable.anim_flow_00020,
R.drawable.anim_flow_00021,R.drawable.anim_flow_00022,R.drawable.anim_flow_00023,
R.drawable.anim_flow_00024, R.drawable.anim_flow_00025,R.drawable.anim_flow_00026,
R.drawable.anim_flow_00018, R.drawable.anim_flow_00019, R.drawable.anim_flow_00020,
R.drawable.anim_flow_00021, R.drawable.anim_flow_00022, R.drawable.anim_flow_00023,
R.drawable.anim_flow_00024, R.drawable.anim_flow_00025, R.drawable.anim_flow_00026,
R.drawable.anim_flow_00027, R.drawable.anim_flow_00028, R.drawable.anim_flow_00029,
R.drawable.anim_flow_00030,R.drawable.anim_flow_00031, R.drawable.anim_flow_00032,
R.drawable.anim_flow_00033,R.drawable.anim_flow_00034,R.drawable.anim_flow_00035,
R.drawable.anim_flow_00036, R.drawable.anim_flow_00037,R.drawable.anim_flow_00038,
R.drawable.anim_flow_00030, R.drawable.anim_flow_00031, R.drawable.anim_flow_00032,
R.drawable.anim_flow_00033, R.drawable.anim_flow_00034, R.drawable.anim_flow_00035,
R.drawable.anim_flow_00036, R.drawable.anim_flow_00037, R.drawable.anim_flow_00038,
R.drawable.anim_flow_00039, R.drawable.anim_flow_00040, R.drawable.anim_flow_00041,
R.drawable.anim_flow_00042,R.drawable.anim_flow_00043, R.drawable.anim_flow_00044,
R.drawable.anim_flow_00045,R.drawable.anim_flow_00046,R.drawable.anim_flow_00047,
R.drawable.anim_flow_00048, R.drawable.anim_flow_00049,R.drawable.anim_flow_00050,
R.drawable.anim_flow_00042, R.drawable.anim_flow_00043, R.drawable.anim_flow_00044,
R.drawable.anim_flow_00045, R.drawable.anim_flow_00046, R.drawable.anim_flow_00047,
R.drawable.anim_flow_00048, R.drawable.anim_flow_00049, R.drawable.anim_flow_00050,
R.drawable.anim_flow_00051, R.drawable.anim_flow_00052, R.drawable.anim_flow_00053,
R.drawable.anim_flow_00054,R.drawable.anim_flow_00055, R.drawable.anim_flow_00056,
R.drawable.anim_flow_00057,R.drawable.anim_flow_00058,R.drawable.anim_flow_00059
R.drawable.anim_flow_00054, R.drawable.anim_flow_00055, R.drawable.anim_flow_00056,
R.drawable.anim_flow_00057, R.drawable.anim_flow_00058, R.drawable.anim_flow_00059
};
private Integer[] startManCODrawableIds = new Integer[]{
@@ -111,29 +112,29 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
R.drawable.anim_flow_man_co_00008, R.drawable.anim_flow_man_co_00009,
R.drawable.anim_flow_man_co_00010, R.drawable.anim_flow_man_co_00011,
R.drawable.anim_flow_man_co_00012, R.drawable.anim_flow_man_co_00013,
R.drawable.anim_flow_man_co_00014,R.drawable.anim_flow_man_co_00015,
R.drawable.anim_flow_man_co_00014, R.drawable.anim_flow_man_co_00015,
R.drawable.anim_flow_man_co_00016, R.drawable.anim_flow_man_co_00017,
R.drawable.anim_flow_man_co_00018,R.drawable.anim_flow_man_co_00019,
R.drawable.anim_flow_man_co_00018, R.drawable.anim_flow_man_co_00019,
R.drawable.anim_flow_man_co_00020, R.drawable.anim_flow_man_co_00021,
R.drawable.anim_flow_man_co_00022,R.drawable.anim_flow_man_co_00023,
R.drawable.anim_flow_man_co_00022, R.drawable.anim_flow_man_co_00023,
R.drawable.anim_flow_man_co_00024, R.drawable.anim_flow_man_co_00025,
R.drawable.anim_flow_man_co_00026,R.drawable.anim_flow_man_co_00027,
R.drawable.anim_flow_man_co_00026, R.drawable.anim_flow_man_co_00027,
R.drawable.anim_flow_man_co_00028, R.drawable.anim_flow_man_co_00029,
R.drawable.anim_flow_man_co_00030,R.drawable.anim_flow_man_co_00031,
R.drawable.anim_flow_man_co_00030, R.drawable.anim_flow_man_co_00031,
R.drawable.anim_flow_man_co_00032, R.drawable.anim_flow_man_co_00033,
R.drawable.anim_flow_man_co_00034,R.drawable.anim_flow_man_co_00035,
R.drawable.anim_flow_man_co_00034, R.drawable.anim_flow_man_co_00035,
R.drawable.anim_flow_man_co_00036, R.drawable.anim_flow_man_co_00037,
R.drawable.anim_flow_man_co_00038,R.drawable.anim_flow_man_co_00039,
R.drawable.anim_flow_man_co_00038, R.drawable.anim_flow_man_co_00039,
R.drawable.anim_flow_man_co_00040, R.drawable.anim_flow_man_co_00041,
R.drawable.anim_flow_man_co_00042,R.drawable.anim_flow_man_co_00043,
R.drawable.anim_flow_man_co_00042, R.drawable.anim_flow_man_co_00043,
R.drawable.anim_flow_man_co_00044, R.drawable.anim_flow_man_co_00045,
R.drawable.anim_flow_man_co_00046,R.drawable.anim_flow_man_co_00047,
R.drawable.anim_flow_man_co_00046, R.drawable.anim_flow_man_co_00047,
R.drawable.anim_flow_man_co_00048, R.drawable.anim_flow_man_co_00049,
R.drawable.anim_flow_man_co_00050,R.drawable.anim_flow_man_co_00051,
R.drawable.anim_flow_man_co_00050, R.drawable.anim_flow_man_co_00051,
R.drawable.anim_flow_man_co_00052, R.drawable.anim_flow_man_co_00053,
R.drawable.anim_flow_man_co_00054,R.drawable.anim_flow_man_co_00055,
R.drawable.anim_flow_man_co_00054, R.drawable.anim_flow_man_co_00055,
R.drawable.anim_flow_man_co_00056, R.drawable.anim_flow_man_co_00057,
R.drawable.anim_flow_man_co_00058,R.drawable.anim_flow_man_co_00059
R.drawable.anim_flow_man_co_00058, R.drawable.anim_flow_man_co_00059
};
@Override
@@ -168,34 +169,27 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
mMapswitchBtn = findViewById(R.id.module_och_taxi_swich_map_layout);
mSwitchBtnIcon = findViewById(R.id.taxi_switch_icon);
updateSwitchMapIcon();
mMapswitchBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//视角切换
long start = SystemClock.elapsedRealtime();
try {
if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isLongSight()) {
// 2.11.0去掉
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp()) .visibleAllMarkers();
MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mMapswitchBtn.setOnClickListener(v -> {
//视角切换
long start = SystemClock.elapsedRealtime();
try {
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
if (controller != null) {
//切换地图的远近视图
if (controller.getCurrentMapVisualAngle().isLongSight()) {
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);
} else if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isMediumSight()) {
// 2.11.0去掉
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
// .inVisibleWithoutMarkers(DataTypes.TYPE_MARKER_ADAS, TaxiConst.TYPE_MARKER_TAXI_ORDER);
MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_long);
} else {
// 2.11.0去掉
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp()) .visibleAllMarkers();
MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);
}
} finally {
CallerLogger.INSTANCE.d(M_TAXI + TAG, "cost:" + (SystemClock.elapsedRealtime() - start));
}
} finally {
CallerLogger.INSTANCE.d(M_TAXI + TAG, "cost:" + (SystemClock.elapsedRealtime() - start));
}
});
mSettingBtn = findViewById(R.id.module_och_taxi_setting_layout);
@@ -214,7 +208,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
}
mAICollectBtn = findViewById(R.id.module_och_taxi_ai_collect_ll);
if (mAICollectBtn != null){
if (mAICollectBtn != null) {
CallerDevaToolsManager.INSTANCE.initAiCollect(mAICollectBtn);
}
@@ -224,11 +218,11 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
public void onClickImpl(View v) {
// 如果能自动驾驶,就自动驾驶,不能就提示
if (CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState() ==
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING){
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING) {
return; //远程代驾状态下不可开启自动驾驶,只能等远程代驾主动退出
}else if (!(boolean)ctvAutopilotStatusRL.getTag()){
} else if (!(boolean) ctvAutopilotStatusRL.getTag()) {
ToastUtils.showShort(getResources().getString(R.string.module_och_taxi_auto_disable_tip1));
}else {
} else {
startAutopilot();
}
}
@@ -236,14 +230,14 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
// debug下调用测试面板 长按速度值 任意模式下调试都打开
// if (DebugConfig.isDebug()) {
mSpeedView.setOnLongClickListener(v -> {
if (groupTestPanel.getVisibility() == View.VISIBLE) {
groupTestPanel.setVisibility(View.GONE);
} else {
groupTestPanel.setVisibility(View.VISIBLE);
}
return false;
});
mSpeedView.setOnLongClickListener(v -> {
if (groupTestPanel.getVisibility() == View.VISIBLE) {
groupTestPanel.setVisibility(View.GONE);
} else {
groupTestPanel.setVisibility(View.VISIBLE);
}
return false;
});
// }
onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState());
@@ -282,13 +276,16 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
}
private void updateSwitchMapIcon(){
if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isLongSight()) {
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_long);
} else if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isMediumSight()) {
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);
}else {
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);
private void updateSwitchMapIcon() {
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
if (controller != null) {
if (controller.getCurrentMapVisualAngle().isLongSight()) {
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_long);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);
} else {
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);
}
}
}
@@ -337,25 +334,25 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
});
}
public void stopAnimAndUpdateBtnStatus(){
public void stopAnimAndUpdateBtnStatus() {
startOrStopLoadingAnim(false);
startAutopilotDone(false);
}
public void onManMachineCoDriving(int manMachineCoDriving){
if (mPrevAPStatus != manMachineCoDriving){
public void onManMachineCoDriving(int manMachineCoDriving) {
if (mPrevAPStatus != manMachineCoDriving) {
autopilotStatusAnimchanged(manMachineCoDriving);
}
mPrevAPStatus = manMachineCoDriving;
}
public void updateCtvAutopilotStatusTag(boolean tag){
public void updateCtvAutopilotStatusTag(boolean tag) {
ctvAutopilotStatusRL.setTag(tag);
}
public void onCheckPilotConditionSafe(boolean isSafe){
public void onCheckPilotConditionSafe(boolean isSafe) {
updateCtvAutopilotStatusTag(isSafe);
if (isSafe){
if (isSafe) {
updateOrderBottomBtnUI();
}
}
@@ -370,38 +367,38 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
mAutopilotTv.setTextColor(getResources().getColor(R.color.taxi_autopilot_text_color_normal));
mAutopilotImage.setImageResource(R.drawable.taxi_ic_autopilot);
if (animatorDrawableUtil == null){
if (animatorDrawableUtil == null) {
animatorDrawableUtil = new AnimatorDrawableUtil();
}
animatorDrawableUtil.setAnimation(mAnimFlowIv, Arrays.asList(startAutopilotDrawableIds));
animatorDrawableUtil.start(true,100,null);
animatorDrawableUtil.start(true, 100, null);
} else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == status) {
mAutopilotTv.setText("自动驾驶");
mAutopilotTv.setTextColor(getResources().getColor(R.color.taxi_autopilot_text_color_normal));
mAutopilotImage.setImageResource(R.drawable.taxi_ic_autopilot);
if (animatorDrawableUtil != null){
if (animatorDrawableUtil != null) {
animatorDrawableUtil.stop();
mAnimFlowIv.setImageResource(0);
}
// ctvAutopilotStatusRL.setBackground(getResources().getDrawable(R.drawable.taxi_autopilot_bg_selector));
animatorDrawableUtil = null;
} else if (IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING == status){
} else if (IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING == status) {
mAutopilotTv.setText("远程代驾");
mAutopilotTv.setTextColor(getResources().getColor(R.color.taxi_autopilot_text_color_normal));
mAutopilotImage.setImageResource(R.drawable.taxi_ic_autopilot);
if (animatorDrawableUtil == null){
if (animatorDrawableUtil == null) {
animatorDrawableUtil = new AnimatorDrawableUtil();
}
animatorDrawableUtil.setAnimation(mAnimFlowIv, Arrays.asList(startManCODrawableIds));
animatorDrawableUtil.start(true,100,null);
animatorDrawableUtil.start(true, 100, null);
}else {
} else {
mAutopilotTv.setText("自动驾驶");
mAutopilotTv.setTextColor(getResources().getColor(R.color.taxi_autopilot_text_color_disable));
mAutopilotImage.setImageResource(R.drawable.taxi_ic_autopilot_disable);
if (animatorDrawableUtil != null){
if (animatorDrawableUtil != null) {
animatorDrawableUtil.stop();
mAnimFlowIv.setImageResource(0);
}
@@ -471,18 +468,18 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
UiThreadHandler.postDelayed(new Runnable() {
@Override
public void run() { //未启动成功10s后做处理
if (isStarting){ //判断动画是否在进行
if (isStarting) { //判断动画是否在进行
//并且根据状态来设置自动驾驶启动成功还是失败
if (CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()
== IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
== IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
startAutopilotDone(true);
}else {
} else {
startAutopilotDone(false);
}
}
}
},TIMER_START_AUTOPILOT_INTERVAL);
}, TIMER_START_AUTOPILOT_INTERVAL);
}
public void hidPanel() {
@@ -557,7 +554,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
}
}
private void closeAmapViewIFHadeAdd(){
private void closeAmapViewIFHadeAdd() {
if (ochAmapNaviFragment != null) {
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
ochAmapNaviFragment.onDestroy();
@@ -567,7 +564,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
}
}
private void closeRouteViewIFHadeAdd(){
private void closeRouteViewIFHadeAdd() {
if (taxiRottingNaviFragment != null) {
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
taxiRottingNaviFragment.onDestroy();
@@ -602,6 +599,5 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
}
public abstract void startNaviToEndStation(boolean isShow);
}

View File

@@ -22,12 +22,12 @@ 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;
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.MogoMarkerManager;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.och.common.module.map.AmapNaviToDestinationModel;
@@ -47,6 +47,7 @@ import com.mogo.och.taxi.model.TaxiModel;
import java.util.Calendar;
import java.util.List;
import java.util.Objects;
/**
* @author congtaowang
@@ -750,39 +751,33 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
private void setOrRemoveMapMaker(boolean isAdd, String uuid, List<Double> station,int resourceId){
if (isAdd){
//开启线程执行起终点marker设置
Runnable setMapMarkerRunnable = new Runnable() {
@Override
public void run() {
CallerLogger.INSTANCE.d(M_TAXI + "setMapMaker= " + Thread.currentThread().getName(),
uuid + "=latitude=" + station.get(1) + ",longitude=" + station.get(0));
Runnable setMapMarkerRunnable = () -> {
CallerLogger.INSTANCE.d(M_TAXI + "setMapMaker= " + Thread.currentThread().getName(),
uuid + "=latitude=" + station.get(1) + ",longitude=" + station.get(0));
MogoMarkerOptions options = new MogoMarkerOptions()
.owner(TaxiConst.TYPE_MARKER_TAXI_ORDER)
.anchor(0.5f, 0.5f)
.set3DMode(true)
.gps(true)
.controlAngle(true)
.icon3DRes(resourceId)
.latitude(station.get(1))
.longitude(station.get(0));
IMogoMarker marker = MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).addMarker(uuid, options);
CenterLine centerLine = CallerHDMapManager.INSTANCE.getCenterLineInfo(station.get(0)
, station.get(1), -1);
if (null != centerLine && marker != null) {// 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致
marker.setRotateAngle(centerLine.getAngle().floatValue());
}
MogoMarkerOptions options = new MogoMarkerOptions()
.owner(TaxiConst.TYPE_MARKER_TAXI_ORDER)
.anchor(0.5f, 0.5f)
.set3DMode(true)
.gps(true)
.controlAngle(true)
.icon3DRes(resourceId)
.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)
, station.get(1), -1);
if (null != centerLine && marker != null) {// 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致
marker.setRotateAngle(centerLine.getAngle().floatValue());
}
};
OCHThreadPoolManager.getsInstance().execute(setMapMarkerRunnable);
}else {
//开启线程移除起终点marker设置
Runnable removeMapMarkerRunnable = new Runnable() {
@Override
public void run() {
CallerLogger.INSTANCE.d(M_TAXI + "RemoveMapMaker=" + Thread.currentThread().getName(),
uuid + "=latitude=" + station.get(1) + ",longitude=" + station.get(0));
MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).removeMarkers(uuid);
}
Runnable removeMapMarkerRunnable = () -> {
CallerLogger.INSTANCE.d(M_TAXI + "RemoveMapMaker=" + Thread.currentThread().getName(),
uuid + "=latitude=" + station.get(1) + ",longitude=" + station.get(0));
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerManager(AbsMogoApplication.getApp())).removeMarkers(uuid);
};
OCHThreadPoolManager.getsInstance().execute(removeMapMarkerRunnable);
}

View File

@@ -29,9 +29,8 @@ 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.map.listener.IMoGoMapLocationListener;
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.och.taxi.R;
import com.mogo.och.taxi.utils.TaxiMapAssetStyleUtil;
@@ -39,12 +38,14 @@ import com.mogo.och.taxi.utils.TaxiMapAssetStyleUtil;
import java.util.ArrayList;
import java.util.List;
import mogo.telematics.pad.MessagePad;
/**
* taxi司机端前往目的地小地图导航
*/
public class TaxiMapDirectionView
extends RelativeLayout
implements IMoGoMapLocationListener, ITaxiMapDirectionView, AMap.OnCameraChangeListener {
implements IMoGoChassisLocationGCJ02Listener, ITaxiMapDirectionView, AMap.OnCameraChangeListener {
//小地图名称
public static final String TAG = "TPMapDirectionView";
@@ -98,14 +99,14 @@ public class TaxiMapDirectionView
initAMapView();
// 注册定位监听
CallerMapLocationListenerManager.INSTANCE.addListener(TAG, this, false);
CallerChassisLocationGCJ20ListenerManager.INSTANCE.addListener(TAG, this);
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
// 注册定位监听
CallerMapLocationListenerManager.INSTANCE.removeListener(TAG, false);
CallerChassisLocationGCJ20ListenerManager.INSTANCE.removeListener(TAG);
}
private void initAMapView() {
@@ -174,13 +175,12 @@ public class TaxiMapDirectionView
return true;
}
@Override
public void onLocationChanged(@org.jetbrains.annotations.Nullable MogoLocation location, int from, boolean isGps) {
if (location == null){
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
if (gnssInfo == null){
return;
}
LatLng currentLatLng = new LatLng(location.getLatitude(), location.getLongitude());
LatLng currentLatLng = new LatLng(gnssInfo.getLatitude(), gnssInfo.getLongitude());
if (mCoordinatesLatLng.size() > 1) {
//圈定地图显示范围
@@ -196,13 +196,13 @@ public class TaxiMapDirectionView
} else {
//设置希望展示的地图缩放级别
CameraPosition cameraPosition = new CameraPosition.Builder()
.target(mCarMarker.getPosition()).tilt(0).bearing(location.getBearing()).zoom(zoomLevel).build();
.target(mCarMarker.getPosition()).tilt(0).bearing((float) gnssInfo.getHeading()).zoom(zoomLevel).build();
mAMap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
}
//更新车辆位置
if (mCarMarker != null) {
// CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "location.getBearing() = " + location.getBearing());
mCarMarker.setRotateAngle(360 - location.getBearing());
mCarMarker.setRotateAngle((float) (360 - gnssInfo.getHeading()));
mCarMarker.setPosition(currentLatLng);
// CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "onCarLocationChanged2--loacation :" + location.getLatitude()+", "+location.getLongitude());
mCarMarker.setToTop();