Merge branch 'dev_robotaxi-d_240401_6.4.0' into dev_robotaxi-d_240401_6.4.0_bailing

This commit is contained in:
yangyakun
2024-05-07 09:57:46 +08:00
122 changed files with 1406 additions and 706 deletions

View File

@@ -8,8 +8,6 @@ import com.mogo.eagle.core.data.map.MogoLocation;
* Model->Presenter回调状态控制器监听accOn、adas ui show、voice ui show、push ui show、v2x ui show等等
*/
public interface IBusControllerStatusCallback {
// 是否vr map模式
void onVRModeChanged(boolean isVRMode);
// 自车定位
void onCarLocationChanged(MogoLocation location);
//开始开启自动驾驶

View File

@@ -48,6 +48,7 @@ import com.mogo.och.bus.util.BDRouteDataTestUtils;
import com.mogo.och.bus.view.BizMapView;
import com.mogo.och.bus.view.SlidePanelView;
import com.mogo.och.common.module.utils.SoundPoolHelper;
import com.mogo.och.common.module.utils.ResourcesUtils;
import org.greenrobot.eventbus.EventBus;
@@ -168,7 +169,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
});
initListener();
setAutopilotBtnStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
setAutopilotBtnStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
ctvAutopilotStatus.setOnClickListener(new OnPreventFastClickListener() {
@Override
@@ -307,9 +308,9 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
if(smallMapView != null){
smallMapView.onDestroy();
}
super.onDestroyView();
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
EventBus.getDefault().unregister(this);
super.onDestroyView();
}
/**
@@ -348,9 +349,9 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
public void run() {
tvArrived.setEnabled(isClickable);
if (isClickable) {
tvArrived.setTextColor(getResources().getColor(R.color.bus_white));
tvArrived.setTextColor(ResourcesUtils.getColor(R.color.bus_white));
} else {
tvArrived.setTextColor(getResources().getColor(R.color.bus_arrived_btn_un_clickable_color));
tvArrived.setTextColor(ResourcesUtils.getColor(R.color.bus_arrived_btn_un_clickable_color));
}
}
},UiThreadHandler.MODE.QUEUE);
@@ -398,7 +399,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
ctvAutopilotStatusTv.setTextColor(AbsMogoApplication.getApp().getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_ic_autopilot);
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == autopilotStatus) { //1可用
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_runnig_tv));
ctvAutopilotStatusTv.setText(ResourcesUtils.getString(R.string.bus_loading_autopilot_runnig_tv));
if(canStartAutopilt){
ctvAutopilotStatus.setClickable(true);
ctvAutopilotStatus.setBackgroundResource(R.drawable.bus_autopilot_0_1_status_bg);
@@ -416,7 +417,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
== autopilotStatus) {
ctvAutopilotStatusTv.setText(R.string.bus_pingxing_driver);
ctvAutopilotStatus.setClickable(false);
ctvAutopilotStatus.setBackgroundResource(R.drawable.pingxingjiashi);
ctvAutopilotStatus.setBackgroundResource(R.drawable.common_autopilot_pxjs);
}
}
@@ -426,18 +427,18 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
== autopilotStatus) {//2 running
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_right_autopilot_icon);
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_success_tv));
ctvAutopilotStatusTv.setTextColor(ResourcesUtils.getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusTv.setText(ResourcesUtils.getString(R.string.bus_loading_autopilot_success_tv));
// ctvAutopilotStatus.setSelected(false);
ctvAutopilotStatus.setClickable(false);
} else {
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_wrong_autopilot_icon);
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_failure_tv));
ctvAutopilotStatusTv.setTextColor(ResourcesUtils.getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusTv.setText(ResourcesUtils.getString(R.string.bus_loading_autopilot_failure_tv));
ctvAutopilotStatus.setClickable(false);
// ctvAutopilotStatus.setSelected(false);
}
UiThreadHandler.postDelayed(() -> setAutopilotBtnStatus(autopilotStatus,CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false)), 1000);
UiThreadHandler.postDelayed(() -> setAutopilotBtnStatus(autopilotStatus,CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0)), 1000);
}
private void changeAutopilotBtnView(int autopilotStatus, boolean isAnimateRunning, boolean canStartAutopilt) {
@@ -499,9 +500,8 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
*/
public void startAutopilotAnimation() {
isAnimateRunning = true;
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_tv));
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
// ctvAutopilotStatus.setSelected(false);
ctvAutopilotStatusTv.setText(ResourcesUtils.getString(R.string.bus_loading_autopilot_tv));
ctvAutopilotStatusTv.setTextColor(ResourcesUtils.getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatus.setClickable(true);
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_loading_autopilot_icon);
if (autopilotLoadingAnimator == null) {

View File

@@ -39,6 +39,7 @@ import com.mogo.och.bus.view.SlidePanelView;
import com.mogo.och.common.module.utils.BlinkAnimationUtil;
import com.mogo.och.common.module.utils.OCHThreadPoolManager;
import com.mogo.och.common.module.utils.QRUtilsKt;
import com.mogo.och.common.module.utils.ResourcesUtils;
import com.mogo.och.common.module.wigets.BindQRCodeDialog;
import com.mogo.och.common.module.wigets.MarqueeTextView;
import com.mogo.och.common.module.wigets.OCHCommitDialog;
@@ -84,6 +85,14 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
@Override
public void onDestroyView() {
if (mPresenter != null) {
mPresenter.onDestroy(this);
}
IMoGoOverlayManager overlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
if(overlayManager!=null) {
overlayManager.removeAllLines();
overlayManager.removeAllPoints();
}
super.onDestroyView();
}
@@ -270,23 +279,23 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
if (arrivingOrArrivedIndex == 0 || arrivingOrArrivedIndex -1 == 0
|| (arrivingOrArrivedIndex -2 == 0 && stationList.size() == 3)){
firstStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_start));
firstStationItem.setStationTag(ResourcesUtils.getString(R.string.bus_station_txt_tag_start));
}else {
firstStationItem.setStationTag("");
}
if (arrivingOrArrivedIndex + 1 == stationList.size() - 1 || arrivingOrArrivedIndex == stationList.size() - 1
|| (arrivingOrArrivedIndex == 0 && arrivingOrArrivedIndex + 2 == stationList.size() - 1)){ //确认是否显示 "终"
thirdStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_end));
thirdStationItem.setStationTag(ResourcesUtils.getString(R.string.bus_station_txt_tag_end));
}else {
thirdStationItem.setStationTag("");
}
//圆点: 0:灰色 过站 1绿色 到站或者即将到站 2蓝色未到站
if (arrivingOrArrivedIndex == 0 && isArrived){
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
secondStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color));
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color));
firstStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_line_station_color_selected));
secondStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_arrived_station_name_text_color));
thirdStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_arrived_station_name_text_color));
firstStationItem.setStationName(stationList.get(0).getName());
secondStationItem.setStationName(stationList.get(1).getName());
@@ -300,9 +309,9 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
secondStationItem.setStationArrowBg(2);
}else if (arrivingOrArrivedIndex == stationList.size() - 1){
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color));
secondStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color));
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
firstStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_station_tag_txt_un_color));
secondStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_station_tag_txt_un_color));
thirdStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_line_station_color_selected));
firstStationItem.setStationName(stationList.get(arrivingOrArrivedIndex -2).getName());
secondStationItem.setStationName(stationList.get(arrivingOrArrivedIndex -1).getName());
@@ -320,9 +329,9 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
}
}else {
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color));
secondStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color));
firstStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_station_tag_txt_un_color));
secondStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_line_station_color_selected));
thirdStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_arrived_station_name_text_color));
firstStationItem.setStationName(stationList.get(arrivingOrArrivedIndex -1).getName());
secondStationItem.setStationName(stationList.get(arrivingOrArrivedIndex).getName());
@@ -356,23 +365,23 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
secondStationItem.showOrHideStationArrowBg(false);
thirdStationItem.showOrHideStationArrowBg(false);
firstStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_start));
thirdStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_end));
firstStationItem.setStationTag(ResourcesUtils.getString(R.string.bus_station_txt_tag_start));
thirdStationItem.setStationTag(ResourcesUtils.getString(R.string.bus_station_txt_tag_end));
firstStationItem.setStationName(stationList.get(0).getName());
thirdStationItem.setStationName(stationList.get(1).getName());
//圆点: 0:灰色 过站 1绿色 到站或者即将到站 2蓝色未到站
if (arrivingOrArrivedIndex == 0 && isArrived){//到站
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color));
firstStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_line_station_color_selected));
thirdStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_arrived_station_name_text_color));
firstStationItem.setStationPointBg(1);
firstStationItem.setStationArrowBg(2);
thirdStationItem.setStationPointBg(0);
}else {
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color));
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
firstStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_station_tag_txt_un_color));
thirdStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_line_station_color_selected));
if (isArrived){ //到终点
firstStationItem.setStationPointBg(0);
firstStationItem.setStationArrowBg(0);
@@ -389,10 +398,10 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
private void showOrHideSwitchLineBtn(boolean isShow) {
if (isShow){//显示切换路线
mSwitchLine.setTag(0);
mSwitchLine.setText(getResources().getString(R.string.bus_switch_line_btn));
mSwitchLine.setText(ResourcesUtils.getString(R.string.bus_switch_line_btn));
}else {//显示结束路线
mSwitchLine.setTag(1);
mSwitchLine.setText(getResources().getString(R.string.bus_close_line_btn));
mSwitchLine.setText(ResourcesUtils.getString(R.string.bus_close_line_btn));
}
}
@@ -453,17 +462,6 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
smallMapView.clearPolyline();
}
/**
* VR模式切换
*
* @param isVRMode
*/
public void onVRModeChanged(boolean isVRMode) {
if (mRootView != null) {
mRootView.setVisibility(isVRMode ? View.VISIBLE : View.GONE);
}
}
/**
* 绘制地图起点终点
*
@@ -517,7 +515,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
//本次行程未结束不支持切换路线。点击则toast提示当前行程未完成不可切换路线
if (CallerAutoPilotStatusListenerManager.INSTANCE.getState()
== IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
ToastUtils.showLong(getResources().getString(R.string.bus_switch_line_btn_warning1));
ToastUtils.showLong(ResourcesUtils.getString(R.string.bus_switch_line_btn_warning1));
return;
}
if ((int)mSwitchLine.getTag() == 0){//切换路线

View File

@@ -151,8 +151,6 @@ public class OrderModel {
// 定位监听
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,5, mMapLocationListener);
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
TrajectoryManager.INSTANCE.addTrajectoryListListenerr(TAG,iTrajectoryListener);
//开启自驾后 异常信息返回
@@ -307,7 +305,6 @@ public class OrderModel {
startOrStopOrderLoop(false);
//startOrStopQueryPassengerWriteOff(false);
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
// 注销定位监听
CallerChassisLocationGCJ02ListenerManager.INSTANCE.removeListener(TAG);
@@ -326,18 +323,6 @@ public class OrderModel {
TrajectoryAndDistanceManager.INSTANCE.removeListener(TAG);
}
private final IMogoStatusChangedListener mMogoStatusChangedListener = new IMogoStatusChangedListener() {
// VR mode变更回调
@Override
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
if (StatusDescriptor.VR_MODE == descriptor) {
if (mControllerStatusCallback != null) {
mControllerStatusCallback.onVRModeChanged(isTrue);
}
}
}
};
private final OchAdasStartFailureCallback mAdasStartFailureListener = new OchAdasStartFailureCallback() {
@Override
public void brakeStatusChanged(boolean isBrakeAvailable) {
@@ -359,7 +344,6 @@ public class OrderModel {
@Override
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
if (null == gnssInfo) return;
Logger.d(TAG, "onChassisLocationGCJ02");
if (mControllerStatusCallback != null) {
mControllerStatusCallback.onCarLocationChanged(gnssInfo);
}
@@ -533,7 +517,6 @@ public class OrderModel {
CallerAutoPilotControlManager.INSTANCE.cancelAutoPilot();
// 取消自驾
setTrajectoryStation(null,null,-1L);
// startOrStopQueryPassengerWriteOff(false);
}
}
@@ -621,7 +604,7 @@ public class OrderModel {
// 非自驾状态---->预写日志----> 启动自驾 ---> 自驾启动成功 ----> 上报日志
//  自驾状态---->启动自驾 ---> 自驾启动成功
//根据开关和后台是否发布轨迹启动自驾
//1、判断轨迹url是否可用
if (FunctionBuildConfig.isPassStartAutopilotCommand
&& TextUtils.isEmpty(busRoutesResult.csvFileUrl)
&& TextUtils.isEmpty(busRoutesResult.csvFileUrlDPQP)
@@ -633,22 +616,15 @@ public class OrderModel {
+ "busRoutesResult.csvFileUrlDPQP = "+busRoutesResult.csvFileUrlDPQP);
return;
}
if (!CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(true)) {
//2、6个条件判断
if (!CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(true, 0)) {
return;
}
CallerLogger.e(M_BUS + TAG, "isPassStartAutopilotCommand = " +
FunctionBuildConfig.isPassStartAutopilotCommand);
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()) {
ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() +
", 请稍候重试");
triggerUnableStartAPReasonEvent();
return;
}
//3、距离轨迹15m计算
String resion = TrajectoryAndDistanceManager.INSTANCE.canStartAutopilot((long)busRoutesResult.getLineId());
if(TrajectoryAndDistanceManager.errorTypeNoneLineId.equals(resion)){
MogoLocation nextStationPoint = new MogoLocation();
@@ -661,7 +637,7 @@ public class OrderModel {
MogoLocation currentStationPoint = new MogoLocation();
currentStationPoint.setLongitude(busStationBean.getGcjLon());
currentStationPoint.setLatitude(busStationBean.getGcjLat());
setTrajectoryStation(currentStationPoint,nextStationPoint, (long) currentLineId);
setTrajectoryStation(currentStationPoint,nextStationPoint, (long)busRoutesResult.getLineId());
resion = TrajectoryAndDistanceManager.INSTANCE.canStartAutopilot((long)busRoutesResult.getLineId());
}
if(!StringUtils.isEmpty(resion)){
@@ -669,6 +645,16 @@ public class OrderModel {
return;
}
//4、ssm 给出数据
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()) {
ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() +
", 请稍候重试");
triggerUnableStartAPReasonEvent();
return;
}
firstStartAutopilot++;
if(CallerAutoPilotStatusListenerManager.INSTANCE.getState() != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
@@ -1282,26 +1268,6 @@ public class OrderModel {
return parameters;
}
public void setStation(){
BusStationBean busStationBean = stationList.get(backgroundCurrentStationIndex);
String nextStationName = "";
String nextStationNameKr = "";
MogoLocation nextStationPoint = new MogoLocation();
if (backgroundCurrentStationIndex < stationList.size() - 1) {
BusStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1);
nextStationName = nextStation.getName();
nextStationNameKr = nextStation.getNameKr();
nextStationPoint.setLongitude(nextStation.getGcjLon());
nextStationPoint.setLatitude(nextStation.getGcjLat());
}
final String currentStationName = busStationBean.getName();
String finalNextStationName = nextStationName;
String finalNextStationNameKr = nextStationNameKr;
MogoLocation currentStationPoint = new MogoLocation();
currentStationPoint.setLongitude(busStationBean.getGcjLon());
currentStationPoint.setLatitude(busStationBean.getGcjLat());
}
public void setTrajectoryStation(MogoLocation startStation,MogoLocation endStation,Long lineId){
TrajectoryAndDistanceManager.INSTANCE.setStationPoint(startStation,endStation,lineId);
}

View File

@@ -62,7 +62,14 @@ public class BusLinePresenter extends Presenter<BusSwitchLineView> implements IB
@Override
public void onChangeLineIdSuccess() {
OrderModel.getInstance().clearBusStationDatas();
runOnUIThread(() -> mView.onChangeLineIdSuccess());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onChangeLineIdSuccess();
}
}
}, UiThreadHandler.MODE.QUEUE);
}
public void queryBusLines(){
@@ -105,6 +112,8 @@ public class BusLinePresenter extends Presenter<BusSwitchLineView> implements IB
@Override
public void onBusLineTasks(BusQueryLineTaskResponse o, int position,boolean autoRefresh) {
mView.onBusLineTasks(o,position,autoRefresh);
if(mView!=null) {
mView.onBusLineTasks(o,position,autoRefresh);
}
}
}

View File

@@ -84,8 +84,8 @@ public class BusPresenter extends Presenter<BusFragment>
OrderModel.getInstance().setControllerStatusCallback(this);
OrderModel.getInstance().setPassengerCallback(this);
OrderModel.getInstance().setAdasStatusCallback(this);
OchAutoPilotStatusListenerManager.INSTANCE.addListener(TAG,this);
LoginStatusManager.INSTANCE.addListener(TAG,this);
OchAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
LoginStatusManager.INSTANCE.addListener(TAG, this);
}
public void releaseListener() {
@@ -108,7 +108,7 @@ public class BusPresenter extends Presenter<BusFragment>
}
public void restartAutopilot() {
if (OrderModel.getInstance().isGoingToNextStation()){
if (OrderModel.getInstance().isGoingToNextStation()) {
OrderModel.getInstance().restartAutopilot();
}
}
@@ -119,32 +119,51 @@ public class BusPresenter extends Presenter<BusFragment>
}
@Override
public void updateBusTaskStatus(String lineName,String lineTime,
public void updateBusTaskStatus(String lineName, String lineTime,
List<BusStationBean> stationList,
int arrivingOrArrivedIndex,
boolean isArrived) {
mStationList.clear();
mStationList.addAll(stationList);
if (arrivingOrArrivedIndex == 0 || isArrived){
if (arrivingOrArrivedIndex == 0 || isArrived) {
mCurrentStation = arrivingOrArrivedIndex;
}else {
mCurrentStation = arrivingOrArrivedIndex -1;
} else {
mCurrentStation = arrivingOrArrivedIndex - 1;
}
CallerLogger.d(M_BUS + "BusOrderModel =", " mCurrentStation =" + mCurrentStation);
if (mView != null) {
runOnUIThread(() -> mView.updateBusTaskStatus(lineName,lineTime,
stationList, arrivingOrArrivedIndex, isArrived));
}
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.updateBusTaskStatus(lineName, lineTime,
stationList, arrivingOrArrivedIndex, isArrived);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void updateEmptyUi() {
runOnUIThread(() -> mView.updateLineEmptyUI());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.updateLineEmptyUI();
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void clearBusStationsMarkers() {
runOnUIThread(() -> mView.clearBusStationsMarkers());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.clearBusStationsMarkers();
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
@@ -157,12 +176,12 @@ public class BusPresenter extends Presenter<BusFragment>
@Override
public void onAutopilotArriveAtStation(ArrivedStation arrivedStation) {
CallerLogger.e( M_BUS + TAG, "行程日志-onAutopilotArriveAtStation arrive");
arriveStation(arrivedStation,"底盘触发进站");
CallerLogger.e(M_BUS + TAG, "行程日志-onAutopilotArriveAtStation arrive");
arriveStation(arrivedStation, "底盘触发进站");
}
public void arriveStation(ArrivedStation arrivedStation,String type){
OrderModel.getInstance().onArriveAt(arrivedStation,type);
public void arriveStation(ArrivedStation arrivedStation, String type) {
OrderModel.getInstance().onArriveAt(arrivedStation, type);
}
@Override
@@ -186,52 +205,62 @@ public class BusPresenter extends Presenter<BusFragment>
return;
}
// 改变UI自动驾驶状态
runOnUIThread(() -> mView.onAutopilotStatusChanged(state, CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false)));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.onAutopilotStatusChanged(state, CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
}
}, UiThreadHandler.MODE.QUEUE);
break;
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING:
OrderModel.getInstance().triggerStartServiceEvent(
OrderModel.getInstance().isRestartAutopilot(), true);
OrderModel.getInstance().isRestartAutopilot(), true);
// 改变UI自动驾驶状态
runOnUIThread(() -> mView.onAutopilotStatusChanged(state, CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false)));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.onAutopilotStatusChanged(state, CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
}
}, UiThreadHandler.MODE.QUEUE);
break;
default:
runOnUIThread(() -> mView.onAutopilotEnableChange(false));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.onAutopilotEnableChange(false);
}
}
}, UiThreadHandler.MODE.QUEUE);
break;
}
}
@Override
public void onVRModeChanged(boolean isVRMode) {
runOnUIThread(() -> mView.onVRModeChanged(isVRMode));
}
@Override
public void onCarLocationChanged(MogoLocation location) {
// if (null != location) {
// runOnUIThread(() -> mView.updateSpeedView((float) location.getGnssSpeed()));
// }
}
@Override
public void startOpenAutopilot() {
//非美化模式下启动动画
runOnUIThread(() -> mView.startAutopilotAnimation());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.startAutopilotAnimation();
}
}
}, UiThreadHandler.MODE.QUEUE);
//中间站点再次开启自驾时, 自动驾驶状态是2未改变 此次鹰眼底层不再返给业务,需优化按钮动画显示
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
== CallerAutoPilotStatusListenerManager.INSTANCE.getState()){
mView.onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
}
}
private void runOnUIThread(Runnable executor) {
if (executor == null) {
return;
}
if (Looper.myLooper() != Looper.getMainLooper()) {
UiThreadHandler.post(executor);
} else {
executor.run();
== CallerAutoPilotStatusListenerManager.INSTANCE.getState() && mView != null) {
mView.onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
}
@@ -245,22 +274,24 @@ public class BusPresenter extends Presenter<BusFragment>
@Override
public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo, long lineId) {
BusTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo,lineId);
BusTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo, lineId);
}
@Override
public void onStatusChange(LoginStatusEnum currentStatus) {
CallerLogger.d(M_BUS + TAG, " loginStatus =" + LoginStatusManager.isLogin());
if(LoginStatusManager.isLogin()){
if (LoginStatusManager.isLogin()) {
OrderModel.getInstance().startOrStopOrderLoop(true);
OrderModel.getInstance().queryBusRoutes();
}else {
} else {
BusTrajectoryManager.getInstance().stopTrajReqLoop();
OrderModel.getInstance().startOrStopOrderLoop(false);
BusTrajectoryManager.getInstance().stopTrajReqLoop();
clearBusStationsMarkers();
mView.hideSlidePanel();
if(mView!=null) {
mView.hideSlidePanel();
}
OrderModel.getInstance().closeBeautificationMode();
}
}
@@ -268,9 +299,9 @@ public class BusPresenter extends Presenter<BusFragment>
@Override
public void playPassenger(WriteOffPassenger passenger) {
int passengerNum = passenger.passengerSize;
if (passengerNum > 1){ //多人播报 "x人" ---》x人核验通过
OrderModel.getInstance().sendWriteOffNumToClient(passengerNum+"人核验通过");
}else { //是 1 播放 "滴" 2022.11.09 改为: "核验通过"
if (passengerNum > 1) { //多人播报 "x人" ---》x人核验通过
OrderModel.getInstance().sendWriteOffNumToClient(passengerNum + "人核验通过");
} else { //是 1 播放 "滴" 2022.11.09 改为: "核验通过"
// mView.playDI();
OrderModel.getInstance().sendWriteOffNumToClient("核验通过");
}
@@ -279,11 +310,20 @@ public class BusPresenter extends Presenter<BusFragment>
@Override
public void onStartAdasFailure() {
runOnUIThread(() -> mView.stopAnimAndUpdateBtnStatus());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.stopAnimAndUpdateBtnStatus();
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void canStartAutopilot(boolean canStart) {
mView.onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), canStart);
if(mView!=null) {
mView.onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), canStart);
}
}
}

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/press_start_status">
<item android:state_pressed="true" android:drawable="@drawable/common_autopilot_press">
</item>
<item android:drawable="@drawable/start_failure">
<item android:drawable="@drawable/common_autopilot_unable">
</item>
</selector>

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/press_start_status">
<item android:state_pressed="true" android:drawable="@drawable/common_autopilot_press">
</item>
<item android:drawable="@drawable/start_success">
<item android:drawable="@drawable/common_autopilot_in_autopilot">
</item>
</selector>

View File

@@ -19,22 +19,6 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<!-- <FrameLayout-->
<!-- android:id="@+id/fl_speed"-->
<!-- android:layout_width="@dimen/dp_616"-->
<!-- android:layout_height="@dimen/dp_320"-->
<!-- android:layout_marginLeft="@dimen/dp_13"-->
<!-- android:layout_marginTop="@dimen/dp_40"-->
<!-- android:visibility="visible"-->
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent">-->
<!-- <com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView-->
<!-- android:id="@+id/bus_arc"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent" />-->
<!-- </FrameLayout>-->
<FrameLayout
android:id="@+id/fl_speed"
android:layout_width="@dimen/dp_618"
@@ -171,9 +155,11 @@
<RelativeLayout
android:id="@+id/module_mogo_och_autopilot_status"
android:layout_width="@dimen/dp_616"
android:layout_height="@dimen/dp_180"
android:layout_marginStart="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_m_1"
android:layout_height="@dimen/dp_185"
android:layout_marginStart="@dimen/dp_9"
android:layout_marginTop="-31dp"
android:paddingTop="@dimen/dp_27"
android:paddingBottom="@dimen/dp_32"
android:background="@drawable/bus_autopilot_0_1_status_bg"
android:gravity="center"
app:layout_constraintLeft_toLeftOf="parent"
@@ -206,9 +192,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_13"
android:layout_marginTop="-24dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_autopilot_status"
app:layout_goneMarginTop="@dimen/module_mogo_och_station_panel_container_margin_top_no_call" />
/>
<include
android:id="@+id/module_mogo_och_bus_test_bar"

View File

@@ -5,7 +5,6 @@ import android.view.View
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
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
@@ -59,7 +58,7 @@ class BusPassengerProvider : CommonServiceImpl() {
} else if (AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)) {
BusPStatusBarView(context)
} else{
StatusBarView(context)
BusPStatusBarView(context)
}
}
return statusBarView!!

View File

@@ -18,14 +18,17 @@ import com.amap.api.maps.model.LatLng;
import com.elegant.utils.UiThreadHandler;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.hmi.ui.widget.DriverMonitorView;
import com.mogo.commons.storage.SharedPrefsMgr;
import com.mogo.map.overlay.IMoGoOverlayManager;
import com.mogo.och.bus.passenger.R;
import com.mogo.och.bus.passenger.ui.adapter.BusPassengerLineStationsAdapter;
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
import com.mogo.och.bus.passenger.presenter.BaseBusPassengerPresenter;
import com.mogo.och.bus.passenger.ui.layoutmanager.CenterLayoutManager;
import com.mogo.och.common.module.utils.NumberFormatUtil;
import com.mogo.och.common.module.utils.ResourcesUtils;
import com.mogo.och.common.module.wigets.MarqueeTextView;
import com.mogo.och.common.module.wigets.OCHGradientTextView;
import com.mogo.och.data.bean.BusStationBean;
@@ -92,8 +95,8 @@ public class BusPassengerRouteFragment extends
mSpeedTv = findViewById(R.id.bus_p_speed_tv);
mSpeedTv.setVertrial(true);
mSpeedTv.setmColorList(new int[]{getResources().getColor(R.color.bus_p_speed_color_start),
getResources().getColor(R.color.bus_p_speed_color_end)});
mSpeedTv.setmColorList(new int[]{ResourcesUtils.getColor(R.color.bus_p_speed_color_start),
ResourcesUtils.getColor(R.color.bus_p_speed_color_end)});
mNoLineInfoView =findViewById(R.id.bus_p_no_order_data_view);
emptyTv = findViewById(R.id.no_order_data_tv);
@@ -220,6 +223,17 @@ public class BusPassengerRouteFragment extends
}
}
@Override
public void onDestroyView() {
IMoGoOverlayManager overlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
if(overlayManager!=null) {
overlayManager.removeAllLines();
overlayManager.removeAllPoints();
}
super.onDestroyView();
}
@Override
public void onDestroy() {
super.onDestroy();
@@ -368,26 +382,26 @@ public class BusPassengerRouteFragment extends
public void updateArrivedStation(String station,int currentIndex,boolean isArrived){
if (null == station){
mCurrentArriveStation.setText("----");
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title));
mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip));
mCurrentArriveStationTitle.setText(ResourcesUtils.getString(R.string.bus_p_cur_station_title));
mCurrentArriveTip.setText(ResourcesUtils.getString(R.string.bus_p_cur_station_arrived_tip));
mCurrentArriveTip.setBackgroundResource(R.drawable.cur_station_arrived_bg);
handleArrivingSpeakIconDrawable();
}else {
mCurrentArriveStation.setText(station);
if (currentIndex == 0){
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title));
mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip));
mCurrentArriveStationTitle.setText(ResourcesUtils.getString(R.string.bus_p_cur_station_title));
mCurrentArriveTip.setText(ResourcesUtils.getString(R.string.bus_p_cur_station_arrived_tip));
mCurrentArriveTip.setBackgroundResource(R.drawable.cur_station_arrived_bg);
handleArrivingSpeakIconDrawable();
return;
}
if (isArrived){
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title));
mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip));
mCurrentArriveStationTitle.setText(ResourcesUtils.getString(R.string.bus_p_cur_station_title));
mCurrentArriveTip.setText(ResourcesUtils.getString(R.string.bus_p_cur_station_arrived_tip));
mCurrentArriveTip.setBackgroundResource(R.drawable.cur_station_arrived_bg);
handleArrivedSpeakIconDrawable();
}else {
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_next_station_title));
mCurrentArriveStationTitle.setText(ResourcesUtils.getString(R.string.bus_p_cur_next_station_title));
mCurrentArriveTip.setBackgroundResource(R.drawable.cur_station_un_arrived_bg);
handleArrivingSpeakIconDrawable();
}

View File

@@ -2,6 +2,7 @@ package com.mogo.och.bus.passenger.passenger.ui
import android.os.Bundle
import com.mogo.commons.mvp.MvpFragment
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getOverlayManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.map.overlay.core.Level
@@ -64,6 +65,10 @@ class PM2HPMapFragment :
override fun onDestroyView() {
mapBizView.onDestroy()
CallerMapUIServiceManager.getOverlayManager()?.let {
it.removeAllLines()
it.removeAllPoints()
}
super.onDestroyView()
}

View File

@@ -15,12 +15,6 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.mogo.och.bus.passenger.ui.BusPStatusBarView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugViewTrigger
android:layout_width="@dimen/dp_400"
android:layout_height="@dimen/dp_100"

View File

@@ -26,6 +26,7 @@
android:layout_height="@dimen/dp_28"
android:layout_gravity="center"
android:layout_marginStart="@dimen/dp_40"
app:wifi_size="@dimen/dp_18"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@+id/status_bar_logo"
app:layout_constraintTop_toTopOf="parent" />

View File

@@ -15,6 +15,7 @@ import com.magic.mogo.och.charter.view.SlidePanelView
import com.mogo.commons.storage.SharedPrefsMgr
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.temp.EventLogout
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.och.common.module.utils.DateTimeUtil
@@ -108,6 +109,13 @@ class DriverM1Fragment : CharterBaseFragment<DriverM1Fragment?, DriverM1Presente
}
override fun onDestroyView() {
if (mPresenter != null) {
mPresenter?.onDestroy(this)
}
CallerMapUIServiceManager.getOverlayManager()?.let {
it.removeAllLines()
it.removeAllPoints()
}
super.onDestroyView()
}

View File

@@ -37,16 +37,9 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.i
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.*
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager.pushAppOperationalMsgBox
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager.registerSocketMessageListener
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager.releaseSocketMessageListener
import com.mogo.och.common.module.constant.OchCommonConst
import com.mogo.och.common.module.network.OchCommonServiceCallback
import com.mogo.och.common.module.biz.login.LoginStatusManager
import com.mogo.och.common.module.callback.OchAdasStartFailureCallback
import com.mogo.och.common.module.manager.socket.cloud.AbnormalFactorsLoopManager.startLoopAbnormalFactors
import com.mogo.och.common.module.manager.socket.cloud.AbnormalFactorsLoopManager.stopLoopAbnormalFactors
import com.mogo.och.common.module.constant.OchCommonConst
import com.mogo.och.common.module.manager.CharterSendTripInfoManager
import com.mogo.och.common.module.manager.CharterSendTripInfoManager.ARRIVE_STATION
import com.mogo.och.common.module.manager.CharterSendTripInfoManager.END_TRIP
@@ -55,6 +48,12 @@ import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager
import com.mogo.och.common.module.manager.device.LightAirconditionDoorManager
import com.mogo.och.common.module.manager.device.LightAirconditionDoorStatusManager
import com.mogo.och.common.module.manager.socket.cloud.AbnormalFactorsLoopManager.startLoopAbnormalFactors
import com.mogo.och.common.module.manager.socket.cloud.AbnormalFactorsLoopManager.stopLoopAbnormalFactors
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager.pushAppOperationalMsgBox
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager.registerSocketMessageListener
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager.releaseSocketMessageListener
import com.mogo.och.common.module.manager.socket.cloud.data.OperateDoorMsg
import com.mogo.och.common.module.manager.socket.cloud.data.OrderCloseMsg
import com.mogo.och.common.module.manager.socket.cloud.data.SystemMsg
@@ -65,6 +64,7 @@ import com.mogo.och.common.module.manager.socket.lan.bean.ChangeDestMsg
import com.mogo.och.common.module.manager.socket.lan.bean.DPMsgType
import com.mogo.och.common.module.manager.socket.lan.bean.DPOrderClosedMsg
import com.mogo.och.common.module.manager.stopside.StopSideManager
import com.mogo.och.common.module.network.OchCommonServiceCallback
import com.mogo.och.common.module.utils.*
import com.mogo.och.common.module.voice.VoiceNotice
import com.mogo.och.data.bean.*
@@ -479,14 +479,7 @@ class DriverM1Model {
* @param isRestart
*/
private fun startAutopilot() {
if (!OCHAdasAbilityManager.getInstance().autopilotAbilityStatus) {
ToastUtils.showLong(
OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason +
", 请稍候重试"
)
triggerUnableStartAPReasonEvent()
return
}
//判断轨迹Id是否可用
mCurrentRoute?.let {
//根据开关和后台是否发布轨迹启动自驾
if (FunctionBuildConfig.isPassStartAutopilotCommand
@@ -502,9 +495,20 @@ class DriverM1Model {
return
}
}
// 6个条件判断
if (!CallerAutoPilotControlManager.isCanStartAutopilot(true)) {
return
}
// ssm 给出数据
if (!OCHAdasAbilityManager.getInstance().autopilotAbilityStatus) {
ToastUtils.showLong(
OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason +
", 请稍候重试"
)
triggerUnableStartAPReasonEvent()
return
}
triggerStartServiceEvent(false, false)
val parameters = initAutopilotControlParameters()
if (null == parameters) {

View File

@@ -125,7 +125,7 @@ class AutopilotStatusView : RelativeLayout,AutopilotStatusViewModel.IAutopilotSt
bus_autopolot_btn_tv.text = resources.getString(R.string.charter_loading_autopilot_pingxing_tv)
bus_autopilot_btn_iv.setImageResource(R.drawable.charter_ic_autopilot)
isClickable = false
background = ResourceUtils.getDrawable(R.drawable.charter_pingxingjiashi)
background = ResourceUtils.getDrawable(R.drawable.common_autopilot_pxjs)
}
override fun onAttachedToWindow() {

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/charter_press_start_status"/>
<item android:drawable="@drawable/charter_start_failure"/>
<item android:state_pressed="true" android:drawable="@drawable/common_autopilot_press"/>
<item android:drawable="@drawable/common_autopilot_start_fail"/>
</selector>

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/charter_press_start_status">
<item android:state_pressed="true" android:drawable="@drawable/common_autopilot_press">
</item>
<item android:drawable="@drawable/charter_start_success">
<item android:drawable="@drawable/common_autopilot_in_autopilot">
</item>
</selector>

View File

@@ -3,8 +3,8 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/dp_616"
android:layout_height="@dimen/dp_180"
android:layout_width="@dimen/dp_618"
android:layout_height="@dimen/dp_185"
android:gravity="center"
android:background="@drawable/charter_autopilot_0_1_status_bg"
tools:parentTag="RelativeLayout">

View File

@@ -164,20 +164,24 @@
<com.magic.mogo.och.charter.view.autopilot.AutopilotStatusView
android:id="@+id/autopilot_status"
android:layout_width="@dimen/dp_616"
android:layout_height="@dimen/dp_180"
android:layout_width="@dimen/dp_618"
android:layout_height="@dimen/dp_185"
android:gravity="center"
android:paddingTop="@dimen/dp_27"
android:paddingBottom="@dimen/dp_32"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/fl_speed"
tools:visibility="visible"
android:layout_marginLeft="@dimen/dp_13"/>
android:layout_marginTop="-31dp"
android:layout_marginLeft="@dimen/dp_9"/>
<!--订单状态-->
<FrameLayout
android:id="@+id/module_mogo_och_station_panel_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_13"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="-30dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/autopilot_status"
app:layout_goneMarginTop="@dimen/dp_530" />

View File

@@ -50,6 +50,7 @@ import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatu
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
import com.mogo.och.common.module.manager.beautifymode.BeautifyManager
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
import com.mogo.och.common.module.manager.socket.lan.LanSocketManager
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil
@@ -1120,18 +1121,12 @@ object CharterPassengerModel {
* 开启自动驾驶
*/
fun startAutopilot() {
if (!OCHAdasAbilityManager.getInstance().autopilotAbilityStatus) {
ToastCharterUtils.showToastLong(
OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason +
", 请稍候重试"
)
return
}
orderInfo?.let {
if (it.arriveStatus == OrderInfoResponse.ARRIVED) {
ToastCharterUtils.showToastLong("已到达目的地请重新选择线路")
return
}
//1、判断轨迹Id是否可用
locusInfo?.let {
//根据开关和后台是否发布轨迹启动自驾
if (FunctionBuildConfig.isPassStartAutopilotCommand
@@ -1147,9 +1142,18 @@ object CharterPassengerModel {
return
}
}
// 2、6个条件判断
if (!CallerAutoPilotControlManager.isCanStartAutopilot(true)) {
return
}
// 4、ssm 给出数据
if (!OCHAdasAbilityManager.getInstance().autopilotAbilityStatus) {
ToastCharterUtils.showToastLong(
OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason +
", 请稍候重试"
)
return
}
val parameters = initAutopilotControlParameters()
if (null == parameters) {
ToastCharterUtils.showToastShort("请选择站点")
@@ -1265,4 +1269,12 @@ object CharterPassengerModel {
updateAutopilotControlParameters(null)
}
fun setTrajectoryStation(
startStation: MogoLocation?,
endStation: MogoLocation?,
lineId: Long?
) {
TrajectoryAndDistanceManager.setStationPoint(startStation, endStation, lineId)
}
}

View File

@@ -10,17 +10,14 @@ import com.amap.api.maps.model.LatLng
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.mvp.MvpFragment
import com.mogo.eagle.core.data.config.HdMapBuildConfig
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.function.api.hmi.view.IStatusViewLayout
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
import com.mogo.eagle.core.function.hmi.ui.msgbox.MMsgBoxButtonView
import com.mogo.eagle.core.function.view.SiteMarkerBean
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
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.VisualAngleMode
import com.mogo.och.charter.passenger.R
import com.mogo.och.charter.passenger.bean.event.EventLineSites
import com.mogo.och.charter.passenger.callback.IClearViewCallback
@@ -45,9 +42,6 @@ import kotlinx.android.synthetic.main.charter_p_main_fragment.biz_video
import kotlinx.android.synthetic.main.charter_p_main_fragment.mapBizView
import kotlinx.android.synthetic.main.charter_p_main_fragment.mcv_play_music
import kotlinx.android.synthetic.main.charter_p_main_fragment.omvOverMap
//import kotlinx.android.synthetic.main.charter_p_main_fragment.viewBusPM1MsgBoxBubble
//import kotlinx.android.synthetic.main.charter_p_main_fragment.viewBusPM1MsgBoxButton
//import kotlinx.android.synthetic.main.charter_p_main_fragment.viewBusPM1MsgBoxList
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
@@ -272,9 +266,16 @@ class MainFragment : MvpFragment<MainFragment?, BusPassengerPresenter?>(), IMogo
override fun onDestroyView() {
mapBizView.onDestroy()
omvOverMap.onDestroy()
CallerMapUIServiceManager.getOverlayManager()?.let {
it.removeAllLines()
it.removeAllPoints()
}
MogoMapListenerHandler.mogoMapListenerHandler.unregisterHostMapListener(TAG)
super.onDestroyView()
EventBus.getDefault().unregister(this)
if (mPresenter != null) {
mPresenter?.onDestroy(this)
}
super.onDestroyView()
}
override fun onMapLoaded() {

View File

@@ -59,7 +59,7 @@ object LoginModel {
}
fun hasInit(): Boolean {
if (mContext == null && iTaxiLoginCallback == null) {
if (iTaxiLoginCallback == null) {
return false
}
return true

View File

@@ -13,7 +13,7 @@
android:gravity="center"
android:paddingTop="@dimen/dp_20"
android:paddingBottom="@dimen/dp_20"
android:text="小巴"
android:text="公交模式"
android:textColor="@color/white"
app:layout_constraintBottom_toTopOf="@+id/actv_business_charter"
app:layout_constraintEnd_toEndOf="parent"
@@ -27,7 +27,7 @@
android:paddingTop="@dimen/dp_20"
android:paddingBottom="@dimen/dp_20"
android:gravity="center"
android:text="包车"
android:text="包车模式"
android:textColor="@color/white"
app:layout_constraintBottom_toTopOf="@+id/actv_business_shuttle"
app:layout_constraintEnd_toEndOf="parent"
@@ -41,7 +41,7 @@
android:paddingTop="@dimen/dp_20"
android:paddingBottom="@dimen/dp_20"
android:gravity="center"
android:text="接驳"
android:text="接驳模式"
android:textColor="@color/white"
app:layout_constraintBottom_toTopOf="@+id/actv_business_taxi"
app:layout_constraintEnd_toEndOf="parent"
@@ -55,7 +55,7 @@
android:paddingTop="@dimen/dp_20"
android:paddingBottom="@dimen/dp_20"
android:gravity="center"
android:text="出租车"
android:text="出租车模式"
android:textColor="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View File

@@ -45,6 +45,7 @@ android {
res.srcDirs = [
'src/main/res',
'src/main/res/xiaozhi',
'src/main/res/autopilot',
]
}
}

View File

@@ -59,10 +59,10 @@ object LoginLanDriverSocket : ILoginCallback {
// 司机端发送业务模式更改和环境校验
override fun onStatusChange(currentStatus: LoginStatusEnum?) {
FlavorUtils.getEnvCheck()
if (FlavorUtils.vehicleType != null && FlavorUtils.projectType != null && FlavorUtils.envType != null) {
when (currentStatus) {
LoginStatusEnum.Login -> {
FlavorUtils.getEnvCheck()
val msg =
ChangeBusinessType(
FlavorUtils.vehicleType!!,
@@ -77,7 +77,6 @@ object LoginLanDriverSocket : ILoginCallback {
BizLoopManager.setLoopFunction(TAG, LoopInfo(60*10, ::loopCheck))
}
}
else -> {
BizLoopManager.removeLoopFunction(TAG)
val msg =

View File

@@ -2,12 +2,16 @@ package com.mogo.och.common.module.biz.lansocket
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
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.UiThreadHandler
import com.mogo.och.common.module.biz.login.BusinessEnum
import com.mogo.och.common.module.biz.login.LoginStatusEnum
import com.mogo.och.common.module.biz.login.LoginStatusManager
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
import com.mogo.och.common.module.manager.loop.BizLoopManager
import com.mogo.och.common.module.manager.loop.LoopInfo
import com.mogo.och.common.module.manager.socket.lan.ILanMessageListener
import com.mogo.och.common.module.manager.socket.lan.LanSocketManager
import com.mogo.och.common.module.manager.socket.lan.bean.BaseDPMsg
@@ -36,6 +40,24 @@ object LoginLanPassengerSocket : IReceivedMsgListener {
}
}
var isConnected:Boolean by Delegates.observable(false) { _, oldV, newV ->
if (oldV != newV) {
if(newV){// 已连接
if(driverSn.isEmpty()){
LoginStatusManager.changeStatus("连接成功 未收到司机屏sn")
}else{
LoginStatusManager.changeStatus("连接成功 司机SN:${driverSn}")
}
}else{// 未连接
if(driverSn.isEmpty()){
LoginStatusManager.changeStatus("当前状态:连接司机屏中")
}else{
LoginStatusManager.changeStatus("连接断开 司机SN:${driverSn}")
}
}
}
}
// 环境监测
private val checkListener = object : ILanMessageListener<EnvCheck> {
override fun target(): Class<EnvCheck> {
@@ -94,7 +116,7 @@ object LoginLanPassengerSocket : IReceivedMsgListener {
BusinessType.taxi -> LoginStatusManager.setBusinessType(BusinessEnum.Taxi.code)
BusinessType.taxiunmanned ->LoginStatusManager.setBusinessType(BusinessEnum.Taxi.code)
}
status.append(", 后台配置:${LoginStatusManager.getBusInessType().name}>")
status.append(", 切换后:${LoginStatusManager.getBusInessType().name}>")
LoginStatusManager.changeStatus(status.toString())
UiThreadHandler.postDelayed({
LoginStatusManager.setLoginStatus(LoginStatusEnum.Login)
@@ -113,6 +135,7 @@ object LoginLanPassengerSocket : IReceivedMsgListener {
init {
//监听司机端消息
CallerTelematicListenerManager.addListener(TAG, this)
BizLoopManager.setLoopFunction(TAG, LoopInfo(3, ::showConnectStatusWithDriver))
// 乘客屏
LanSocketManager.registerSocketMessageListener(
DPMsgType.TYPE_ENV_CHECK.type,
@@ -130,6 +153,11 @@ object LoginLanPassengerSocket : IReceivedMsgListener {
}
private fun showConnectStatusWithDriver(){
CallerLogger.d(TAG,"司机屏连接状态:${CallerTelematicManager.getClientConnStatus()}")
isConnected = CallerTelematicManager.getClientConnStatus()
}
override fun onReceivedServerSn(sn: String?) {
Logger.d(TAG, "司机屏sn$sn")
driverSn = sn ?: ""

View File

@@ -13,6 +13,7 @@ import com.mogo.eagle.core.utilcode.util.CoordinateUtils
import com.mogo.eagle.core.utilcode.util.LocationUtils
import com.mogo.och.common.module.constant.OchCommonConst
import com.mogo.och.common.module.manager.autopilot.trajectory.TrajectoryCache
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
import com.mogo.och.common.module.manager.loop.BizLoopManager
import com.mogo.och.common.module.manager.loop.LoopInfo
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil
@@ -661,9 +662,12 @@ object TrajectoryAndDistanceManager : IMoGoPlanningRottingListener {
*/
fun canStartAutopilot(lineId: Long?): String {
if (lineId == null) {
OchChainLogManager.writeChainLog("启动自驾距离判断","未传轨迹ID", eventID = OchChainLogManager.EVENT_KEY_INFO_AUTOPILOT_DISTANCE)
return "请确认线路ID"
}
OchChainLogManager.writeChainLog("启动自驾距离判断","条件记录:lineId:${lineId}----this.lineId:${this.lineId}", eventID = OchChainLogManager.EVENT_KEY_INFO_AUTOPILOT_DISTANCE)
try {
if (mRoutePoints.isNullOrEmpty()) {
// 判断距离起始站的距离
@@ -697,6 +701,7 @@ object TrajectoryAndDistanceManager : IMoGoPlanningRottingListener {
} catch (e: Exception) {
e.printStackTrace()
}
OchChainLogManager.writeChainLog("启动自驾距离判断","距离站点距离:不支持的条件直接放过", eventID = OchChainLogManager.EVENT_KEY_INFO_AUTOPILOT_DISTANCE)
return ""
}
@@ -714,6 +719,7 @@ object TrajectoryAndDistanceManager : IMoGoPlanningRottingListener {
startStationInfo.stationPoint!!.longitude,
startStationInfo.stationPoint!!.latitude
)
OchChainLogManager.writeChainLog("启动自驾距离判断","距离站点距离:${distance}", eventID = OchChainLogManager.EVENT_KEY_INFO_AUTOPILOT_DISTANCE)
return if (distance <= OchCommonConst.AUTOMATIC_PLANNING_MAX_DISTANCE) {
""
} else {
@@ -737,10 +743,12 @@ object TrajectoryAndDistanceManager : IMoGoPlanningRottingListener {
currentPoint.latitude
)
if(pointToLine<=OchCommonConst.AUTOMATIC_PLANNING_MAX_DISTANCE){
OchChainLogManager.writeChainLog("启动自驾距离判断","距离轨迹线距离:${pointToLine}", eventID = OchChainLogManager.EVENT_KEY_INFO_AUTOPILOT_DISTANCE)
return ""
}
}
}
OchChainLogManager.writeChainLog("启动自驾距离判断","距离轨迹线超过15m,无法启动自驾", eventID = OchChainLogManager.EVENT_KEY_INFO_AUTOPILOT_DISTANCE)
return "距离轨迹线超过15m,无法启动自驾"
}

View File

@@ -26,6 +26,8 @@ object OchChainLogManager {
const val EVENT_KEY_INFO_SOCKET = "analytics_event_och_track_screen_msg"
const val EVENT_KEY_INFO_SOCKET_CONNECT = "analytics_event_och_track_screen_connect"
const val EVENT_KEY_INFO_AUTOPILOT_DISTANCE = "event_key_vehicle_start_autopilot_state_distance_15"
fun writeChainLogNet(info: String, changeInfo: String){
writeChainLog(info,changeInfo,true,EVENT_KEY_INFO_Net)

View File

@@ -41,6 +41,7 @@ class OchCommonSubscribeImpl<T : BaseData>(
OchChainLogManager.writeChainLogNet("接口:${apiName}", "请求失败:${e.message}")
}
callback?.onError("$apiName: onError() ${e.message}")
callback?.onError()
}
override fun onError(message: String, code: Int) {

View File

@@ -0,0 +1,20 @@
package com.mogo.och.common.module.utils
import android.graphics.BitmapFactory
import androidx.annotation.ColorRes
import androidx.annotation.StringRes
import androidx.core.content.ContextCompat
import com.mogo.commons.AbsMogoApplication
object ResourcesUtils {
@JvmStatic
fun getColor(@ColorRes id: Int): Int {
return ContextCompat.getColor(AbsMogoApplication.getApp(),id)
}
@JvmStatic
fun getString(@StringRes id: Int): String {
return AbsMogoApplication.getApp().getString(id)
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--可以启动自驾不在自驾中-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/common_autopilot_press">
</item>
<item android:drawable="@drawable/common_autopilot_able">
</item>
</selector>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--在自驾中-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/common_autopilot_in_autopilot">
</item>
<item android:drawable="@drawable/common_autopilot_in_autopilot">
</item>
</selector>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--在自驾中-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/common_autopilot_press">
</item>
<item android:drawable="@drawable/common_autopilot_start_fail">
</item>
</selector>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--在自驾中-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/common_autopilot_press">
</item>
<item android:drawable="@drawable/common_autopilot_start_success">
</item>
</selector>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--在自驾中-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/common_autopilot_press">
</item>
<item android:drawable="@drawable/common_autopilot_starting">
</item>
</selector>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--不可启动自驾-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/common_autopilot_unable">
</item>
<item android:drawable="@drawable/common_autopilot_press">
</item>
</selector>

View File

@@ -19,8 +19,10 @@ project.dependencies {
implementation project.project(':OCH:shuttle:passenger')
} else if (isCurrentDriver("M1")) {
implementation project.project(':OCH:charter:driver')
implementation project.project(':OCH:shuttle:driver')
} else if (isCurrentPassenger("M1")) {
implementation project.project(':OCH:charter:passenger')
implementation project.project(':OCH:shuttle:passenger')
} else if (isCurrentDriver("B2")) {
implementation project.project(':OCH:shuttle:driver')
implementation project.project(':OCH:bus:driver')

View File

@@ -16,10 +16,9 @@ import com.mogo.eagle.core.function.hmi.ui.setting.SopView
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.common.module.biz.lansocket.LoginLanDriverSocket
import com.mogo.och.common.module.biz.lansocket.LoginLanPassengerSocket
import com.mogo.och.common.module.constant.OchCommonConst
import com.mogo.och.common.module.biz.login.BusinessEnum
import com.mogo.och.common.module.biz.login.ILoginCallback
@@ -72,7 +71,7 @@ abstract class FacadeProvider : IMoGoFunctionProvider, ILoginCallback {
if (supportFragmentManager != null) {
val back = supportFragmentManager.beginTransaction()
back.replace(containerId, fragment, fragment.tag)
back.commit()
back.commitAllowingStateLoss()
}
}
@@ -191,11 +190,13 @@ abstract class FacadeProvider : IMoGoFunctionProvider, ILoginCallback {
return
}
}
CallerLogger.d(TAG,"添加statusBar---${commonService}")
decorView.addView(statusBarView, statusBarLP)
}
}
private fun removeStatusBar(){
activity?.let {
CallerLogger.d(TAG,"移除statusBar")
val decorView = it.window.decorView as? FrameLayout ?: return
val statusBar = decorView.findViewWithTag<View>("status_bar")
statusBar?.let {

View File

@@ -44,6 +44,7 @@ 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.common.module.utils.ResourcesUtils;
import com.mogo.och.shuttle.R;
import com.mogo.och.shuttle.view.BizMapView;
import com.mogo.och.data.bean.BusRoutesResult;
@@ -161,7 +162,7 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
initListener();
setAutopilotBtnStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState(),
CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
ctvAutopilotStatus.setOnClickListener(new OnPreventFastClickListener() {
@Override
@@ -391,34 +392,34 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
public void setAutopilotBtnStatus(int autopilotStatus,boolean canStartAuto) {
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE == autopilotStatus) {//0不可用
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_disable));
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_runnig_tv));
ctvAutopilotStatusTv.setTextColor(ResourcesUtils.getColor(R.color.bus_autopilot_text_color_disable));
ctvAutopilotStatusTv.setText(ResourcesUtils.getString(R.string.bus_loading_autopilot_runnig_tv));
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_disable_autopilot_icon);
ctvAutopilotStatus.setClickable(true);
ctvAutopilotStatus.setBackgroundResource(R.drawable.start_failure);
ctvAutopilotStatus.setBackgroundResource(R.drawable.common_autopilot_start_fail);
} else {
ctvAutopilotStatusTv.setTextColor(AbsMogoApplication.getApp().getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_ic_autopilot);
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == autopilotStatus) { //1可用
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_runnig_tv));
ctvAutopilotStatusTv.setText(ResourcesUtils.getString(R.string.bus_loading_autopilot_runnig_tv));
if(canStartAuto){
ctvAutopilotStatus.setClickable(true);
ctvAutopilotStatus.setBackgroundResource(R.drawable.press_start_status);
ctvAutopilotStatus.setBackgroundResource(R.drawable.common_autopilot_press);
}else {
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_disable));
ctvAutopilotStatusTv.setTextColor(ResourcesUtils.getColor(R.color.bus_autopilot_text_color_disable));
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_disable_autopilot_icon);
ctvAutopilotStatus.setClickable(true);
ctvAutopilotStatus.setBackgroundResource(R.drawable.start_failure);
ctvAutopilotStatus.setBackgroundResource(R.drawable.common_autopilot_start_fail);
}
} else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == autopilotStatus) {
ctvAutopilotStatusTv.setText(R.string.bus_loading_autopilot_runnig_tv);
ctvAutopilotStatus.setClickable(true);
ctvAutopilotStatus.setBackgroundResource(R.drawable.start_success);
ctvAutopilotStatus.setBackgroundResource(R.drawable.common_autopilot_in_autopilot);
} else if (IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING
== autopilotStatus){
ctvAutopilotStatusTv.setText(R.string.bus_pingxing_driver);
ctvAutopilotStatus.setClickable(false);
ctvAutopilotStatus.setBackgroundResource(R.drawable.pingxingjiashi);
ctvAutopilotStatus.setBackgroundResource(R.drawable.common_autopilot_pxjs);
}
}
}
@@ -427,21 +428,21 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
== autopilotStatus) {//2 running
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_right_autopilot_icon);
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_success_tv));
ctvAutopilotStatusTv.setTextColor(ResourcesUtils.getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusTv.setText(ResourcesUtils.getString(R.string.bus_loading_autopilot_success_tv));
// ctvAutopilotStatus.setSelected(false);
ctvAutopilotStatus.setClickable(false);
} else {
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_wrong_autopilot_icon);
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_failure_tv));
ctvAutopilotStatusTv.setTextColor(ResourcesUtils.getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusTv.setText(ResourcesUtils.getString(R.string.bus_loading_autopilot_failure_tv));
ctvAutopilotStatus.setClickable(false);
// ctvAutopilotStatus.setSelected(false);
}
UiThreadHandler.postDelayed(new Runnable() {
@Override
public void run() {
setAutopilotBtnStatus(autopilotStatus,CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
setAutopilotBtnStatus(autopilotStatus,CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
}, 1000);
}
@@ -505,8 +506,8 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
*/
public void startAutopilotAnimation() {
isAnimateRunning = true;
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_tv));
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusTv.setText(ResourcesUtils.getString(R.string.bus_loading_autopilot_tv));
ctvAutopilotStatusTv.setTextColor(ResourcesUtils.getColor(R.color.bus_autopilot_text_color_normal));
// ctvAutopilotStatus.setSelected(false);
ctvAutopilotStatus.setClickable(true);
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_loading_autopilot_icon);

View File

@@ -29,6 +29,7 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.overlay.IMoGoOverlayManager;
import com.mogo.map.overlay.core.Level;
import com.mogo.map.overlay.point.Point;
import com.mogo.och.common.module.utils.ResourcesUtils;
import com.mogo.och.shuttle.R;
import com.mogo.och.data.bean.BusStationBean;
import com.mogo.och.shuttle.constant.BusConst;
@@ -85,6 +86,14 @@ public class ShuttleFragment extends BaseShuttleTabFragment<ShuttleFragment, Bus
}
@Override
public void onDestroyView() {
if (mPresenter != null) {
mPresenter.onDestroy(this);
}
IMoGoOverlayManager overlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
if(overlayManager!=null) {
overlayManager.removeAllLines();
overlayManager.removeAllPoints();
}
super.onDestroyView();
}
@@ -277,23 +286,23 @@ public class ShuttleFragment extends BaseShuttleTabFragment<ShuttleFragment, Bus
if (arrivingOrArrivedIndex == 0 || arrivingOrArrivedIndex -1 == 0
|| (arrivingOrArrivedIndex -2 == 0 && stationList.size() == 3)){
firstStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_start));
firstStationItem.setStationTag(ResourcesUtils.getString(R.string.bus_station_txt_tag_start));
}else {
firstStationItem.setStationTag("");
}
if (arrivingOrArrivedIndex + 1 == stationList.size() - 1 || arrivingOrArrivedIndex == stationList.size() - 1
|| (arrivingOrArrivedIndex == 0 && arrivingOrArrivedIndex + 2 == stationList.size() - 1)){ //确认是否显示 "终"
thirdStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_end));
thirdStationItem.setStationTag(ResourcesUtils.getString(R.string.bus_station_txt_tag_end));
}else {
thirdStationItem.setStationTag("");
}
//圆点: 0:灰色 过站 1绿色 到站或者即将到站 2蓝色未到站
if (arrivingOrArrivedIndex == 0 && isArrived){
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
secondStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color));
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color));
firstStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_line_station_color_selected));
secondStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_arrived_station_name_text_color));
thirdStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_arrived_station_name_text_color));
firstStationItem.setStationName(stationList.get(0).getName());
secondStationItem.setStationName(stationList.get(1).getName());
@@ -307,9 +316,9 @@ public class ShuttleFragment extends BaseShuttleTabFragment<ShuttleFragment, Bus
secondStationItem.setStationArrowBg(2);
}else if (arrivingOrArrivedIndex == stationList.size() - 1){
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color));
secondStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color));
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
firstStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_station_tag_txt_un_color));
secondStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_station_tag_txt_un_color));
thirdStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_line_station_color_selected));
firstStationItem.setStationName(stationList.get(arrivingOrArrivedIndex -2).getName());
secondStationItem.setStationName(stationList.get(arrivingOrArrivedIndex -1).getName());
@@ -327,9 +336,9 @@ public class ShuttleFragment extends BaseShuttleTabFragment<ShuttleFragment, Bus
}
}else {
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color));
secondStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color));
firstStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_station_tag_txt_un_color));
secondStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_line_station_color_selected));
thirdStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_arrived_station_name_text_color));
firstStationItem.setStationName(stationList.get(arrivingOrArrivedIndex -1).getName());
secondStationItem.setStationName(stationList.get(arrivingOrArrivedIndex).getName());
@@ -363,23 +372,23 @@ public class ShuttleFragment extends BaseShuttleTabFragment<ShuttleFragment, Bus
secondStationItem.showOrHideStationArrowBg(false);
thirdStationItem.showOrHideStationArrowBg(false);
firstStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_start));
thirdStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_end));
firstStationItem.setStationTag(ResourcesUtils.getString(R.string.bus_station_txt_tag_start));
thirdStationItem.setStationTag(ResourcesUtils.getString(R.string.bus_station_txt_tag_end));
firstStationItem.setStationName(stationList.get(0).getName());
thirdStationItem.setStationName(stationList.get(1).getName());
//圆点: 0:灰色 过站 1绿色 到站或者即将到站 2蓝色未到站
if (arrivingOrArrivedIndex == 0 && isArrived){//到站
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color));
firstStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_line_station_color_selected));
thirdStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_arrived_station_name_text_color));
firstStationItem.setStationPointBg(1);
firstStationItem.setStationArrowBg(2);
thirdStationItem.setStationPointBg(0);
}else {
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color));
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
firstStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_station_tag_txt_un_color));
thirdStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_line_station_color_selected));
if (isArrived){ //到终点
firstStationItem.setStationPointBg(0);
firstStationItem.setStationArrowBg(0);
@@ -396,10 +405,10 @@ public class ShuttleFragment extends BaseShuttleTabFragment<ShuttleFragment, Bus
private void showOrHideSwitchLineBtn(boolean isShow) {
if (isShow){//显示切换路线
mSwitchLine.setTag(0);
mSwitchLine.setText(getResources().getString(R.string.bus_switch_line_btn));
mSwitchLine.setText(ResourcesUtils.getString(R.string.bus_switch_line_btn));
}else {//显示结束路线
mSwitchLine.setTag(1);
mSwitchLine.setText(getResources().getString(R.string.bus_close_line_btn));
mSwitchLine.setText(ResourcesUtils.getString(R.string.bus_close_line_btn));
}
}
@@ -510,7 +519,7 @@ public class ShuttleFragment extends BaseShuttleTabFragment<ShuttleFragment, Bus
//本次行程未结束不支持切换路线。点击则toast提示当前行程未完成不可切换路线
if (CallerAutoPilotStatusListenerManager.INSTANCE.getState()
== IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
ToastUtils.showLong(getResources().getString(R.string.bus_switch_line_btn_warning1));
ToastUtils.showLong(ResourcesUtils.getString(R.string.bus_switch_line_btn_warning1));
return;
}
if ((int)mSwitchLine.getTag() == 0){//切换路线

View File

@@ -21,7 +21,9 @@ 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.utilcode.util.StringUtils;
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager;
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager;
import com.mogo.och.common.module.manager.socket.lan.LanSocketManager;
import com.mogo.och.shuttle.bean.BusRoutesResponse;
import com.mogo.och.shuttle.util.ShuttleVoiceManager;
@@ -501,6 +503,7 @@ public class OrderModel {
removeTipRunnables();
// 取消自驾
CallerAutoPilotControlManager.INSTANCE.cancelAutoPilot();
setTrajectoryStation(null,null,-1L);
}
}
@@ -618,7 +621,7 @@ public class OrderModel {
* @param isRestart
*/
private void startAutopilot(boolean isRestart, int leaveIndex) {
//1、判断轨迹url是否可用
if(busRoutesResult!=null){
//根据开关和后台是否发布轨迹启动自驾
if (FunctionBuildConfig.isPassStartAutopilotCommand
@@ -634,7 +637,32 @@ public class OrderModel {
return;
}
}
//2、6个条件判断
if (!CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(true,0)) {
return;
}
// 3、距离轨迹15m计算
//3、距离轨迹15m计算
String resion = TrajectoryAndDistanceManager.INSTANCE.canStartAutopilot((long)busRoutesResult.getLineId());
if(TrajectoryAndDistanceManager.errorTypeNoneLineId.equals(resion)){
MogoLocation nextStationPoint = new MogoLocation();
if (backgroundCurrentStationIndex < stationList.size() - 1) {
BusStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1);
nextStationPoint.setLongitude(nextStation.getGcjLon());
nextStationPoint.setLatitude(nextStation.getGcjLat());
}
BusStationBean busStationBean = stationList.get(backgroundCurrentStationIndex);
MogoLocation currentStationPoint = new MogoLocation();
currentStationPoint.setLongitude(busStationBean.getGcjLon());
currentStationPoint.setLatitude(busStationBean.getGcjLat());
setTrajectoryStation(currentStationPoint,nextStationPoint, (long) busRoutesResult.getLineId());
resion = TrajectoryAndDistanceManager.INSTANCE.canStartAutopilot((long)busRoutesResult.getLineId());
}
if(!StringUtils.isEmpty(resion)){
ToastUtils.showShort(resion);
return;
}
//4、ssm 给出数据
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()) {
ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() +
", 请稍候重试");
@@ -642,10 +670,6 @@ public class OrderModel {
return;
}
if (!CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(true)) {
return;
}
firstStartAutopilot++;
triggerStartServiceEvent(isRestart, false);
@@ -792,9 +816,13 @@ public class OrderModel {
CallerLogger.d(M_BUS + TAG, "leaveStation-backgroundCurrentStationIndex = " + backgroundCurrentStationIndex);
String nextStationName = "";
String nextStationNameKr = "";
MogoLocation nextStationPoint = new MogoLocation();
if (backgroundCurrentStationIndex < stationList.size() - 1) {
nextStationName = stationList.get(backgroundCurrentStationIndex + 1).getName();
nextStationNameKr = stationList.get(backgroundCurrentStationIndex + 1).getNameKr();
BusStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1);
nextStationName = nextStation.getName();
nextStationNameKr = nextStation.getNameKr();
nextStationPoint.setLongitude(nextStation.getGcjLon());
nextStationPoint.setLatitude(nextStation.getGcjLat());
}
final String currentStationName = stationList.get(backgroundCurrentStationIndex).getName();
String finalNextStationName = nextStationName;
@@ -806,6 +834,13 @@ public class OrderModel {
long writeVersion = DateTimeUtil.getCurrentTimeStamp();
leaveStationSuccess(backgroundCurrentStationIndex, currentStationName,
finalNextStationName,finalNextStationNameKr,writeVersion);
BusStationBean busStationBean = stationList.get(backgroundCurrentStationIndex);
MogoLocation currentStationPoint = new MogoLocation();
currentStationPoint.setLongitude(busStationBean.getGcjLon());
currentStationPoint.setLatitude(busStationBean.getGcjLat());
setTrajectoryStation(currentStationPoint,nextStationPoint, (long) busRoutesResult.getLineId());
String changeInfo = "taskId:" + busRoutesResult.getTaskId() + "--lineId:" + busRoutesResult.getLineId() +
"--currentStationName:"+currentStationName+"--finalNextStationName:"+finalNextStationName;
OchChainLogManager.writeChainLog("滑动出发", changeInfo,
@@ -1053,7 +1088,7 @@ public class OrderModel {
}
CallerLogger.d(M_BUS + TAG, "单程结束====");
CallerAutoPilotControlManager.INSTANCE.cancelAutoPilot();
setTrajectoryStation(null,null,-1L);
endTask();
}
@@ -1244,4 +1279,8 @@ public class OrderModel {
return parameters;
}
public void setTrajectoryStation(MogoLocation startStation,MogoLocation endStation,Long lineId){
TrajectoryAndDistanceManager.INSTANCE.setStationPoint(startStation,endStation,lineId);
}
}

View File

@@ -56,13 +56,27 @@ public class BusLinePresenter extends Presenter<BusSwitchLineView> implements IB
@Override
public void onBusLinesChange(BusQueryLinesResponse lines) {
runOnUIThread(() -> mView.onBusLinesChange(lines));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onBusLinesChange(lines);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onChangeLineIdSuccess() {
OrderModel.getInstance().clearBusStationDatas();
runOnUIThread(() -> mView.onChangeLineIdSuccess());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onChangeLineIdSuccess();
}
}
}, UiThreadHandler.MODE.QUEUE);
}
public void queryBusLines(){
@@ -105,6 +119,8 @@ public class BusLinePresenter extends Presenter<BusSwitchLineView> implements IB
@Override
public void onBusLineTasks(BusQueryLineTaskResponse o, int position,boolean autoRefresh) {
mView.onBusLineTasks(o,position,autoRefresh);
if(mView!=null) {
mView.onBusLineTasks(o,position,autoRefresh);
}
}
}

View File

@@ -131,20 +131,40 @@ public class BusPresenter extends Presenter<ShuttleFragment>
mCurrentStation = arrivingOrArrivedIndex -1;
}
CallerLogger.d(M_BUS + "BusOrderModel =", " mCurrentStation =" + mCurrentStation);
if (mView != null) {
runOnUIThread(() -> mView.updateBusTaskStatus(lineName,lineTime,
stationList, arrivingOrArrivedIndex, isArrived));
}
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.updateBusTaskStatus(lineName,lineTime,
stationList, arrivingOrArrivedIndex, isArrived);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void updateEmptyUi() {
runOnUIThread(() -> mView.updateLineEmptyUI());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.updateLineEmptyUI();
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void clearBusStationsMarkers() {
runOnUIThread(() -> mView.clearBusStationsMarkers());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.clearBusStationsMarkers();
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
@@ -181,16 +201,37 @@ public class BusPresenter extends Presenter<ShuttleFragment>
return;
}
// 改变UI自动驾驶状态
runOnUIThread(() -> mView.onAutopilotStatusChanged(state, CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false)));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onAutopilotStatusChanged(state, CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false,0));
}
}
}, UiThreadHandler.MODE.QUEUE);
break;
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING:
OrderModel.getInstance().triggerStartServiceEvent(
OrderModel.getInstance().isRestartAutopilot(), true);
// 改变UI自动驾驶状态
runOnUIThread(() -> mView.onAutopilotStatusChanged(state, CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false)));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onAutopilotStatusChanged(state, CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false,0));
}
}
}, UiThreadHandler.MODE.QUEUE);
break;
default:
runOnUIThread(() -> mView.onAutopilotEnableChange(false));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onAutopilotEnableChange(false);
}
}
}, UiThreadHandler.MODE.QUEUE);
break;
}
}
@@ -205,13 +246,20 @@ public class BusPresenter extends Presenter<ShuttleFragment>
@Override
public void startOpenAutopilot() {
//非美化模式下启动动画
runOnUIThread(() -> mView.startAutopilotAnimation());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.startAutopilotAnimation();
}
}
}, UiThreadHandler.MODE.QUEUE);
//中间站点再次开启自驾时, 自动驾驶状态是2未改变 此次鹰眼底层不再返给业务,需优化按钮动画显示
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
== CallerAutoPilotStatusListenerManager.INSTANCE.getState()){
== CallerAutoPilotStatusListenerManager.INSTANCE.getState()&&mView!=null){
mView.onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(),
CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false,0));
}
}
@@ -250,18 +298,34 @@ public class BusPresenter extends Presenter<ShuttleFragment>
BusTrajectoryManager.getInstance().stopTrajReqLoop();
BusTrajectoryManager.getInstance().stopTrajReqLoop();
clearBusStationsMarkers();
mView.hideSlidePanel();
if(mView!=null) {
mView.hideSlidePanel();
}
OrderModel.getInstance().closeBeautificationMode();
}
}
@Override
public void onStartAdasFailure() {
runOnUIThread(() -> mView.stopAnimAndUpdateBtnStatus());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.stopAnimAndUpdateBtnStatus();
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void canStartAutopilot(boolean canStart) {
runOnUIThread(() -> mView.onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(),canStart));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(),canStart);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
}

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/press_start_status">
<item android:state_pressed="true" android:drawable="@drawable/common_autopilot_press">
</item>
<item android:drawable="@drawable/start_failure">
<item android:drawable="@drawable/common_autopilot_start_fail">
</item>
</selector>

View File

@@ -172,9 +172,11 @@
<RelativeLayout
android:id="@+id/module_mogo_och_autopilot_status"
android:layout_width="@dimen/dp_616"
android:layout_height="@dimen/dp_180"
android:layout_marginStart="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_m_1"
android:layout_height="@dimen/dp_185"
android:layout_marginStart="@dimen/dp_9"
android:layout_marginTop="-31dp"
android:paddingTop="@dimen/dp_27"
android:paddingBottom="@dimen/dp_32"
android:background="@drawable/bus_autopilot_0_1_status_bg"
android:gravity="center"
app:layout_constraintLeft_toLeftOf="parent"
@@ -207,7 +209,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_m_10"
android:layout_marginTop="-27dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_autopilot_status"
app:layout_goneMarginTop="@dimen/module_mogo_och_station_panel_container_margin_top_no_call" />

BIN
OCH/shuttle/passenger/src/main/assets/m2_map_style.data Normal file → Executable file

Binary file not shown.

Binary file not shown.

View File

@@ -38,14 +38,14 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
}
@Override
public void onCreate( @NonNull LifecycleOwner owner ) {
super.onCreate( owner );
CallerLogger.d( M_BUS_P + TAG, "Bus乘客端Presenter onCreate()" );
public void onCreate(@NonNull LifecycleOwner owner) {
super.onCreate(owner);
CallerLogger.d(M_BUS_P + TAG, "Bus乘客端Presenter onCreate()");
}
@Override
public void onDestroy( @NonNull LifecycleOwner owner ) {
super.onDestroy( owner );
public void onDestroy(@NonNull LifecycleOwner owner) {
super.onDestroy(owner);
releaseListeners();
BusPassengerModel.getInstance().release();
@@ -75,41 +75,41 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
@Override
public void onAutopilotEnable() {
if(mView != null) {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.onAutopilotStatusChanged(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE);
}
},UiThreadHandler.MODE.QUEUE);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onAutopilotDisable() {
if(mView != null) {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.onAutopilotStatusChanged(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE);
}
},UiThreadHandler.MODE.QUEUE);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onAutopilotRunning() {
if(mView != null) {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.onAutopilotStatusChanged(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING);
}
},UiThreadHandler.MODE.QUEUE);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
@@ -119,26 +119,26 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
@Override
public void onCarLocationChanged(MogoLocation location) {
if (location != null && mView != null){
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (location != null && mView != null) {
mView.onCarLocationChanged(location);
}
},UiThreadHandler.MODE.QUEUE);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void changeOperationStatus(boolean changeStatus) {
if(mView != null) {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.changeOperationStatus(changeStatus);
}
},UiThreadHandler.MODE.QUEUE);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
@@ -148,62 +148,62 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
@Override
public void updateLineInfo(String lineName) {
if(mView != null) {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.updateLineInfo(lineName);
}
},UiThreadHandler.MODE.QUEUE);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void updateStationsInfo(List<BusStationBean> stations, int currentStationIndex, boolean isArrived) {
if(mView != null) {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.updateStationsInfo(stations, currentStationIndex, isArrived);
}
},UiThreadHandler.MODE.QUEUE);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void showNoTaskView() {
if(mView != null) {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.showNoTaskView();
}
},UiThreadHandler.MODE.QUEUE);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void hideNoTaskView() {
if(mView != null) {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.hideNoTaskView();
}
},UiThreadHandler.MODE.QUEUE);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void routePlanningToNextStationChanged(long meters, long timeInSecond) {
if(mView != null) {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.updateRoutePlanningToNextStation(meters, timeInSecond);
}
},UiThreadHandler.MODE.QUEUE);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override

View File

@@ -18,6 +18,9 @@ import com.elegant.utils.UiThreadHandler;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.commons.storage.SharedPrefsMgr;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.map.overlay.IMoGoOverlayManager;
import com.mogo.och.common.module.utils.ResourcesUtils;
import com.mogo.och.shuttle.passenger.R;
import com.mogo.och.shuttle.passenger.ui.adapter.BusPassengerLineStationsAdapter;
import com.mogo.och.shuttle.passenger.constant.BusPassengerConst;
@@ -81,8 +84,8 @@ public class BusPassengerRouteFragment extends
mSpeedTv = findViewById(R.id.bus_p_speed_tv);
mSpeedTv.setVertrial(true);
mSpeedTv.setmColorList(new int[]{getResources().getColor(R.color.shuttle_p_jl_speed_color_start),
getResources().getColor(R.color.shuttle_p_jl_speed_color_end)});
mSpeedTv.setmColorList(new int[]{ResourcesUtils.getColor(R.color.shuttle_p_jl_speed_color_start),
ResourcesUtils.getColor(R.color.shuttle_p_jl_speed_color_end)});
mNoLineInfoView =findViewById(R.id.bus_p_no_order_data_view);
emptyTv = findViewById(R.id.no_order_data_tv);
@@ -131,6 +134,19 @@ public class BusPassengerRouteFragment extends
}
}
@Override
public void onDestroyView() {
if (mPresenter != null) {
mPresenter.onDestroy(this);
}
IMoGoOverlayManager overlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
if(overlayManager!=null) {
overlayManager.removeAllLines();
overlayManager.removeAllPoints();
}
super.onDestroyView();
}
@Override
public void onDestroy() {
super.onDestroy();
@@ -280,26 +296,26 @@ public class BusPassengerRouteFragment extends
public void updateArrivedStation(String station,int currentIndex,boolean isArrived){
if (null == station){
mCurrentArriveStation.setText("----");
mCurrentArriveStationTitle.setText(getResources().getString(R.string.shuttle_p_jl_cur_station_title));
mCurrentArriveTip.setText(getResources().getString(R.string.shuttle_p_jl_cur_station_arrived_tip));
mCurrentArriveStationTitle.setText(ResourcesUtils.getString(R.string.shuttle_p_jl_cur_station_title));
mCurrentArriveTip.setText(ResourcesUtils.getString(R.string.shuttle_p_jl_cur_station_arrived_tip));
mCurrentArriveTip.setBackgroundResource(R.drawable.shuttle_p_jl_cur_station_arrived_bg);
handleArrivingSpeakIconDrawable();
}else {
mCurrentArriveStation.setText(station);
if (currentIndex == 0){
mCurrentArriveStationTitle.setText(getResources().getString(R.string.shuttle_p_jl_cur_station_title));
mCurrentArriveTip.setText(getResources().getString(R.string.shuttle_p_jl_cur_station_arrived_tip));
mCurrentArriveStationTitle.setText(ResourcesUtils.getString(R.string.shuttle_p_jl_cur_station_title));
mCurrentArriveTip.setText(ResourcesUtils.getString(R.string.shuttle_p_jl_cur_station_arrived_tip));
mCurrentArriveTip.setBackgroundResource(R.drawable.shuttle_p_jl_cur_station_arrived_bg);
handleArrivingSpeakIconDrawable();
return;
}
if (isArrived){
mCurrentArriveStationTitle.setText(getResources().getString(R.string.shuttle_p_jl_cur_station_title));
mCurrentArriveTip.setText(getResources().getString(R.string.shuttle_p_jl_cur_station_arrived_tip));
mCurrentArriveStationTitle.setText(ResourcesUtils.getString(R.string.shuttle_p_jl_cur_station_title));
mCurrentArriveTip.setText(ResourcesUtils.getString(R.string.shuttle_p_jl_cur_station_arrived_tip));
mCurrentArriveTip.setBackgroundResource(R.drawable.shuttle_p_jl_cur_station_arrived_bg);
handleArrivedSpeakIconDrawable();
}else {
mCurrentArriveStationTitle.setText(getResources().getString(R.string.shuttle_p_jl_cur_next_station_title));
mCurrentArriveStationTitle.setText(ResourcesUtils.getString(R.string.shuttle_p_jl_cur_next_station_title));
mCurrentArriveTip.setBackgroundResource(R.drawable.shuttle_p_jl_cur_station_un_arrived_bg);
handleArrivingSpeakIconDrawable();
}

View File

@@ -126,6 +126,9 @@ class PM2DrivingInfoFragment :
override fun onDestroyView() {
overMapView?.onDestroy()
if (mPresenter != null) {
mPresenter?.onDestroy(this)
}
super.onDestroyView()
}

View File

@@ -2,7 +2,7 @@ package com.mogo.och.shuttle.passenger.ui
import android.os.Bundle
import com.mogo.commons.mvp.MvpFragment
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getOverlayManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.map.overlay.core.Level
import com.mogo.map.overlay.point.Point
@@ -64,6 +64,10 @@ class PM2HPMapFragment :
override fun onDestroyView() {
mapBizView.onDestroy()
CallerMapUIServiceManager.getOverlayManager()?.let {
it.removeAllLines()
it.removeAllPoints()
}
super.onDestroyView()
}
@@ -106,7 +110,7 @@ class PM2HPMapFragment :
builder.rotate(it.angle.toFloat())
}
}
val overlayManager = getOverlayManager()
val overlayManager = CallerMapUIServiceManager.getOverlayManager()
overlayManager?.showOrUpdatePoint(builder.build())
}
OCHThreadPoolManager.getsInstance().execute(setMapMarkerRunnable)
@@ -118,7 +122,7 @@ class PM2HPMapFragment :
//开启线程移除起终点marker设置
val removeMapMarkerRunnable = Runnable {
d("RemoveMapMaker=" + Thread.currentThread().name, uuid)
val overlayManager = getOverlayManager()
val overlayManager = CallerMapUIServiceManager.getOverlayManager()
overlayManager?.removeAllPointsInOwner(TYPE_MARKER_M2_LINE)
}
OCHThreadPoolManager.getsInstance().execute(removeMapMarkerRunnable)

View File

@@ -857,7 +857,7 @@ public class TaxiModel {
CallerLogger.d(M_TAXI + TAG, "setIPCDemoModefalse");
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false);
if (mADASStatusCallback != null) {
mADASStatusCallback.updateAutopilotStatus(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
mADASStatusCallback.updateAutopilotStatus(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
}
@@ -925,7 +925,7 @@ public class TaxiModel {
return;
}
//根据开关和后台是否发布轨迹启动自驾
//1、判断轨迹url是否可用
if (FunctionBuildConfig.isPassStartAutopilotCommand
&& TextUtils.isEmpty(mCurrentOCHOrder.csvFileUrl)
&& TextUtils.isEmpty(mCurrentOCHOrder.csvFileUrlDPQP)
@@ -937,18 +937,12 @@ public class TaxiModel {
+ "busRoutesResult.csvFileUrlDPQP = " + mCurrentOCHOrder.csvFileUrlDPQP);
return;
}
if (!CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(true)) {
//2、6个条件判断
if (!CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(true, 0)) {
return;
}
if(CallerAutoPilotStatusListenerManager.INSTANCE.getState()
== IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
ToastUtils.showShort("自驾中、请勿重复启动");
return;
}
//3、距离轨迹15m计算
String resion = TrajectoryAndDistanceManager.INSTANCE.canStartAutopilot(mCurrentOCHOrder.lineId);
if(TrajectoryAndDistanceManager.errorTypeNoneLineId.equals(resion)){
setStation();
@@ -961,7 +955,7 @@ public class TaxiModel {
CallerLogger.e(M_TAXI + TAG, "isPassStartAutopilotCommand = " +
FunctionBuildConfig.isPassStartAutopilotCommand);
//4、ssm 给出数据
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()) {
ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() +
", 请稍候重试");
@@ -970,6 +964,11 @@ public class TaxiModel {
OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason());
return;
}
if(CallerAutoPilotStatusListenerManager.INSTANCE.getState()
== IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
ToastUtils.showShort("自驾中、请勿重复启动");
return;
}
//点击开始自动驾驶按钮订单状态去流转, 不再与自动驾驶是否启动成功挂钩
if (mCurrentOCHOrder.orderStatus == TaxiOrderStatusEnum.UserArriveAtStart.getCode()) {
@@ -1227,7 +1226,7 @@ public class TaxiModel {
public void onAutopilotStatusResponse(int state) {
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
if (mADASStatusCallback != null) {
mADASStatusCallback.onAutopilotRunning(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
mADASStatusCallback.onAutopilotRunning(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
if (mCurrentOCHOrder != null
&& TaxiOrderStatusEnum.OnTheWayToEnd.getCode() == mCurrentOCHOrder.orderStatus) {
@@ -1250,7 +1249,7 @@ public class TaxiModel {
return;
}
if (mADASStatusCallback != null) {
mADASStatusCallback.onAutopilotEnable(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
mADASStatusCallback.onAutopilotEnable(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) {
if (FunctionBuildConfig.isDemoMode
@@ -1261,7 +1260,7 @@ public class TaxiModel {
return;
}
if (mADASStatusCallback != null) {
mADASStatusCallback.onAutopilotDisable(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
mADASStatusCallback.onAutopilotDisable(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
} else if (state == IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING) {
if (FunctionBuildConfig.isDemoMode) {
@@ -1271,13 +1270,13 @@ public class TaxiModel {
// 当美化模式演示模式开启时且有订单、且为去往目的地状态维持自动驾驶icon开启状态
} else { //美化模式下没订单,显示人工驾驶
if (mADASStatusCallback != null) {
mADASStatusCallback.onAutopilotDisable(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
mADASStatusCallback.onAutopilotDisable(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
}
return;
}
if (mADASStatusCallback != null) {
mADASStatusCallback.onManMachineCoDriving(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
mADASStatusCallback.onManMachineCoDriving(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
}
}

View File

@@ -42,12 +42,26 @@ public class TaxiOperationalPresenter extends Presenter<TaxiPersonalDialogFragme
@Override
public void onServiceDataUpdate(long dailyTimeDuration, long dailyOrderNum) {
runOnUIThread(() -> mView.onServiceDataUpdate(dailyTimeDuration,dailyOrderNum));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onServiceDataUpdate(dailyTimeDuration,dailyOrderNum);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onOrdersListPageRefresh(List<OrderQueryRespBean.Result> ordersList) {
runOnUIThread(() -> mView.onOrdersListPageRefresh(ordersList));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onOrdersListPageRefresh(ordersList);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
private void runOnUIThread( Runnable executor ) {

View File

@@ -189,37 +189,79 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
@Override
public void onAutopilotEnable(boolean canStartAuto) {
runOnUIThread(() -> mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE,canStartAuto));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE,canStartAuto);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onAutopilotDisable(boolean canStartAuto) {
runOnUIThread(() -> mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE,canStartAuto));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE,canStartAuto);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onAutopilotRunning(boolean canStartAuto) {
runOnUIThread(() -> mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING,canStartAuto));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING,canStartAuto);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onManMachineCoDriving(boolean canStartAuto) {
runOnUIThread(() -> mView.onManMachineCoDriving(IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING,canStartAuto));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onManMachineCoDriving(IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING,canStartAuto);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void updateAutopilotStatus(boolean canStartAuto) {
runOnUIThread(() -> mView.updateAutopilotStatus(
CallerAutoPilotStatusListenerManager.INSTANCE.getState(),canStartAuto));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.updateAutopilotStatus(
CallerAutoPilotStatusListenerManager.INSTANCE.getState(),canStartAuto);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onStartAdasFailure() {
runOnUIThread(() -> mView.stopAnimAndUpdateBtnStatus());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.stopAnimAndUpdateBtnStatus();
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
@@ -229,7 +271,14 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
@Override
public void onOrdersWaitServiceChanged(@NonNull @NotNull List<OrderQueryRespBean.Result> waitServiceList) {
runOnUIThread(() -> mView.onOrdersWaitServiceChanged(waitServiceList));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onOrdersWaitServiceChanged(waitServiceList);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@RequiresApi(api = Build.VERSION_CODES.P)
@@ -244,10 +293,15 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
if (TaxiOrderStatusEnum.OnTheWayToEnd.getCode() == order.orderStatus) {
TaxiModel.getInstance().startDynamicCalculateRouteInfo();
TaxiModel.getInstance().setStation();
runOnUIThread(() -> {
mView.updateCtvAutopilotStatusTag(true);
CallerOrderListenerManager.INSTANCE.invokeOrderStatus(true);
});
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.updateCtvAutopilotStatusTag(true);
CallerOrderListenerManager.INSTANCE.invokeOrderStatus(true);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@@ -257,36 +311,69 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
TaxiModel.getInstance().startOrStopCalculateRouteInfo(false);
TaxiModel.getInstance().cleanLineMarker();
TaxiModel.getInstance().cleanStation();
runOnUIThread(() -> {
/** 2023.12.18 1.去除"自驾/安全"模式选择,默认自驾模式且无需点击;
* 2.server去除订单流转对"安全确认"的限制读写接口默认反馈ok但"开启自动驾驶成功"不再限制)
*/
mView.updateCtvAutopilotStatusTag(false);
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
/** 2023.12.18 1.去除"自驾/安全"模式选择,默认自驾模式且无需点击;
* 2.server去除订单流转对"安全确认"的限制读写接口默认反馈ok但"开启自动驾驶成功"不再限制)
*/
mView.updateCtvAutopilotStatusTag(false);
if (TaxiOrderStatusEnum.ArriveAtEnd.getCode() == order.orderStatus) {
CallerOrderListenerManager.INSTANCE.invokeOrderStatus(false);
if (TaxiOrderStatusEnum.ArriveAtEnd.getCode() == order.orderStatus) {
CallerOrderListenerManager.INSTANCE.invokeOrderStatus(false);
}
}
}
});
}, UiThreadHandler.MODE.QUEUE);
}
if (TaxiOrderStatusEnum.Cancel.getCode() == order.orderStatus) {
VoiceNotice.showNotice("乘客已取消行程");
}
runOnUIThread(() -> mView.updateCurrentOrderStatusChanged(order));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.updateCurrentOrderStatusChanged(order);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onCurrentOrderCancelDone() {
runOnUIThread(() -> mView.onCurrentOrderCancelDone());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onCurrentOrderCancelDone();
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onOrderCancelDone(String orderNo) {
runOnUIThread(() -> mView.onOrderCancelDone(orderNo));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onOrderCancelDone(orderNo);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onCurrentOrderRouteInfoGot(OrderQueryRouteInfoRespBean.Result routeInfo) {
runOnUIThread(() -> mView.onCurrentOrderRouteInfoGot(routeInfo));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onCurrentOrderRouteInfoGot(routeInfo);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
@@ -295,44 +382,98 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
@Override
public void onCurrentOrderDistToEndChanged(long meters, long timeInSecond) {
runOnUIThread(() -> mView.onCurrentOrderDistToEndChanged(meters, timeInSecond));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onCurrentOrderDistToEndChanged(meters, timeInSecond);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onNewBookingOrderGot(OrderQueryRespBean.Result order) {
runOnUIThread(() -> mView.onNewBookingOrderGot(order));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onNewBookingOrderGot(order);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onGrabOrderExecuteDone() {
runOnUIThread(() -> mView.onGrabOrderExecuteDone());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onGrabOrderExecuteDone();
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onGrabOrderSuccess(OrderQueryRespBean.Result order) {
runOnUIThread(() -> mView.onGrabOrderSuccess(order));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onGrabOrderSuccess(order);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onGrabOrderFailed(OrderQueryRespBean.Result order) {
runOnUIThread(() -> mView.onGrabOrderFailed(order));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onGrabOrderFailed(order);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onDriverHasCheckedPilotCondition() {
runOnUIThread(() -> mView.onCheckPilotConditionSafe());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onCheckPilotConditionSafe();
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onNaviToEnd(boolean isAmap, boolean isShow) {
runOnUIThread(() -> mView.onNaviToEnd(isAmap, isShow));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onNaviToEnd(isAmap, isShow);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void startOpenAutopilot() {
runOnUIThread(() -> {
mView.startOrStopLoadingAnim(true);
});
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.startOrStopLoadingAnim(true);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
@@ -347,15 +488,25 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
role = TaxiConst.TEST_USER;
}
String finalRole = role;
runOnUIThread(() -> {
mView.setRole(finalRole);
});
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.setRole(finalRole);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onOpenOrderStatusEnumChange(OpenOrderStatusEnum businessEnum) {
runOnUIThread(() -> {
mView.updateOperationStatus(LoginStatusManager.getOpenOrderType());
});
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.updateOperationStatus(LoginStatusManager.getOpenOrderType());
}
}
}, UiThreadHandler.MODE.QUEUE);
}
}

View File

@@ -43,6 +43,7 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.och.common.module.utils.ResourcesUtils;
import com.mogo.och.taxi.R;
@@ -161,7 +162,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING) {
return; //远程代驾状态下不可开启自动驾驶,只能等远程代驾主动退出
} else if (!(boolean) ctvAutopilotStatusRL.getTag()) {
ToastUtils.showShort(getResources().getString(R.string.module_och_taxi_auto_disable_tip1));
ToastUtils.showShort(ResourcesUtils.getString(R.string.module_och_taxi_auto_disable_tip1));
} else {
startAutopilot();
}
@@ -178,7 +179,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
return false;
});
onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
// 模拟 不可自动驾驶目前场景是刚开机adas还未和工控机连接
findViewById(R.id.btnAutopilotDisable).setOnClickListener(view ->
@@ -336,31 +337,31 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
public void autopilotStatusAnimchanged(int status,boolean canStart) {
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status) {
mAutopilotTv.setText("自动驾驶");
mAutopilotTv.setTextColor(getResources().getColor(R.color.taxi_autopilot_text_color_normal));
mAutopilotTv.setTextColor(ResourcesUtils.getColor(R.color.taxi_autopilot_text_color_normal));
mAutopilotImage.setImageResource(R.drawable.taxi_ic_autopilot);
ctvAutopilotStatusRL.setBackgroundResource(R.drawable.taxi_autopilot_success);
ctvAutopilotStatusRL.setBackgroundResource(R.drawable.common_autopilot_in_autopilot);
} else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == status) {
mAutopilotTv.setText("自动驾驶");
if(canStart){
mAutopilotTv.setTextColor(getResources().getColor(R.color.taxi_autopilot_text_color_normal));
mAutopilotTv.setTextColor(ResourcesUtils.getColor(R.color.taxi_autopilot_text_color_normal));
mAutopilotImage.setImageResource(R.drawable.taxi_ic_autopilot);
ctvAutopilotStatusRL.setBackgroundResource(R.drawable.taxi_ic_autopilot_bg_pressed);
ctvAutopilotStatusRL.setBackgroundResource(R.drawable.common_autopilot_press);
}else {
mAutopilotTv.setTextColor(getResources().getColor(R.color.taxi_autopilot_text_color_disable));
mAutopilotTv.setTextColor(ResourcesUtils.getColor(R.color.taxi_autopilot_text_color_disable));
mAutopilotImage.setImageResource(R.drawable.taxi_ic_autopilot_disable);
ctvAutopilotStatusRL.setBackgroundResource(R.drawable.taxi_ic_autopilot_bg);
ctvAutopilotStatusRL.setBackgroundResource(R.drawable.common_autopilot_press);
}
} else if (IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING == status) {
mAutopilotTv.setText("远程代驾");
mAutopilotTv.setTextColor(getResources().getColor(R.color.taxi_autopilot_text_color_normal));
mAutopilotTv.setTextColor(ResourcesUtils.getColor(R.color.taxi_autopilot_text_color_normal));
mAutopilotImage.setImageResource(R.drawable.taxi_ic_autopilot);
ctvAutopilotStatusRL.setBackgroundResource(R.drawable.taxi_autopilot_pingxjs);
ctvAutopilotStatusRL.setBackgroundResource(R.drawable.common_autopilot_pxjs);
// 平行驾驶
} else {
mAutopilotTv.setText("自动驾驶");
mAutopilotTv.setTextColor(getResources().getColor(R.color.taxi_autopilot_text_color_disable));
mAutopilotTv.setTextColor(ResourcesUtils.getColor(R.color.taxi_autopilot_text_color_disable));
mAutopilotImage.setImageResource(R.drawable.taxi_ic_autopilot_disable);
ctvAutopilotStatusRL.setBackgroundResource(R.drawable.taxi_ic_autopilot_bg);
ctvAutopilotStatusRL.setBackgroundResource(R.drawable.common_autopilot_start_fail);
}
}
@@ -373,18 +374,18 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
}
if (success) {
mAutopilotTv.setText("成功");
mAutopilotTv.setTextColor(getResources().getColor(R.color.taxi_autopilot_text_color_normal));
mAutopilotTv.setTextColor(ResourcesUtils.getColor(R.color.taxi_autopilot_text_color_normal));
mAutopilotImage.setImageResource(R.drawable.taxi_ic_autopilot_success);
} else {
mAutopilotTv.setText("失败");
mAutopilotTv.setTextColor(getResources().getColor(R.color.taxi_autopilot_text_color_normal));
mAutopilotTv.setTextColor(ResourcesUtils.getColor(R.color.taxi_autopilot_text_color_normal));
mAutopilotImage.setImageResource(R.drawable.taxi_ic_autopilot_failed);
}
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
startOrStopLoadingAnim(false);
onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(),CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(),CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
}, 1000L);
}
@@ -396,7 +397,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
if (start) {
isStarting = true;
mAutopilotTv.setText("启动中");
mAutopilotTv.setTextColor(getResources().getColor(R.color.taxi_autopilot_text_color_normal));
mAutopilotTv.setTextColor(ResourcesUtils.getColor(R.color.taxi_autopilot_text_color_normal));
mAutopilotImage.setImageResource(R.drawable.taxi_ic_autopilot_loading);
if (autopilotLoadingAnimator == null) {
autopilotLoadingAnimator = ObjectAnimator.ofFloat(mAutopilotImage,

View File

@@ -34,6 +34,7 @@ import com.mogo.och.common.module.map.ICommonNaviChangedCallback;
import com.mogo.och.common.module.utils.DateTimeUtil;
import com.mogo.och.common.module.utils.NumberFormatUtil;
import com.mogo.och.common.module.utils.OCHThreadPoolManager;
import com.mogo.och.common.module.utils.ResourcesUtils;
import com.mogo.och.common.module.voice.VoiceNotice;
import com.mogo.och.common.module.wigets.OCHCommitDialog;
import com.mogo.och.taxi.R;
@@ -447,7 +448,7 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
mTaxiFragment.confirmAutopilotConditionByDriver();
}else if (TaxiOrderStatusEnum.ArriveAtEnd.getCode() == mCurrentOrder.orderStatus) {//点击了完成服务,结束订单并更新订单信息
mTaxiFragment.completeOrderService();
//VoiceNotice.showNotice(getResources().getString(R.string.module_och_taxi_order_server_completed_tip));
//VoiceNotice.showNotice(ResourcesUtils.getString(R.string.module_och_taxi_order_server_completed_tip));
}else if (TaxiOrderStatusEnum.OnTheWayToEnd.getCode() == mCurrentOrder.orderStatus){//前往目的地过程中可提前结束行程
//自驾中提示,接管后才能结束
if (CallerAutoPilotStatusListenerManager.INSTANCE.getState()
@@ -760,7 +761,7 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
public void updateOrderBottomBtnUI() {
try {
ToastUtils.showLong(getResources().getString(
ToastUtils.showLong(ResourcesUtils.getString(
R.string.module_och_taxi_order_choose_start_autopilot_tip));
showOrHideOrderModeBtn(false);
updateOrderBottomBtn(getString(R.string.module_och_taxi_order_server_wait_passenger_start),

View File

@@ -17,7 +17,9 @@ import androidx.fragment.app.FragmentTransaction;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.eagle.core.data.temp.EventLogout;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.map.overlay.IMoGoOverlayManager;
import com.mogo.och.common.module.biz.login.LoginStatusManager;
import com.mogo.och.common.module.biz.login.OpenOrderStatusEnum;
import com.mogo.och.taxi.R;
@@ -155,8 +157,16 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
@Override
public void onDestroyView() {
super.onDestroyView();
EventBus.getDefault().unregister(this);
if (mPresenter != null) {
mPresenter.onDestroy(this);
}
IMoGoOverlayManager overlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
if(overlayManager!=null) {
overlayManager.removeAllLines();
overlayManager.removeAllPoints();
}
super.onDestroyView();
}
/**

View File

@@ -108,7 +108,7 @@ public class TaxiGrabOrderFragment extends BaseTaxiUIFragment implements View.On
ConstraintLayout.LayoutParams lp = (ConstraintLayout.LayoutParams)mOrderGrabBt.getLayoutParams();
lp.bottomMargin = 3;
mOrderGrabBt.setLayoutParams(lp);
mOrderGrabBt.setBackground(getResources().getDrawable(R.drawable.shape_size_grab_order_bt));
mOrderGrabBt.setBackgroundResource(R.drawable.shape_size_grab_order_bt);
mOrderGrabBt.setText("抢单(10S)"); //开始倒计时任务
countDownTimer = new CountDownTimer(11000,1000){

View File

@@ -23,6 +23,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
@@ -226,7 +227,9 @@ public class TaxiPersonalDialogFragment extends
CallerLogger.d(M_TAXI + TAG,"SelectTv = "+ textView.getText());
textView.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
textView.setTextColor(Color.parseColor("#FFFFFF"));
imageView.setImageDrawable(getResources().getDrawable(R.drawable.taxi_driver_operation_tab_line));
if(getContext()!=null) {
imageView.setImageDrawable(getResources().getDrawable(R.drawable.taxi_driver_operation_tab_line));
}
}else {
textView.setTextSize(TypedValue.COMPLEX_UNIT_PX,AutoSizeUtils.dp2px(getContext(),40));
CallerLogger.d(M_TAXI + TAG,"unSelectTv = "+ textView.getText());

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" tools:ignore="MissingDefaultResource">
<item android:state_pressed="true" android:drawable="@drawable/taxi_ic_autopilot_bg_pressed"/>
<item android:state_pressed="false" android:drawable="@drawable/taxi_ic_autopilot_bg" />
<item android:drawable="@drawable/taxi_ic_autopilot_bg"/>
<item android:state_pressed="true" android:drawable="@drawable/common_autopilot_press"/>
<item android:state_pressed="false" android:drawable="@drawable/common_autopilot_start_fail" />
<item android:drawable="@drawable/common_autopilot_start_fail"/>
</selector>

View File

@@ -35,6 +35,8 @@
android:layout_height="@dimen/dp_180"
android:layout_marginStart="@dimen/dp_10"
android:layout_marginTop="-31dp"
android:paddingTop="@dimen/dp_27"
android:paddingBottom="@dimen/dp_32"
android:gravity="center"
android:background="@drawable/taxi_autopilot_bg_selector"
app:layout_constraintLeft_toLeftOf="parent"

View File

@@ -94,6 +94,7 @@
android:id="@+id/module_och_taxi_order_distance_anchor_2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="264dp"
android:inputType="textMultiLine"
android:lineSpacingExtra="16dp"
android:text="距离 - - 公里,用时 - - 分"
@@ -145,8 +146,7 @@
app:layout_constraintTop_toBottomOf="@+id/taxi_passenger_phone"
app:layout_constraintLeft_toLeftOf="@+id/taxi_passenger_num"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginTop="@dimen/dp_15"
android:background="@color/taxi_passenger_line_color"/>
android:layout_marginTop="@dimen/dp_15" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView

View File

@@ -55,9 +55,7 @@ object AutopilotManager : IOchAutopilotStatusListener {
if (TaxiPassengerModel.currentOCHOrder!!.orderStatus == TaxiPassengerOrderStatusEnum.UserArriveAtStart.code) {
startServicePilotDone()
}
if (!CallerAutoPilotControlManager.isCanStartAutopilot(false)) {
return "启动自动驾驶不满足条件"
}
//1、判断轨迹Id是否可用
TaxiPassengerModel.currentOCHOrder?.let {
//根据开关和后台是否发布轨迹启动自驾
if (FunctionBuildConfig.isPassStartAutopilotCommand
@@ -73,11 +71,11 @@ object AutopilotManager : IOchAutopilotStatusListener {
return "无发布轨迹, 请发布后重试"
}
}
if(CallerAutoPilotStatusListenerManager.getState()
== IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
ToastUtils.showShort("自驾中、请勿重复启动");
return "自驾中、请勿重复启动";
//2、6个条件判断
if (!CallerAutoPilotControlManager.isCanStartAutopilot(false)) {
return "启动自动驾驶不满足条件"
}
//3、距离轨迹15m计算
var resion = TrajectoryAndDistanceManager.canStartAutopilot(TaxiPassengerModel.currentOCHOrder!!.lineId)
if(TrajectoryAndDistanceManager.errorTypeNoneLineId.equals(resion)){
TaxiPassengerModel.setStation();
@@ -87,7 +85,7 @@ object AutopilotManager : IOchAutopilotStatusListener {
ToastUtils.showShort(resion)
return resion
}
// 4、ssm 给出数据
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().autopilotAbilityStatus) {
ToastUtils.showLong(
OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason +
@@ -101,6 +99,12 @@ object AutopilotManager : IOchAutopilotStatusListener {
)
return OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason + ", 请稍候重试"
}
if(CallerAutoPilotStatusListenerManager.getState()
== IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
ToastUtils.showShort("自驾中、请勿重复启动");
return "自驾中、请勿重复启动";
}
val parameters = initAutopilotControlParameters()
if (parameters == null) {
CallerLogger.d(

View File

@@ -12,6 +12,7 @@ import com.mogo.commons.voice.AIAssist
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.function.api.hmi.view.IStatusViewLayout
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_TAXI_P
import com.mogo.eagle.core.utilcode.util.DeviceUtils
@@ -220,6 +221,13 @@ class TaxiPassengerBaseFragment() :
override fun onDestroyView() {
mapBizView!!.onDestroy()
overMapView?.onDestroy()
if (mPresenter != null) {
mPresenter?.onDestroy(this)
}
CallerMapUIServiceManager.getOverlayManager()?.let {
it.removeAllLines()
it.removeAllPoints()
}
super.onDestroyView()
}

View File

@@ -6,7 +6,6 @@ import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.och.common.module.constant.OchCommonConst
import com.mogo.och.common.module.biz.provider.CommonService
import com.mogo.och.common.module.biz.provider.CommonServiceImpl
import com.mogo.och.taxi.ui.base.TaxiFragment

View File

@@ -235,9 +235,6 @@ abstract class BaseTaxiTabFragment<V : IView, P : Presenter<V>> : MvpFragment<V,
}
})
val width = AutoSizeUtils.dp2px(AbsMogoApplication.getApp(), 420f)
val height = AutoSizeUtils.dp2px(AbsMogoApplication.getApp(), 220f)
}
abstract fun stopAutoStartAutopilot()

View File

@@ -11,6 +11,7 @@ import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.module.status.MogoStatusManager
import com.mogo.commons.module.status.StatusDescriptor
import com.mogo.eagle.core.data.temp.EventLogout
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
@@ -49,7 +50,7 @@ class TaxiFragment : BaseTaxiTabFragment<TaxiFragment, TaxiPresenter>(),
private var personalDialogFragment: WeakReference<TaxiOperationalDialogFragment>? = null
private var routingVerifyFragment: WeakReference<TaxiRoutingFragment>? = null
private var moFanglistener: IMogoStatusChangedListener = object :IMogoStatusChangedListener{
private var moFanglistener: IMogoStatusChangedListener? = object :IMogoStatusChangedListener{
override fun onStatusChanged(descriptor: StatusDescriptor?, isTrue: Boolean) {
if (StatusDescriptor.TAXI_UNMANED_DRIVER_LINE_ROUTING_VERIFY_MODE == descriptor) {
UiThreadHandler.post {
@@ -96,6 +97,7 @@ class TaxiFragment : BaseTaxiTabFragment<TaxiFragment, TaxiPresenter>(),
}
override fun onActivityCreated(savedInstanceState: Bundle?) {
e(SceneConstant.M_TAXI + TAG, "onActivityCreated")
super.onActivityCreated(savedInstanceState)
}
@@ -104,6 +106,7 @@ class TaxiFragment : BaseTaxiTabFragment<TaxiFragment, TaxiPresenter>(),
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
e(SceneConstant.M_TAXI + TAG, "onCreateView")
EventBus.getDefault().register(this)
return super.onCreateView(inflater, container, savedInstanceState)
}
@@ -224,12 +227,31 @@ class TaxiFragment : BaseTaxiTabFragment<TaxiFragment, TaxiPresenter>(),
}
override fun onDestroyView() {
e(SceneConstant.M_TAXI + TAG, "onDestroyView")
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG,
StatusDescriptor.TAXI_UNMANED_DRIVER_LINE_ROUTING_VERIFY_MODE,moFanglistener)
if (mPresenter != null) {
mPresenter?.onDestroy(this)
}
CallerMapUIServiceManager.getOverlayManager()?.let {
it.removeAllLines()
it.removeAllPoints()
}
super.onDestroyView()
EventBus.getDefault().unregister(this)
}
override fun onDestroy() {
moFanglistener = null
super.onDestroy()
e(SceneConstant.M_TAXI + TAG, "onDestroy")
}
override fun onDetach() {
super.onDetach()
e(SceneConstant.M_TAXI + TAG, "onDetach")
}
fun setRole(finalRole:String){
if (!TextUtils.isEmpty(finalRole)) {
taxi_driver_role_tv.visibility = View.VISIBLE

View File

@@ -69,17 +69,6 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
LoginStatusManager.INSTANCE.removeListener(TAG);
}
private void runOnUIThread(Runnable executor) {
if (executor == null) {
return;
}
if (Looper.myLooper() != Looper.getMainLooper()) {
UiThreadHandler.post(executor);
} else {
executor.run();
}
}
/**
* 开启自动驾驶 自驾模式
*/
@@ -111,95 +100,179 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
@Override
public void onAutopilotEnable(boolean canStartAuto) {
runOnUIThread(() -> mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE,canStartAuto));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE,canStartAuto);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onAutopilotDisable(boolean canStartAuto) {
runOnUIThread(() -> mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE,canStartAuto));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE,canStartAuto);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onAutopilotRunning(boolean canStartAuto) {
runOnUIThread(() -> mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING,canStartAuto));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING,canStartAuto);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onParallelDrivingStatus(boolean canStartAuto) {
runOnUIThread(() -> mView.onParallelDrivingStatus(IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING,canStartAuto));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onParallelDrivingStatus(IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING,canStartAuto);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onStartAdasFailure() {
runOnUIThread(() -> mView.stopAnimAndUpdateBtnStatus());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.stopAnimAndUpdateBtnStatus();
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void updateAutopilotStatus(boolean canStartAuto) {
mView.updateAutopilotStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState(),canStartAuto);
if(mView!=null) {
mView.updateAutopilotStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), canStartAuto);
}
}
@Override
public void onNaviToEnd(boolean isAmap, boolean isShow) {
runOnUIThread(() -> mView.onNaviToEnd(isAmap, isShow));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
onNaviToEnd(isAmap, isShow);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onVRModeChanged(boolean isVRMode) {
runOnUIThread(() -> mView.switchVRFlatMode(isVRMode));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.switchVRFlatMode(isVRMode);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onCarLocationChanged(MogoLocation location) {
// if (null != location) {
// runOnUIThread(() -> {
// mView.updateSpeedView((float) location.getGnssSpeed());
// });
// }
}
@Override
public void startOpenAutopilot() {
runOnUIThread(() -> {
mView.startOrStopLoadingAnim(true);
});
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.startOrStopLoadingAnim(true);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void startOpenAutopilotNonManual() {
runOnUIThread(() -> {
mView.startOrStopLoadingAnim(true);
mView.showStartAutopilotBlinkAnimation();
});
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.startOrStopLoadingAnim(true);
mView.showStartAutopilotBlinkAnimation();
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void stopOpenAutopilotNonManual(boolean canStartAuto) {
runOnUIThread(() -> {
mView.startOrStopLoadingAnim(false);
mView.updateAutopilotStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState(),canStartAuto);
mView.stopAutopilotBlinkAnimation();
});
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.startOrStopLoadingAnim(false);
mView.updateAutopilotStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState(),canStartAuto);
mView.stopAutopilotBlinkAnimation();
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void pauseOpenAutopilotNonManual(boolean canStartAuto) {
runOnUIThread(() -> {
mView.startOrStopLoadingAnim(false);
mView.updateAutopilotStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState(),canStartAuto);
mView.pauseAutopilotBlinkAnimation();
});
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.startOrStopLoadingAnim(false);
mView.updateAutopilotStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState(),canStartAuto);
mView.pauseAutopilotBlinkAnimation();
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void resumeOpenAutopilotNonManual() {
runOnUIThread(() -> {
mView.startOrStopLoadingAnim(true);
mView.resumeAutopilotBlinkAnimation();
});
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.startOrStopLoadingAnim(true);
mView.resumeAutopilotBlinkAnimation();
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
@@ -212,12 +285,18 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
role = TaxiUnmannedConst.TEST_USER;
}
String finalRole = role;
runOnUIThread(() -> {
mView.updateOperationStatus(LoginStatusManager.getOpenOrderType());
mView.setRole(finalRole);
});
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.updateOperationStatus(LoginStatusManager.getOpenOrderType());
mView.setRole(finalRole);
}
}
}, UiThreadHandler.MODE.QUEUE);
if (!TaxiTaskModel.INSTANCE.checkCurrentTaskCondition()) {
if (!TaxiTaskModel.INSTANCE.checkCurrentTaskCondition()&&mView!=null) {
mView.showDebugPanel();
}
@@ -226,9 +305,14 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
@Override
public void onOpenOrderStatusEnumChange(OpenOrderStatusEnum businessEnum) {
runOnUIThread(() -> {
mView.updateOperationStatus(LoginStatusManager.getOpenOrderType());
});
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.updateOperationStatus(LoginStatusManager.getOpenOrderType());
}
}
}, UiThreadHandler.MODE.QUEUE);
}
public void stopAutoStartAutopilot() {

View File

@@ -1,12 +1,10 @@
package com.mogo.och.taxi.ui.navi.amap
import android.os.Bundle
import com.amap.api.navi.AMapNaviViewListener
import com.mogo.commons.mvp.BaseFragment
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.och.common.module.map.AmapNaviToDestinationModel
import com.mogo.och.common.module.map.ICommonNaviChangedCallback
import com.mogo.och.taxi.R
import kotlinx.android.synthetic.main.taxi_amap_navi_view.navi_view
@@ -15,6 +13,8 @@ import kotlinx.android.synthetic.main.taxi_amap_navi_view.navi_view
* @date: 2023/7/24
*/
class TaxiAmapNaviFragment : BaseFragment(){
private val TAG = "TaxiAmapNaviFragment"
companion object {
fun newInstance(): TaxiAmapNaviFragment {
val args = Bundle()
@@ -36,25 +36,34 @@ class TaxiAmapNaviFragment : BaseFragment(){
}
override fun initViews(savedInstanceState: Bundle?) {
CallerLogger.e(SceneConstant.M_TAXI + TAG, "initViews")
super.initViews(savedInstanceState)
if (navi_view != null) navi_view.onCreate(savedInstanceState)
}
override fun onResume() {
CallerLogger.e(SceneConstant.M_TAXI + TAG, "onResume")
super.onResume()
if (navi_view != null) navi_view.onResume()
}
override fun onPause() {
CallerLogger.e(SceneConstant.M_TAXI + TAG, "onPause")
super.onPause()
if (navi_view != null) navi_view.onPause()
}
override fun onDestroy() {
super.onDestroy()
override fun onDestroyView() {
CallerLogger.e(SceneConstant.M_TAXI + TAG, "onDestroyView")
AmapNaviToDestinationModel.getInstance(context).setVoiceIsMute(false)
if (navi_view != null) {
navi_view.onDestroy()
}
super.onDestroyView()
}
override fun onDestroy() {
super.onDestroy()
}
}

View File

@@ -62,11 +62,20 @@ public class RoutingNaviPresenter extends Presenter<TaxiRoutingNaviFragment> imp
@Override
public void setLineMarker(LatLng startStation, LatLng endStation) {
runOnUIThread(() -> mView.setLineMarker(startStation, endStation));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.setLineMarker(startStation, endStation);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void routeResult(List<LatLng> routeArrivied, List<LatLng> routeArriving, MogoLocation location) {
mView.routeResult(routeArrivied, routeArriving, location);
if (mView != null) {
mView.routeResult(routeArrivied, routeArriving, location);
}
}
}

View File

@@ -4,6 +4,8 @@ import android.os.Bundle
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.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.taxi.R
@@ -24,26 +26,36 @@ class TaxiRoutingNaviFragment : MvpFragment<TaxiRoutingNaviFragment?, RoutingNav
override fun initViews() {}
override fun initViews(savedInstanceState: Bundle?) {
CallerLogger.e(SceneConstant.M_TAXI + TAG, "initViews")
super.initViews(savedInstanceState)
mMapDirectionView = mRootView.findViewById<TaxiMapDirectionView>(R.id.rotting_navi_view)
mMapDirectionView!!.onCreateView(savedInstanceState)
}
override fun onResume() {
CallerLogger.e(SceneConstant.M_TAXI + TAG, "onResume")
super.onResume()
mMapDirectionView!!.onResume()
}
override fun onPause() {
CallerLogger.e(SceneConstant.M_TAXI + TAG, "onPause")
super.onPause()
mMapDirectionView!!.onPause()
}
override fun onDestroy() {
super.onDestroy()
override fun onDestroyView() {
if (mMapDirectionView != null) {
mMapDirectionView!!.onDestroy()
}
CallerLogger.e(SceneConstant.M_TAXI + TAG, "onDestroyView")
super.onDestroyView()
}
override fun onDestroy() {
super.onDestroy()
}
override fun createPresenter(): RoutingNaviPresenter {

View File

@@ -35,6 +35,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils
import com.mogo.eagle.core.utilcode.util.NetworkUtils
import com.mogo.eagle.core.utilcode.util.StringUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager
@@ -1219,7 +1220,7 @@ object TaxiTaskModel {
return
}
//根据开关和后台是否发布轨迹启动自驾
//1、判断轨迹url是否可用 根据开关和后台是否发布轨迹启动自驾
if (FunctionBuildConfig.isPassStartAutopilotCommand && mCurrentTaskTrajectory != null
&& TextUtils.isEmpty(mCurrentTaskTrajectory!!.csvFileUrl)
&& TextUtils.isEmpty(mCurrentTaskTrajectory!!.csvFileUrlDPQP)
@@ -1238,9 +1239,19 @@ object TaxiTaskModel {
TAG, "isPassStartAutopilotCommand = " +
FunctionBuildConfig.isPassStartAutopilotCommand
)
//2、6个条件判断
if (!CallerAutoPilotControlManager.isCanStartAutopilot(true)) {
return
}
// 3、距离轨迹15m计算
mCurrentTaskWithOrder?.let {
val resion = TrajectoryAndDistanceManager.canStartAutopilot(it.lineId)
if(!StringUtils.isEmpty(resion)){
ToastUtils.showShort(resion);
return;
}
}
// 4、ssm 给出数据
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().autopilotAbilityStatus) {
ToastUtils.showLong(
OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason +

View File

@@ -2,9 +2,13 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="@dimen/module_och_taxi_panel_width"
android:layout_height="@dimen/taxi_routing_verify_view_height"
android:background="@drawable/taxi_routing_bg"
android:layout_width="@dimen/dp_618"
android:layout_height="@dimen/dp_960"
android:paddingTop="@dimen/dp_26"
android:paddingBottom="@dimen/dp_32"
android:paddingStart="@dimen/dp_29"
android:paddingEnd="@dimen/dp_29"
android:background="@drawable/taxi_order_bg"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent">
@@ -21,7 +25,7 @@
android:id="@+id/taskTitleTv"
android:layout_width="@dimen/dp_420"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_45"
android:layout_marginTop="@dimen/dp_35"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
@@ -31,17 +35,6 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/module_och_taxi_order_status_divider"
android:layout_width="match_parent"
android:layout_height="4dp"
android:layout_marginTop="@dimen/dp_45"
android:background="@drawable/taxi_line_bg1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/taskTitleTv"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
@@ -63,7 +56,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/btnChooseTask"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_132"
android:layout_height="@dimen/dp_116"
android:background="@drawable/routing_click_btn_bg"
android:gravity="center"
android:text="@string/routing_verify_btn_choose_task"
@@ -75,7 +68,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/btnStartTask"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_132"
android:layout_height="@dimen/dp_116"
android:background="@drawable/routing_click_btn_bg"
android:gravity="center"
android:text="@string/routing_verify_btn_start_task"
@@ -221,8 +214,8 @@
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/startPoint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="@dimen/dp_38"
android:layout_height="@dimen/dp_38"
android:src="@drawable/taxi_driver_circle_green_big"
app:layout_constraintBottom_toBottomOf="@+id/startStationName"
app:layout_constraintLeft_toLeftOf="@+id/taskHintTextView"
@@ -241,8 +234,8 @@
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/endPoint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="@dimen/dp_38"
android:layout_height="@dimen/dp_38"
android:src="@drawable/taxi_driver_circle_blue_big"
app:layout_constraintBottom_toBottomOf="@+id/endStationName"
app:layout_constraintLeft_toLeftOf="@+id/taskHintTextView"

View File

@@ -42,6 +42,8 @@
android:layout_width="@dimen/dp_616"
android:layout_height="@dimen/dp_180"
android:layout_marginStart="@dimen/dp_10"
android:paddingTop="@dimen/dp_27"
android:paddingBottom="@dimen/dp_32"
android:layout_marginTop="-31dp"
android:gravity="center"
android:background="@drawable/taxi_autopilot_bg_selector"

View File

@@ -9,9 +9,8 @@ import android.view.View
import com.alibaba.android.arouter.launcher.ARouter
import com.mogo.commons.mvp.MvpFragment
import com.mogo.commons.voice.AIAssist
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.function.api.hmi.view.IStatusViewLayout
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_TAXI_P
import com.mogo.eagle.core.utilcode.util.DeviceUtils
@@ -236,6 +235,10 @@ class TaxiPassengerBaseFragment() :
override fun onDestroyView() {
mapBizView!!.onDestroy()
overMapView?.onDestroy()
CallerMapUIServiceManager.getOverlayManager()?.let {
it.removeAllLines()
it.removeAllPoints()
}
super.onDestroyView()
}

View File

@@ -134,7 +134,7 @@ class TestAutoPilotBeforeLaunch {
CallerChassisGearStateListenerManager.invokeAutopilotGearData(GEAR_R)
val current = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
CallerChassisLocationGCJ02ListenerManager.invokeChassisLocationGCJ02(current.also { it.gnssSpeed = Random.nextInt(0 ..20).toFloat(); it.setAcceleration(Random.nextInt(-100, 100).toDouble()) }, DEFAULT)
delay(Random.nextInt(10..50).toLong())
delay(Random.nextInt(100..500).toLong())
}
}
launch(Dispatchers.IO) {

Some files were not shown because too many files have changed in this diff Show More