[2.13.0-merge]yakun and code style
This commit is contained in:
@@ -6,15 +6,14 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.elegant.utils.UiThreadHandler;
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.module.status.StatusDescriptor;
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
|
||||
import com.mogo.och.bus.passenger.ui.BusPassengerRouteFragment;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -64,8 +63,7 @@ public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("OchBus"
|
||||
, StatusDescriptor.VR_MODE, this);
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener("OchBus",StatusDescriptor.VR_MODE, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -106,4 +104,5 @@ public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener
|
||||
mActivity.getSupportFragmentManager().beginTransaction().hide(mPassengerFragment).commitAllowingStateLoss();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,12 +15,18 @@ import com.mogo.aicloud.services.socket.IMogoLifecycleListener;
|
||||
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.module.intent.IMogoIntentListener;
|
||||
import com.mogo.commons.module.intent.IntentManager;
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.module.status.StatusDescriptor;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
@@ -42,9 +48,6 @@ import com.mogo.och.bus.passenger.network.BusPassengerModelLoopManager;
|
||||
import com.mogo.och.bus.passenger.network.BusPassengerServiceManager;
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -247,14 +250,8 @@ public class BusPassengerModel {
|
||||
|
||||
// 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getIntentManagerApi()
|
||||
.registerIntentListener( ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getStatusManagerApi()
|
||||
.registerStatusChangedListener( TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener );
|
||||
IntentManager.getInstance().registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener );
|
||||
// 达到起始站围栏监听
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
@@ -266,10 +263,7 @@ public class BusPassengerModel {
|
||||
}
|
||||
|
||||
private void releaseListeners() {
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getStatusManagerApi()
|
||||
.unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
// 注销到达起始站围栏监听
|
||||
MogoApisHandler.getInstance()
|
||||
@@ -297,15 +291,12 @@ public class BusPassengerModel {
|
||||
}
|
||||
};
|
||||
|
||||
private final IMogoStatusChangedListener mMogoStatusChangedListener = new IMogoStatusChangedListener() {
|
||||
// VR mode变更回调
|
||||
@Override
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
if (StatusDescriptor.VR_MODE == descriptor) {
|
||||
if (mControllerStatusCallbackMap.size() > 0) {
|
||||
for (IBusPassengerControllerStatusCallback callback :mControllerStatusCallbackMap.values()){
|
||||
callback.onVRModeChanged(isTrue);
|
||||
}
|
||||
// VR mode变更回调
|
||||
private final IMogoStatusChangedListener mMogoStatusChangedListener = (descriptor, isTrue) -> {
|
||||
if (StatusDescriptor.VR_MODE == descriptor) {
|
||||
if (mControllerStatusCallbackMap.size() > 0) {
|
||||
for (IBusPassengerControllerStatusCallback callback :mControllerStatusCallbackMap.values()){
|
||||
callback.onVRModeChanged(isTrue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,13 +10,13 @@ import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.module.status.StatusDescriptor;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
import com.mogo.och.bus.fragment.BusFragment;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -38,15 +38,15 @@ public class BusProvider implements IMogoOCH {
|
||||
/**
|
||||
* 进入鹰眼模式,设置手势缩放地图失效
|
||||
*/
|
||||
private void stepIntoVrMode(){
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "进入vr模式" );
|
||||
private void stepIntoVrMode() {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "进入vr模式");
|
||||
MogoMapUIController.getInstance()
|
||||
.stepInVrMode(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("OchBus"
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener("OchBus"
|
||||
, StatusDescriptor.VR_MODE, statusChangedListener);
|
||||
}
|
||||
|
||||
@@ -55,12 +55,12 @@ public class BusProvider implements IMogoOCH {
|
||||
if (busFragment == null) {
|
||||
CallerLogger.INSTANCE.d(TAG, "准备add fragment======");
|
||||
Fragment fragmentByTag = supportFragmentManager.findFragmentByTag(BusFragment.TAG);
|
||||
if(fragmentByTag instanceof BusFragment){
|
||||
busFragment = (BusFragment)fragmentByTag;
|
||||
}else {
|
||||
if (fragmentByTag instanceof BusFragment) {
|
||||
busFragment = (BusFragment) fragmentByTag;
|
||||
} else {
|
||||
busFragment = new BusFragment();
|
||||
}
|
||||
supportFragmentManager.beginTransaction().add(containerId, busFragment,BusFragment.TAG).commitAllowingStateLoss();
|
||||
supportFragmentManager.beginTransaction().add(containerId, busFragment, BusFragment.TAG).commitAllowingStateLoss();
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(TAG, "准备show fragment");
|
||||
@@ -83,7 +83,7 @@ public class BusProvider implements IMogoOCH {
|
||||
} else {
|
||||
hideFragment();
|
||||
}
|
||||
} else if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
} else if (MogoStatusManager.getInstance().isVrMode()) {
|
||||
// topView进行展示时推出网约车界面,但是不隐藏整个fragment
|
||||
if (busFragment != null && isTrue) {
|
||||
busFragment.hideOchBus();
|
||||
@@ -115,7 +115,9 @@ public class BusProvider implements IMogoOCH {
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
//若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
|
||||
//若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener("OchBus"
|
||||
, StatusDescriptor.VR_MODE, statusChangedListener);
|
||||
if (activity == null) return;
|
||||
activity.finish();
|
||||
}
|
||||
|
||||
@@ -44,8 +44,7 @@ import com.mogo.map.MogoMarkerManager;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.constants.DataTypes;
|
||||
import com.mogo.module.common.view.OnPreventFastClickListener;
|
||||
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
||||
import com.mogo.och.bus.R;
|
||||
import com.mogo.och.bus.bean.BusRoutesResult;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
@@ -67,7 +66,7 @@ import record_cache.RecordPanelOuterClass;
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> implements IMogoMapListener, IMoGoAutopilotRecordListener {
|
||||
public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> implements IMogoMapListener, IMoGoAutopilotRecordListener {
|
||||
|
||||
private static final String TAG = "BaseOchFragment";
|
||||
|
||||
@@ -158,19 +157,9 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
}
|
||||
});
|
||||
|
||||
if (DebugConfig.isDebug()) {
|
||||
mTrafficDataView.setLongClickable(true);
|
||||
mTrafficDataView.setOnLongClickListener(v -> {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "长按显示状态工具栏");
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("oper", 52);
|
||||
MogoApisHandler.getInstance().getApis().getIntentManagerApi().invoke("com.mogo.mock", intent);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
initListener();
|
||||
setAutopilotBtnStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState());
|
||||
ctvAutopilotStatus.setOnClickListener(new OnPreventFastClickListener(){
|
||||
ctvAutopilotStatus.setOnClickListener(new OnPreventFastClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClickImpl(View v) {
|
||||
@@ -221,7 +210,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
}
|
||||
|
||||
mAICollectBtn = findViewById(R.id.module_mogo_och_ai_collet_rl);
|
||||
if (mAICollectBtn != null){
|
||||
if (mAICollectBtn != null) {
|
||||
CallerDevaToolsManager.INSTANCE.initAiCollect(mAICollectBtn);
|
||||
}
|
||||
}
|
||||
@@ -236,7 +225,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
|
||||
protected abstract void onArriveStation();
|
||||
|
||||
private void updateSwitchMapIcon(){
|
||||
private void updateSwitchMapIcon() {
|
||||
if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isLongSight()) {
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
|
||||
} else if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isMediumSight()) {
|
||||
@@ -296,14 +285,15 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
|
||||
/**
|
||||
* 设置进站按钮状态
|
||||
*
|
||||
* @param isClickable
|
||||
*/
|
||||
public void setArrivedClikable(boolean isClickable){
|
||||
public void setArrivedClikable(boolean isClickable) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
tvArrived.setEnabled(isClickable);
|
||||
if (isClickable){
|
||||
if (isClickable) {
|
||||
tvArrived.setTextColor(getResources().getColor(R.color.bus_white));
|
||||
}else {
|
||||
} else {
|
||||
tvArrived.setTextColor(getResources().getColor(R.color.bus_arrived_btn_un_clickable_color));
|
||||
}
|
||||
});
|
||||
@@ -318,9 +308,10 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
});
|
||||
}
|
||||
|
||||
public void playDI(){
|
||||
public void playDI() {
|
||||
SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(getContext(), R.raw.bus_di);
|
||||
}
|
||||
|
||||
/**
|
||||
* 改变自动驾驶状态
|
||||
*
|
||||
@@ -348,13 +339,13 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
ctvAutopilotStatus.setClickable(true);
|
||||
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == autopilotStatus) {//1可用
|
||||
ctvAutopilotStatus.setSelected(false);
|
||||
}else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == autopilotStatus){
|
||||
} else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == autopilotStatus) {
|
||||
ctvAutopilotStatus.setSelected(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void updateAutopilotStatus(int autopilotStatus){
|
||||
public void updateAutopilotStatus(int autopilotStatus) {
|
||||
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
|
||||
== autopilotStatus) {//2 running
|
||||
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_right_autopilot_icon);
|
||||
@@ -362,7 +353,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_success_tv));
|
||||
ctvAutopilotStatus.setSelected(false);
|
||||
ctvAutopilotStatus.setClickable(false);
|
||||
}else {
|
||||
} 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));
|
||||
@@ -374,7 +365,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
public void run() {
|
||||
setAutopilotBtnStatus(autopilotStatus);
|
||||
}
|
||||
},1000);
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
private void changeAutopilotBtnView(int autopilotStatus, boolean isAnimateRunning) {
|
||||
@@ -462,19 +453,20 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
|
||||
}
|
||||
|
||||
private void startingAutoApilotCountDown(){
|
||||
private void startingAutoApilotCountDown() {
|
||||
//10s 若自动驾驶没有开启,则结束动画
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() { //未启动成功做处理
|
||||
if (isAnimateRunning){// 只判断动画是否在进行,根据自动驾驶当前状态去设置自动驾驶状态
|
||||
if (isAnimateRunning) {// 只判断动画是否在进行,根据自动驾驶当前状态去设置自动驾驶状态
|
||||
stopAutopilotAnimation();
|
||||
updateAutopilotStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState());
|
||||
}
|
||||
}
|
||||
},TIMER_START_AUTOPILOT_INTERVAL);
|
||||
}, TIMER_START_AUTOPILOT_INTERVAL);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止自动驾驶中间动画
|
||||
*/
|
||||
@@ -494,7 +486,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
*/
|
||||
public void updateSpeedView(float newSpeed) {
|
||||
int speed = (int) (Math.abs(newSpeed) * 3.6F); // 倒车时工控机反馈定位信息中speed为负值
|
||||
if (mTrafficDataView != null){
|
||||
if (mTrafficDataView != null) {
|
||||
mTrafficDataView.updateSpeedWithValue(speed);
|
||||
}
|
||||
}
|
||||
@@ -529,7 +521,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
|
||||
/**
|
||||
* Bus调试信息:线路、轨迹等信息
|
||||
*
|
||||
* <p>
|
||||
* START
|
||||
*/
|
||||
private View busTestBar;
|
||||
|
||||
@@ -18,6 +18,9 @@ import com.elegant.network.utils.GsonUtil;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.module.status.StatusDescriptor;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
@@ -63,8 +66,6 @@ import com.mogo.och.common.module.utils.PinYinUtil;
|
||||
import com.mogo.och.common.module.utils.SoundPoolHelper;
|
||||
import com.mogo.och.common.module.utils.ToastUtilsOch;
|
||||
import com.mogo.och.common.module.voice.VoiceNotice;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@@ -78,7 +79,7 @@ import mogo.telematics.pad.MessagePad;
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2021/3/23
|
||||
*
|
||||
* <p>
|
||||
* 小巴订单管理
|
||||
*/
|
||||
public class BusOrderModel {
|
||||
@@ -122,7 +123,7 @@ public class BusOrderModel {
|
||||
private final Handler handler = new Handler(new Handler.Callback() {
|
||||
@Override
|
||||
public boolean handleMessage(Message msg) {
|
||||
if ( msg.what == MSG_QUERY_BUS_STATION ) {
|
||||
if (msg.what == MSG_QUERY_BUS_STATION) {
|
||||
queryBusRoutes();
|
||||
return true;
|
||||
}
|
||||
@@ -131,9 +132,9 @@ public class BusOrderModel {
|
||||
});
|
||||
|
||||
public static BusOrderModel getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( BusOrderModel.class ) {
|
||||
if ( sInstance == null ) {
|
||||
if (sInstance == null) {
|
||||
synchronized (BusOrderModel.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new BusOrderModel();
|
||||
}
|
||||
}
|
||||
@@ -155,10 +156,7 @@ public class BusOrderModel {
|
||||
.getApis()
|
||||
.getRegisterCenterApi()
|
||||
.registerCarLocationChangedListener(TAG, mCarLocationChangedListener2);
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getStatusManagerApi()
|
||||
.registerStatusChangedListener( TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener );
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
//自动驾驶路线规划接口
|
||||
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
|
||||
@@ -176,31 +174,31 @@ public class BusOrderModel {
|
||||
public void accept(Throwable e) {
|
||||
if (e instanceof UndeliverableException) {
|
||||
e = e.getCause();
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"UndeliverableException");
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "UndeliverableException");
|
||||
}
|
||||
if ((e instanceof IOException)) {//
|
||||
// fine, irrelevant network problem or API that throws on cancellation
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"IOException");
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "IOException");
|
||||
return;
|
||||
}
|
||||
if (e instanceof InterruptedException) {
|
||||
// fine, some blocking code was interrupted by a dispose call
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"InterruptedException");
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "InterruptedException");
|
||||
return;
|
||||
}
|
||||
if ((e instanceof NullPointerException) || (e instanceof IllegalArgumentException)) {
|
||||
// that's likely a bug in the application
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"NullPointerException or IllegalArgumentException");
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "NullPointerException or IllegalArgumentException");
|
||||
Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e);
|
||||
return;
|
||||
}
|
||||
if (e instanceof IllegalStateException) {
|
||||
// that's a bug in RxJava or in a custom operator
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"IllegalStateException");
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "IllegalStateException");
|
||||
Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e);
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"Undeliverable exception");
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "Undeliverable exception");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -213,11 +211,11 @@ public class BusOrderModel {
|
||||
this.refreshBusStationsCallback = callback;
|
||||
}
|
||||
|
||||
public void setPassengerCallback(IPassengerCallback callback){
|
||||
public void setPassengerCallback(IPassengerCallback callback) {
|
||||
this.mPassengerCallback = callback;
|
||||
}
|
||||
|
||||
public void setSlidePanelHideCallback(ISlidePannelHideCallback callback){
|
||||
public void setSlidePanelHideCallback(ISlidePannelHideCallback callback) {
|
||||
this.slidePanelHideCallback = callback;
|
||||
}
|
||||
|
||||
@@ -234,9 +232,9 @@ public class BusOrderModel {
|
||||
|
||||
@Override
|
||||
public void onAutopilotRotting(MessagePad.GlobalPathResp routeList) {
|
||||
if (null != routeList && routeList.getWayPointsList().size() > 0){
|
||||
if (null != routeList && routeList.getWayPointsList().size() > 0) {
|
||||
points.clear();
|
||||
points.addAll(coordinateConverterWgsToGcjList(mContext,routeList.getWayPointsList()));
|
||||
points.addAll(coordinateConverterWgsToGcjList(mContext, routeList.getWayPointsList()));
|
||||
updateOrderRoute();
|
||||
}
|
||||
}
|
||||
@@ -259,12 +257,12 @@ public class BusOrderModel {
|
||||
* 上报订单全路径规划数据
|
||||
*/
|
||||
public void updateOrderRoute() {
|
||||
if (!isGoingToNextStation || backgroundCurrentStationIndex+1 >= stationList.size() || points.size() == 0){
|
||||
if (!isGoingToNextStation || backgroundCurrentStationIndex + 1 >= stationList.size() || points.size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
BusStationBean currentStation = stationList.get( backgroundCurrentStationIndex);
|
||||
BusStationBean nextStation = stationList.get( backgroundCurrentStationIndex +1);
|
||||
BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex);
|
||||
BusStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1);
|
||||
|
||||
BusServiceManager.updateOrderRoute(mContext, currentLineId, currentStation.getSiteId()
|
||||
, nextStation.getSiteId(), points, new OchCommonServiceCallback<BaseData>() {
|
||||
@@ -275,27 +273,24 @@ public class BusOrderModel {
|
||||
|
||||
@Override
|
||||
public void onFail(int code, String failMsg) {
|
||||
if (isGoingToNextStation){//重试
|
||||
if (isGoingToNextStation) {//重试
|
||||
updateOrderRoute();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void debugUpdateOrderRoute(List<MessagePad.Location> list){
|
||||
public void debugUpdateOrderRoute(List<MessagePad.Location> list) {
|
||||
points.clear();
|
||||
points.addAll(coordinateConverterWgsToGcjList(mContext,list));
|
||||
points.addAll(coordinateConverterWgsToGcjList(mContext, list));
|
||||
updateOrderRoute();
|
||||
}
|
||||
|
||||
public void release(){
|
||||
public void release() {
|
||||
|
||||
startOrStopOrderLoop(false);
|
||||
startOrStopQueryPassengerWriteOff(false);
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getStatusManagerApi()
|
||||
.unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
// 注销到达起始站围栏监听
|
||||
MogoApisHandler.getInstance()
|
||||
@@ -315,7 +310,7 @@ public class BusOrderModel {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private IMogoStatusChangedListener mMogoStatusChangedListener = new IMogoStatusChangedListener() {
|
||||
private final IMogoStatusChangedListener mMogoStatusChangedListener = new IMogoStatusChangedListener() {
|
||||
// VR mode变更回调
|
||||
@Override
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
@@ -342,7 +337,7 @@ public class BusOrderModel {
|
||||
private final IMogoCarLocationChangedListener2 mCarLocationChangedListener2 = new IMogoCarLocationChangedListener2() {
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged2( Location location ) {
|
||||
public void onCarLocationChanged2(Location location) {
|
||||
// CallerLogger.INSTANCE.d(M_BUS + TAG,"location = "+location.getLongitude()+","+location.getLatitude());
|
||||
mLongitude = location.getLongitude();
|
||||
mLatitude = location.getLatitude();
|
||||
@@ -351,7 +346,7 @@ public class BusOrderModel {
|
||||
}
|
||||
|
||||
//是否到站的围栏判断 离站状态并且自动驾驶还未触发到站
|
||||
if (isGoingToNextStation && !isArrivedStation){
|
||||
if (isGoingToNextStation && !isArrivedStation) {
|
||||
judgeArrivedStation(location);
|
||||
}
|
||||
}
|
||||
@@ -360,21 +355,21 @@ public class BusOrderModel {
|
||||
//根据围栏判断,是否到达站点
|
||||
private void judgeArrivedStation(Location location) {
|
||||
|
||||
if (backgroundCurrentStationIndex +1 > stationList.size() - 1 ){
|
||||
CallerLogger.INSTANCE.e( M_BUS + TAG, "到站数组越界" );
|
||||
if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) {
|
||||
CallerLogger.INSTANCE.e(M_BUS + TAG, "到站数组越界");
|
||||
return;
|
||||
}
|
||||
BusStationBean upcomingStation = stationList.get( backgroundCurrentStationIndex +1);
|
||||
BusStationBean upcomingStation = stationList.get(backgroundCurrentStationIndex + 1);
|
||||
|
||||
double startLon = upcomingStation.getGcjLon();
|
||||
double startLat = upcomingStation.getGcjLat();
|
||||
double distance = CoordinateUtils.calculateLineDistance(
|
||||
startLon, startLat,
|
||||
location.getLongitude(), location.getLatitude() );
|
||||
location.getLongitude(), location.getLatitude());
|
||||
|
||||
if ( distance <= BusConst.ARRIVE_AT_END_STATION_DISTANCE ) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"行程日志-judgeArrivedStation() distance = " + distance
|
||||
+" to " + upcomingStation.getName());
|
||||
if (distance <= BusConst.ARRIVE_AT_END_STATION_DISTANCE) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-judgeArrivedStation() distance = " + distance
|
||||
+ " to " + upcomingStation.getName());
|
||||
onArriveAt(null); //无自动驾驶到站信息传null
|
||||
return;
|
||||
}
|
||||
@@ -388,13 +383,13 @@ public class BusOrderModel {
|
||||
BusServiceManager.queryBusRoutes(mContext, new OchCommonServiceCallback<BusRoutesResponse>() {
|
||||
@Override
|
||||
public void onSuccess(BusRoutesResponse data) {
|
||||
if ( data == null
|
||||
if (data == null
|
||||
|| data.getResult() == null
|
||||
|| data.getResult().getSites() == null
|
||||
|| data.getResult().getSites().isEmpty() ) {
|
||||
|| data.getResult().getSites().isEmpty()) {
|
||||
//当为空时,显示无绑定路线图
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据:空 " );
|
||||
if (refreshBusStationsCallback != null){
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据:空 ");
|
||||
if (refreshBusStationsCallback != null) {
|
||||
refreshBusStationsCallback.updateEmptyUi();
|
||||
}
|
||||
clearAutopilotControlParameters();
|
||||
@@ -402,9 +397,10 @@ public class BusOrderModel {
|
||||
clearStartAutopilotTag();
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据: " + data );
|
||||
updateBusStatus( data.getResult());
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据: " + data);
|
||||
updateBusStatus(data.getResult());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(int code, String failMsg) {
|
||||
// 重复请求小巴路线,直至成功
|
||||
@@ -417,26 +413,27 @@ public class BusOrderModel {
|
||||
|
||||
/**
|
||||
* 更新正在运行的任务UI
|
||||
*
|
||||
* @param stations
|
||||
*/
|
||||
private void updateBusTaskStatus(List<BusStationBean> stations) {
|
||||
|
||||
int arrivingOrArrivedStationIndex = 0;//已经到站或者即将到站的索引呢
|
||||
|
||||
for (int i =0 ; i< stations.size(); i++){
|
||||
for (int i = 0; i < stations.size(); i++) {
|
||||
BusStationBean station = stations.get(i);
|
||||
|
||||
if (i == 0){ // 首发站 显示在最上面
|
||||
if (i == 0) { // 首发站 显示在最上面
|
||||
if (station.getDrivingStatus() == STATION_STATUS_STOPPED
|
||||
&& !station.isLeaving()){ //到达第一站
|
||||
&& !station.isLeaving()) { //到达第一站
|
||||
arrivingOrArrivedStationIndex = i;
|
||||
break;
|
||||
}
|
||||
}else {
|
||||
BusStationBean preStation = stations.get(i-1);
|
||||
} else {
|
||||
BusStationBean preStation = stations.get(i - 1);
|
||||
if ((station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving())
|
||||
|| (station.getDrivingStatus() == STATION_STATUS_ARRIVING
|
||||
&& preStation.isLeaving())){
|
||||
&& preStation.isLeaving())) {
|
||||
//到站未离开 | 即将到站 显示在最中间
|
||||
arrivingOrArrivedStationIndex = i;
|
||||
break;
|
||||
@@ -452,16 +449,16 @@ public class BusOrderModel {
|
||||
|
||||
if (arrivingOrArrivedStationIndex == 0 ||
|
||||
arrivingOrArrivedStation.getDrivingStatus() == STATION_STATUS_STOPPED
|
||||
&& !arrivingOrArrivedStation.isLeaving()){
|
||||
if (refreshBusStationsCallback != null){
|
||||
refreshBusStationsCallback.updateBusTaskStatus(busRoutesResult.getName(),lineTime,
|
||||
stationList,arrivingOrArrivedStationIndex,true);
|
||||
&& !arrivingOrArrivedStation.isLeaving()) {
|
||||
if (refreshBusStationsCallback != null) {
|
||||
refreshBusStationsCallback.updateBusTaskStatus(busRoutesResult.getName(), lineTime,
|
||||
stationList, arrivingOrArrivedStationIndex, true);
|
||||
}
|
||||
clearAutopilotControlParameters();
|
||||
}else {
|
||||
if (refreshBusStationsCallback != null){
|
||||
refreshBusStationsCallback.updateBusTaskStatus(busRoutesResult.getName(),lineTime,
|
||||
stationList,arrivingOrArrivedStationIndex,false);
|
||||
} else {
|
||||
if (refreshBusStationsCallback != null) {
|
||||
refreshBusStationsCallback.updateBusTaskStatus(busRoutesResult.getName(), lineTime,
|
||||
stationList, arrivingOrArrivedStationIndex, false);
|
||||
}
|
||||
updateAutopilotControlParameters();
|
||||
}
|
||||
@@ -471,25 +468,25 @@ public class BusOrderModel {
|
||||
* 重置路线站点状态--结束路线,当前路线恢复到始发站
|
||||
*/
|
||||
public void abortTask() {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "结束当前路线abortTask");
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "结束当前路线abortTask");
|
||||
BusServiceManager.abortTask(mContext, currentTaskId
|
||||
, new OchCommonServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "abortTask success: " + o);
|
||||
if (o.code == 0){ // 重置成功
|
||||
endOrAbortTaskSuccess();
|
||||
clearBusStationDatas();
|
||||
queryBusRoutes();
|
||||
startOrStopQueryPassengerWriteOff(false);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "abortTask success: " + o);
|
||||
if (o.code == 0) { // 重置成功
|
||||
endOrAbortTaskSuccess();
|
||||
clearBusStationDatas();
|
||||
queryBusRoutes();
|
||||
startOrStopQueryPassengerWriteOff(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(int code, String failMsg) {
|
||||
ToastUtils.showShort(failMsg);
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onFail(int code, String failMsg) {
|
||||
ToastUtils.showShort(failMsg);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -501,12 +498,12 @@ public class BusOrderModel {
|
||||
isGoingToNextStation = false;
|
||||
backgroundCurrentStationIndex = 0;
|
||||
|
||||
if (busRoutesResult != null){
|
||||
if (busRoutesResult != null) {
|
||||
BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.END_TRIP
|
||||
, busRoutesResult.getName()
|
||||
,""
|
||||
,""
|
||||
,false);
|
||||
, ""
|
||||
, ""
|
||||
, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -515,23 +512,23 @@ public class BusOrderModel {
|
||||
* 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站,
|
||||
* 车机端展示是离开当前站,下一站设置为当前站, 所以服务端数据回来要做处理,不能直接渲染
|
||||
*/
|
||||
private void leaveStationSuccess(int leaveIndex,String leaveStation,String nextStation) {
|
||||
private void leaveStationSuccess(int leaveIndex, String leaveStation, String nextStation) {
|
||||
|
||||
onStartAutopilot(leaveIndex);
|
||||
|
||||
leaveTTSTips(nextStation);
|
||||
|
||||
if (busRoutesResult != null){
|
||||
if (busRoutesResult != null) {
|
||||
boolean isLastStop = false;
|
||||
if (leaveIndex + 1 == stationList.size() -1){
|
||||
if (leaveIndex + 1 == stationList.size() - 1) {
|
||||
isLastStop = true;
|
||||
}
|
||||
//给bus外屏发送
|
||||
BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.LEAVE_STATION
|
||||
, busRoutesResult.getName()
|
||||
,leaveStation
|
||||
,nextStation
|
||||
,isLastStop);
|
||||
, leaveStation
|
||||
, nextStation
|
||||
, isLastStop);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -539,27 +536,28 @@ public class BusOrderModel {
|
||||
//开启自动驾驶 2.10.0: 如果自动驾驶状态下开启, 非自动驾驶状态下不开启,需手动点击自动驾驶按钮开启
|
||||
isGoingToNextStation = true;
|
||||
if (CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()
|
||||
== IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
|
||||
startAutopilot(false,leaveIndex);
|
||||
}else {
|
||||
== IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
startAutopilot(false, leaveIndex);
|
||||
} else {
|
||||
firstStartAutopilot = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启自动驾驶
|
||||
*
|
||||
* @param isRestart
|
||||
*/
|
||||
private void startAutopilot(boolean isRestart,int leaveIndex) {
|
||||
private void startAutopilot(boolean isRestart, int leaveIndex) {
|
||||
|
||||
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()){
|
||||
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()) {
|
||||
ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() +
|
||||
", 请稍候重试");
|
||||
triggerUnableStartAPReasonEvent();
|
||||
return;
|
||||
}
|
||||
|
||||
firstStartAutopilot ++;
|
||||
firstStartAutopilot++;
|
||||
|
||||
triggerStartServiceEvent(isRestart, false);
|
||||
|
||||
@@ -571,9 +569,9 @@ public class BusOrderModel {
|
||||
|
||||
CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters);
|
||||
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
|
||||
+" startLatLon="+parameters.startName+",endLatLon="+parameters.endName +
|
||||
"isRestart = " + isRestart);
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
|
||||
+ " startLatLon=" + parameters.startName + ",endLatLon=" + parameters.endName +
|
||||
"isRestart = " + isRestart);
|
||||
|
||||
if (mControllerStatusCallback != null) {
|
||||
mControllerStatusCallback.startOpenAutopilot();
|
||||
@@ -583,21 +581,21 @@ public class BusOrderModel {
|
||||
/**
|
||||
* 到站查询核销乘客
|
||||
*/
|
||||
public void queryPassengerWriteOff(){
|
||||
if ( backgroundCurrentStationIndex > stationList.size() - 1 ) { //到站短时间内调用多次
|
||||
CallerLogger.INSTANCE.e( M_BUS + TAG, "数组越界" );
|
||||
public void queryPassengerWriteOff() {
|
||||
if (backgroundCurrentStationIndex > stationList.size() - 1) { //到站短时间内调用多次
|
||||
CallerLogger.INSTANCE.e(M_BUS + TAG, "数组越界");
|
||||
return;
|
||||
}
|
||||
BusServiceManager.queryStationWriteOffPassengers(mContext,
|
||||
currentTaskId,
|
||||
stationList.get(backgroundCurrentStationIndex).getSiteId(),
|
||||
prePassengerWriteOffTime,
|
||||
new OchCommonServiceCallback<BusQueryWriteOffPassengersResponse>(){
|
||||
new OchCommonServiceCallback<BusQueryWriteOffPassengersResponse>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(BusQueryWriteOffPassengersResponse o) {
|
||||
if (o.code !=0 || o.data == null || o.data.isEmpty()){
|
||||
return;
|
||||
if (o.code != 0 || o.data == null || o.data.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
List<WriteOffPassenger> passengers = o.data;
|
||||
playWriteOffPassengersMsg(passengers);
|
||||
@@ -611,21 +609,21 @@ public class BusOrderModel {
|
||||
}
|
||||
|
||||
private void playWriteOffPassengersMsg(List<WriteOffPassenger> passengers) {
|
||||
for (int i=0; i< passengers.size();i++){
|
||||
for (int i = 0; i < passengers.size(); i++) {
|
||||
WriteOffPassenger passenger = passengers.get(i);
|
||||
CallerLogger.INSTANCE.e( M_BUS + TAG, "size = " + passenger.passengerSize+
|
||||
" time = "+passenger.writeOffTime);
|
||||
CallerLogger.INSTANCE.e(M_BUS + TAG, "size = " + passenger.passengerSize +
|
||||
" time = " + passenger.writeOffTime);
|
||||
prePassengerWriteOffTime = passenger.writeOffTime;
|
||||
if (mPassengerCallback != null){
|
||||
if (mPassengerCallback != null) {
|
||||
mPassengerCallback.playPassenger(passenger);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void startOrStopQueryPassengerWriteOff(boolean isStart){
|
||||
if (isStart){
|
||||
private void startOrStopQueryPassengerWriteOff(boolean isStart) {
|
||||
if (isStart) {
|
||||
BusModelLoopManager.getInstance().startQueryPassengerWriteOffLoop();
|
||||
}else {
|
||||
} else {
|
||||
prePassengerWriteOffTime = 0;
|
||||
SoundPoolHelper.getSoundPoolHelper().releaseSoundPool();
|
||||
BusModelLoopManager.getInstance().stopQueryPassengerWriteOffLoop();
|
||||
@@ -636,26 +634,26 @@ public class BusOrderModel {
|
||||
* 到站后重置站点状态
|
||||
*/
|
||||
private void arriveSiteStation() {
|
||||
if ( backgroundCurrentStationIndex +1 > stationList.size() - 1 ) { //到站短时间内调用多次
|
||||
CallerLogger.INSTANCE.e( M_BUS + TAG, "数组越界" );
|
||||
if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) { //到站短时间内调用多次
|
||||
CallerLogger.INSTANCE.e(M_BUS + TAG, "数组越界");
|
||||
return;
|
||||
}
|
||||
int arrivedStationIndex = backgroundCurrentStationIndex + 1;
|
||||
String arriveStation = stationList.get(arrivedStationIndex).getName();
|
||||
String departureStopName = stationList.get(backgroundCurrentStationIndex).getName();
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"arriveSiteStation-currentStationIndex = "+ arrivedStationIndex);
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "arriveSiteStation-currentStationIndex = " + arrivedStationIndex);
|
||||
|
||||
BusServiceManager.arriveSiteStation(mContext ,
|
||||
BusServiceManager.arriveSiteStation(mContext,
|
||||
stationList.get(arrivedStationIndex).getSeq(),
|
||||
stationList.get(arrivedStationIndex).getSiteId(),
|
||||
currentTaskId ,
|
||||
currentTaskId,
|
||||
new OchCommonServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"行程日志-arriveSiteStation success");
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-arriveSiteStation success");
|
||||
queryBusRoutes();
|
||||
|
||||
arriveStationSuccess(arrivedStationIndex,departureStopName,arriveStation);
|
||||
arriveStationSuccess(arrivedStationIndex, departureStopName, arriveStation);
|
||||
|
||||
//5s轮询核销乘客
|
||||
startOrStopQueryPassengerWriteOff(true);
|
||||
@@ -665,10 +663,10 @@ public class BusOrderModel {
|
||||
public void onFail(int code, String failMsg) {
|
||||
isArrivedStation = false;
|
||||
isGoingToNextStation = true;
|
||||
if (ToastUtilsOch.isCustomFastClick(5000)){
|
||||
if (ToastUtilsOch.isCustomFastClick(5000)) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
}else {
|
||||
} else {
|
||||
ToastUtils.showShort(failMsg);
|
||||
}
|
||||
}
|
||||
@@ -676,18 +674,18 @@ public class BusOrderModel {
|
||||
});
|
||||
}
|
||||
|
||||
private void arriveStationSuccess(int arrivedStationIndex,String departureStopName,String arriveStation) {
|
||||
if (busRoutesResult != null){
|
||||
private void arriveStationSuccess(int arrivedStationIndex, String departureStopName, String arriveStation) {
|
||||
if (busRoutesResult != null) {
|
||||
boolean isLastStop = false;
|
||||
if (arrivedStationIndex == busRoutesResult.getSites().size() - 1 ){
|
||||
if (arrivedStationIndex == busRoutesResult.getSites().size() - 1) {
|
||||
isLastStop = true;
|
||||
}
|
||||
//给bus外屏发送
|
||||
BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.ARRIVE_STATION
|
||||
, busRoutesResult.getName()
|
||||
,departureStopName
|
||||
,arriveStation
|
||||
,isLastStop);
|
||||
, departureStopName
|
||||
, arriveStation
|
||||
, isLastStop);
|
||||
}
|
||||
|
||||
VoiceNotice.showNotice(String.format(mContext
|
||||
@@ -698,10 +696,10 @@ public class BusOrderModel {
|
||||
/**
|
||||
* 离站上报
|
||||
*/
|
||||
public void leaveStation(){
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"leaveStation-backgroundCurrentStationIndex = "+backgroundCurrentStationIndex);
|
||||
public void leaveStation() {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "leaveStation-backgroundCurrentStationIndex = " + backgroundCurrentStationIndex);
|
||||
String nextStationName = "";
|
||||
if (backgroundCurrentStationIndex < stationList.size() - 1){
|
||||
if (backgroundCurrentStationIndex < stationList.size() - 1) {
|
||||
nextStationName = stationList.get(backgroundCurrentStationIndex + 1).getName();
|
||||
}
|
||||
final String currentStationName = stationList.get(backgroundCurrentStationIndex).getName();
|
||||
@@ -714,18 +712,19 @@ public class BusOrderModel {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
isArrivedStation = false;
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "行程日志-离站成功开往下一站====" );
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-离站成功开往下一站====");
|
||||
//需要更改当前站和下一站的状态 然后渲染
|
||||
startOrStopQueryPassengerWriteOff(false);
|
||||
queryBusRoutes();
|
||||
leaveStationSuccess(backgroundCurrentStationIndex,currentStationName,finalNextStationName);
|
||||
startOrStopQueryPassengerWriteOff(false);
|
||||
queryBusRoutes();
|
||||
leaveStationSuccess(backgroundCurrentStationIndex, currentStationName, finalNextStationName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(int code, String failMsg) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
}else{
|
||||
ToastUtils.showShort("离站上报失败:"+failMsg);
|
||||
} else {
|
||||
ToastUtils.showShort("离站上报失败:" + failMsg);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -735,7 +734,7 @@ public class BusOrderModel {
|
||||
private void leaveTTSTips(String nextStation) {
|
||||
VoiceNotice.showNotice(String.format(mContext
|
||||
.getString(R.string.bus_leave_station_tip),
|
||||
nextStation),DELAY_10S);
|
||||
nextStation), DELAY_10S);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -754,7 +753,7 @@ public class BusOrderModel {
|
||||
* 开启自动驾驶到下一站
|
||||
*/
|
||||
public void autoDriveToNextStation() {
|
||||
if ( backgroundCurrentStationIndex >= stationList.size() - 1 ) {
|
||||
if (backgroundCurrentStationIndex >= stationList.size() - 1) {
|
||||
// 当前站是最后一站,结束当前行程
|
||||
travelOver();
|
||||
return;
|
||||
@@ -766,6 +765,7 @@ public class BusOrderModel {
|
||||
* 渲染站点信息
|
||||
* 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站,
|
||||
* 车机端展示 三站: 中间为即将到到达或者刚到达的站
|
||||
*
|
||||
* @param result
|
||||
*/
|
||||
private void updateBusStatus(BusRoutesResult result) {
|
||||
@@ -775,20 +775,20 @@ public class BusOrderModel {
|
||||
currentTaskId = result.getTaskId();
|
||||
currentLineId = result.getLineId();
|
||||
stationList.clear();
|
||||
stationList.addAll( site );
|
||||
stationList.addAll(site);
|
||||
|
||||
for ( int i = 0; i < stationList.size(); i++ ) {
|
||||
BusStationBean s = stationList.get( i );
|
||||
for (int i = 0; i < stationList.size(); i++) {
|
||||
BusStationBean s = stationList.get(i);
|
||||
|
||||
CallerLogger.INSTANCE.d( M_BUS + "updateBusStationsStatus--",
|
||||
"Index="+ i+" ,name = "+s.getName()+" ,"+s.isLeaving()+","+s.getDrivingStatus());
|
||||
CallerLogger.INSTANCE.d(M_BUS + "updateBusStationsStatus--",
|
||||
"Index=" + i + " ,name = " + s.getName() + " ," + s.isLeaving() + "," + s.getDrivingStatus());
|
||||
|
||||
// 是否正在开往下一站
|
||||
if ( s.isLeaving()) {
|
||||
if (s.isLeaving()) {
|
||||
isGoingToNextStation = true;
|
||||
}
|
||||
// 当前站点信息
|
||||
if (s.getDrivingStatus() == STATION_STATUS_STOPPED ) {
|
||||
if (s.getDrivingStatus() == STATION_STATUS_STOPPED) {
|
||||
backgroundCurrentStationIndex = i;
|
||||
break;
|
||||
}
|
||||
@@ -796,40 +796,40 @@ public class BusOrderModel {
|
||||
|
||||
if (backgroundCurrentStationIndex == 0 &&
|
||||
stationList.get(0).getDrivingStatus() == STATION_STATUS_STOPPED
|
||||
&& !stationList.get(0).isLeaving()){ //默认是第一站到站查询
|
||||
if (busRoutesResult != null){ // 第一站到站也是行程开始的时候
|
||||
&& !stationList.get(0).isLeaving()) { //默认是第一站到站查询
|
||||
if (busRoutesResult != null) { // 第一站到站也是行程开始的时候
|
||||
BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.START_TRIP
|
||||
,busRoutesResult.getName(),"","",false);
|
||||
, busRoutesResult.getName(), "", "", false);
|
||||
}
|
||||
startOrStopQueryPassengerWriteOff(true);
|
||||
}
|
||||
|
||||
BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex);
|
||||
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG,
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,
|
||||
"行程日志-STATION_STATUS_STOPPED-backgroundCurrentStationIndex="
|
||||
+backgroundCurrentStationIndex
|
||||
+" isLeaving()="+currentStation.isLeaving());
|
||||
+ backgroundCurrentStationIndex
|
||||
+ " isLeaving()=" + currentStation.isLeaving());
|
||||
|
||||
// 美化是否开始
|
||||
if (FunctionBuildConfig.isDemoMode && (backgroundCurrentStationIndex >= 0
|
||||
&& backgroundCurrentStationIndex <= stationList.size()-1)){//行驶过程中设置美化
|
||||
if (stationList.get(backgroundCurrentStationIndex).isLeaving()){
|
||||
&& backgroundCurrentStationIndex <= stationList.size() - 1)) {//行驶过程中设置美化
|
||||
if (stationList.get(backgroundCurrentStationIndex).isLeaving()) {
|
||||
startBeautificationMode();
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为true(每次滑动出发)");
|
||||
}else if (backgroundCurrentStationIndex >0 && backgroundCurrentStationIndex < stationList.size()-1){
|
||||
} else if (backgroundCurrentStationIndex > 0 && backgroundCurrentStationIndex < stationList.size() - 1) {
|
||||
//美化模式下 中间站点到站 引导线要一直绘制,所以此处不出强制绘制不传false
|
||||
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false);
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:false(到达中间站)");
|
||||
clearStartAutopilotTag();
|
||||
}else{
|
||||
} else {
|
||||
closeBeautificationMode();
|
||||
clearStartAutopilotTag();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( currentStation.isLeaving() && slidePanelHideCallback != null) {
|
||||
if (currentStation.isLeaving() && slidePanelHideCallback != null) {
|
||||
slidePanelHideCallback.hideSlidePanel();
|
||||
}
|
||||
|
||||
@@ -850,8 +850,8 @@ public class BusOrderModel {
|
||||
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(true);
|
||||
}
|
||||
|
||||
public void clearBusStationDatas(){
|
||||
if (refreshBusStationsCallback != null){
|
||||
public void clearBusStationDatas() {
|
||||
if (refreshBusStationsCallback != null) {
|
||||
refreshBusStationsCallback.clearBusStationsMarkers();
|
||||
}
|
||||
}
|
||||
@@ -860,19 +860,19 @@ public class BusOrderModel {
|
||||
* 延时查询站点信心
|
||||
*/
|
||||
private void queryBusStationDelay() {
|
||||
handler.sendEmptyMessageDelayed( MSG_QUERY_BUS_STATION, QUERY_BUS_STATION_DELAY );
|
||||
handler.sendEmptyMessageDelayed(MSG_QUERY_BUS_STATION, QUERY_BUS_STATION_DELAY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 在踩刹车、控制方向盘等操作后,会停止自动驾驶,重启自动驾驶的话相当于重新设置自动驾驶目的地
|
||||
*/
|
||||
public void restartAutopilot() {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "行程日志-重启自动驾驶===" + isGoingToNextStation );
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-重启自动驾驶===" + isGoingToNextStation);
|
||||
//只去启动自动驾驶,不再去上报离站
|
||||
startAutopilot(firstStartAutopilot >= 1,-1);
|
||||
startAutopilot(firstStartAutopilot >= 1, -1);
|
||||
}
|
||||
|
||||
public boolean isRestartAutopilot(){
|
||||
public boolean isRestartAutopilot() {
|
||||
return firstStartAutopilot > 1;
|
||||
}
|
||||
|
||||
@@ -881,11 +881,11 @@ public class BusOrderModel {
|
||||
*/
|
||||
private void travelOver() {
|
||||
|
||||
if ( backgroundCurrentStationIndex >= stationList.size() ) {
|
||||
CallerLogger.INSTANCE.e( M_BUS + TAG, "travel over index out of station list" );
|
||||
if (backgroundCurrentStationIndex >= stationList.size()) {
|
||||
CallerLogger.INSTANCE.e(M_BUS + TAG, "travel over index out of station list");
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "单程结束====" );
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "单程结束====");
|
||||
CallerAutoPilotManager.INSTANCE.cancelAutoPilot();
|
||||
|
||||
endTask();
|
||||
@@ -895,13 +895,13 @@ public class BusOrderModel {
|
||||
* task正常结束
|
||||
*/
|
||||
private void endTask() {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "任务正常走完endTask()");
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "任务正常走完endTask()");
|
||||
BusServiceManager.endTask(mContext, currentTaskId
|
||||
, new OchCommonServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "endTask success: " + o);
|
||||
if (o.code == 0){
|
||||
if (o.code == 0) {
|
||||
endOrAbortTaskSuccess();
|
||||
clearBusStationDatas();
|
||||
queryBusRoutes();// 重新获取任务
|
||||
@@ -919,28 +919,29 @@ public class BusOrderModel {
|
||||
|
||||
/**
|
||||
* 到站
|
||||
*
|
||||
* @param data
|
||||
*/
|
||||
public void onArriveAt( MessagePad.ArrivalNotification data){
|
||||
if ( backgroundCurrentStationIndex +1 > stationList.size() - 1 ) {
|
||||
CallerLogger.INSTANCE.e( M_BUS + TAG, "行程日志-到站异常,取消后续操作结束" );
|
||||
public void onArriveAt(MessagePad.ArrivalNotification data) {
|
||||
if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) {
|
||||
CallerLogger.INSTANCE.e(M_BUS + TAG, "行程日志-到站异常,取消后续操作结束");
|
||||
return;
|
||||
}
|
||||
|
||||
//MAP 280 每隔100ms左右返回一次到站, 导致在到达中间站后再次滑动出发后会有时间差,收到一次到站,出现问题
|
||||
//此处比对 自驾告诉的到站站点坐标和本地应到站站点坐标, 一致时才能到站
|
||||
if (data != null && data.getEndLocation() != null){
|
||||
if (data != null && data.getEndLocation() != null) {
|
||||
|
||||
String latitude = NumberFormatUtil.cutOutNumber(data.getEndLocation().getLatitude(),5); //wgs
|
||||
String longitude = NumberFormatUtil.cutOutNumber(data.getEndLocation().getLongitude(),5);
|
||||
String latitude = NumberFormatUtil.cutOutNumber(data.getEndLocation().getLatitude(), 5); //wgs
|
||||
String longitude = NumberFormatUtil.cutOutNumber(data.getEndLocation().getLongitude(), 5);
|
||||
|
||||
int arrivedStationIndex = backgroundCurrentStationIndex + 1;
|
||||
BusStationBean arriveStation = stationList.get(arrivedStationIndex);
|
||||
String arriveLat = NumberFormatUtil.cutOutNumber(arriveStation.getLat(),5);
|
||||
String arriveLon = NumberFormatUtil.cutOutNumber(arriveStation.getLon(),5);
|
||||
String arriveLat = NumberFormatUtil.cutOutNumber(arriveStation.getLat(), 5);
|
||||
String arriveLon = NumberFormatUtil.cutOutNumber(arriveStation.getLon(), 5);
|
||||
|
||||
if (!latitude.equals(arriveLat) || !longitude.equals(arriveLon)){
|
||||
CallerLogger.INSTANCE.e( M_BUS + TAG, "行程日志-到站拦截,到站坐标不一致" );
|
||||
if (!latitude.equals(arriveLat) || !longitude.equals(arriveLon)) {
|
||||
CallerLogger.INSTANCE.e(M_BUS + TAG, "行程日志-到站拦截,到站坐标不一致");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -948,7 +949,7 @@ public class BusOrderModel {
|
||||
if (isArrivedStation) return;
|
||||
isArrivedStation = true;
|
||||
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "行程日志-当前==backgroundCurrentStationIndex="
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-当前==backgroundCurrentStationIndex="
|
||||
+ backgroundCurrentStationIndex);
|
||||
|
||||
isGoingToNextStation = false;
|
||||
@@ -987,25 +988,25 @@ public class BusOrderModel {
|
||||
|
||||
// 登出
|
||||
public void logout() {
|
||||
loginService.loginOut(mLatitude,mLongitude);
|
||||
loginService.loginOut(mLatitude, mLongitude);
|
||||
}
|
||||
|
||||
public void triggerStartServiceEvent(boolean isRestart, boolean send) {
|
||||
if (stationList == null || backgroundCurrentStationIndex >= stationList.size()-1) {
|
||||
if (stationList == null || backgroundCurrentStationIndex >= stationList.size() - 1) {
|
||||
return;
|
||||
}
|
||||
BusStationBean currentStation = stationList.get( backgroundCurrentStationIndex);
|
||||
BusStationBean nextStation = stationList.get( backgroundCurrentStationIndex +1);
|
||||
BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex);
|
||||
BusStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1);
|
||||
BusAnalyticsManager.getInstance().triggerStartAutopilotEvent(isRestart, send,
|
||||
currentStation.getName(), nextStation.getName(), currentLineId);
|
||||
}
|
||||
|
||||
public void triggerUnableStartAPReasonEvent() {
|
||||
if (stationList == null || backgroundCurrentStationIndex >= stationList.size()-1) {
|
||||
if (stationList == null || backgroundCurrentStationIndex >= stationList.size() - 1) {
|
||||
return;
|
||||
}
|
||||
BusStationBean currentStation = stationList.get( backgroundCurrentStationIndex);
|
||||
BusStationBean nextStation = stationList.get( backgroundCurrentStationIndex +1);
|
||||
BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex);
|
||||
BusStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1);
|
||||
BusAnalyticsManager.getInstance().triggerUnableStartAPReasonEvent(
|
||||
currentStation.getName(), nextStation.getName(), currentLineId,
|
||||
OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason());
|
||||
@@ -1025,7 +1026,7 @@ public class BusOrderModel {
|
||||
private void updateAutopilotControlParameters() {
|
||||
|
||||
AutopilotControlParameters parameters = initAutopilotControlParameters(-1);
|
||||
if (null == parameters){
|
||||
if (null == parameters) {
|
||||
CallerLogger.INSTANCE.e(M_BUS + TAG, "AutopilotControlParameters is empty.");
|
||||
return;
|
||||
}
|
||||
@@ -1033,7 +1034,7 @@ public class BusOrderModel {
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.updateAutopilotControlParameters(parameters);
|
||||
}
|
||||
|
||||
private void clearAutopilotControlParameters(){
|
||||
private void clearAutopilotControlParameters() {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "AutopilotControlParameters is clear.");
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.updateAutopilotControlParameters(null);
|
||||
}
|
||||
@@ -1042,20 +1043,20 @@ public class BusOrderModel {
|
||||
BusStationBean currentStation = null;
|
||||
BusStationBean nextStation = null;
|
||||
|
||||
if (leaveIndex < 0){
|
||||
if (backgroundCurrentStationIndex +1 > stationList.size() - 1 || !isGoingToNextStation){
|
||||
if (leaveIndex < 0) {
|
||||
if (backgroundCurrentStationIndex + 1 > stationList.size() - 1 || !isGoingToNextStation) {
|
||||
CallerLogger.INSTANCE.e(M_BUS + TAG, "行程日志-mismatch condition1.");
|
||||
return null;
|
||||
}
|
||||
currentStation = stationList.get( backgroundCurrentStationIndex);
|
||||
nextStation = stationList.get( backgroundCurrentStationIndex + 1);
|
||||
}else {
|
||||
if (leaveIndex +1 > stationList.size() - 1 || !isGoingToNextStation){
|
||||
currentStation = stationList.get(backgroundCurrentStationIndex);
|
||||
nextStation = stationList.get(backgroundCurrentStationIndex + 1);
|
||||
} else {
|
||||
if (leaveIndex + 1 > stationList.size() - 1 || !isGoingToNextStation) {
|
||||
CallerLogger.INSTANCE.e(M_BUS + TAG, "行程日志-mismatch condition2.");
|
||||
return null;
|
||||
}
|
||||
currentStation = stationList.get( leaveIndex);
|
||||
nextStation = stationList.get( leaveIndex + 1);
|
||||
currentStation = stationList.get(leaveIndex);
|
||||
nextStation = stationList.get(leaveIndex + 1);
|
||||
}
|
||||
|
||||
AutopilotControlParameters parameters = new AutopilotControlParameters();
|
||||
@@ -1064,9 +1065,9 @@ public class BusOrderModel {
|
||||
parameters.startName = PinYinUtil.getPinYinHeadChar(currentStation.getName());
|
||||
parameters.endName = PinYinUtil.getPinYinHeadChar(nextStation.getName());
|
||||
parameters.startLatLon = new AutopilotControlParameters
|
||||
.AutoPilotLonLat( currentStation.getLat(), currentStation.getLon() );
|
||||
.AutoPilotLonLat(currentStation.getLat(), currentStation.getLon());
|
||||
parameters.endLatLon = new AutopilotControlParameters
|
||||
.AutoPilotLonLat( nextStation.getLat(), nextStation.getLon() );
|
||||
.AutoPilotLonLat(nextStation.getLat(), nextStation.getLon());
|
||||
parameters.vehicleType = VEHICLE_TYPE;
|
||||
if (parameters.autoPilotLine == null) {
|
||||
parameters.autoPilotLine = new AutopilotControlParameters.AutoPilotLine(
|
||||
|
||||
@@ -10,7 +10,6 @@ import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.PagerSnapHelper
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.commons.mvp.MvpActivity
|
||||
import com.mogo.eagle.core.utilcode.util.SharedPrefs
|
||||
@@ -18,7 +17,7 @@ import com.mogo.och.bus.presenter.BusLinePresenter
|
||||
import com.mogo.och.bus.ui.adapter.SwitchLineAdapter
|
||||
import com.mogo.och.bus.bean.BusQueryLinesResponse
|
||||
import com.mogo.och.bus.ui.adapter.OpenItemAnimator
|
||||
import com.mogo.module.common.view.SpacesItemDecoration
|
||||
import com.mogo.eagle.core.utilcode.mogo.view.SpacesItemDecoration
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.bus.R
|
||||
import com.mogo.och.bus.bean.BusQueryLineTaskResponse
|
||||
@@ -74,7 +73,11 @@ class BusSwitchLineActivity : MvpActivity<BusSwitchLineView?, BusLinePresenter?>
|
||||
mLinesListView.setLayoutManager(linearLayoutManager)
|
||||
mLinesListView.setItemAnimator(OpenItemAnimator())
|
||||
mAdapter = SwitchLineAdapter(applicationContext, mData)
|
||||
mLinesListView.addItemDecoration(SpacesItemDecoration(4))
|
||||
mLinesListView.addItemDecoration(
|
||||
SpacesItemDecoration(
|
||||
4
|
||||
)
|
||||
)
|
||||
mLinesListView.setAdapter(mAdapter)
|
||||
//设置item 点击事件
|
||||
mAdapter.setOnLineItemClickListener(object :SwitchLineAdapter.LineItemClickListener{
|
||||
|
||||
@@ -64,6 +64,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_v2x
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_hmi
|
||||
}else {
|
||||
implementation project(":core:mogo-core-utils")
|
||||
implementation project(":foudations:mogo-commons")
|
||||
@@ -71,6 +72,7 @@ dependencies {
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
implementation project(':core:function-impl:mogo-core-function-v2x')
|
||||
implementation project(':core:function-impl:mogo-core-function-hmi')
|
||||
}
|
||||
|
||||
implementation project(':libraries:mogo-adas')
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.mogo.och.common.module.wigets
|
||||
import android.content.Context
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.mogo.och.common.module.R
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,8 +7,8 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
||||
import com.mogo.commons.module.status.StatusDescriptor;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -8,13 +8,13 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.module.status.StatusDescriptor;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.och.sweeper.constant.SweeperConst;
|
||||
import com.mogo.och.sweeper.fragment.SweeperFragment;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -44,7 +44,7 @@ public class SweeperProvider implements IMogoOCH {
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("OchSweeper"
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener("OchSweeper"
|
||||
, StatusDescriptor.VR_MODE, statusChangedListener);
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class SweeperProvider implements IMogoOCH {
|
||||
} else {
|
||||
hideFragment();
|
||||
}
|
||||
} else if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
} else if (MogoStatusManager.getInstance().isVrMode()) {
|
||||
// topView进行展示时推出网约车界面,但是不隐藏整个fragment
|
||||
if (sweeperFragment != null && isTrue) {
|
||||
sweeperFragment.hideOchSweeper();
|
||||
|
||||
@@ -20,10 +20,12 @@ import androidx.constraintlayout.widget.Group;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.module.intent.IntentManager;
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig;
|
||||
import com.mogo.eagle.core.data.constants.DataTypes;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
@@ -32,6 +34,7 @@ import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
@@ -39,8 +42,6 @@ import com.mogo.map.MogoMarkerManager;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.constants.DataTypes;
|
||||
import com.mogo.module.common.view.OnPreventFastClickListener;
|
||||
import com.mogo.och.sweeper.R;
|
||||
import com.mogo.och.sweeper.bean.SweeperRoutesResult;
|
||||
import com.mogo.och.sweeper.constant.SweeperConst;
|
||||
@@ -74,7 +75,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
private FrameLayout flStationPanelContainer;
|
||||
private Group groupTestPanel;
|
||||
private FrameLayout flSpeed;
|
||||
// private BusArcView mouduleArc;
|
||||
// private BusArcView mouduleArc;
|
||||
private TrafficDataView mTrafficDataView;
|
||||
private ImageView mUpgradeTipIv;
|
||||
// private BusTrafficLightView mTrafficLightView;
|
||||
@@ -154,17 +155,16 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "长按显示状态工具栏");
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("oper", 52);
|
||||
MogoApisHandler.getInstance().getApis().getIntentManagerApi().invoke("com.mogo.mock", intent);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
initListener();
|
||||
ctvAutopilotStatus.setOnClickListener(new OnPreventFastClickListener(){
|
||||
ctvAutopilotStatus.setOnClickListener(new OnPreventFastClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClickImpl(View v) {
|
||||
// if (CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState() != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE){
|
||||
restartAutopilot();
|
||||
restartAutopilot();
|
||||
// }else {
|
||||
// ToastUtils.showShort(getResources().getString(R.string.sweeper_auto_disable_tip));
|
||||
// }
|
||||
@@ -220,12 +220,12 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
}
|
||||
|
||||
mAICollectBtn = findViewById(R.id.module_mogo_och_ai_collet_rl);
|
||||
if (mAICollectBtn != null){
|
||||
if (mAICollectBtn != null) {
|
||||
CallerDevaToolsManager.INSTANCE.initAiCollect(mAICollectBtn);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateSwitchMapIcon(){
|
||||
private void updateSwitchMapIcon() {
|
||||
if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isLongSight()) {
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_long);
|
||||
} else if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isMediumSight()) {
|
||||
@@ -323,13 +323,13 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
ctvAutopilotStatus.setFocusableInTouchMode(true);
|
||||
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == autopilotStatus) {//1可用
|
||||
ctvAutopilotStatus.setSelected(false);
|
||||
}else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == autopilotStatus){
|
||||
} else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == autopilotStatus) {
|
||||
ctvAutopilotStatus.setSelected(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void updateAutopilotStatus(int autopilotStatus){
|
||||
public void updateAutopilotStatus(int autopilotStatus) {
|
||||
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
|
||||
== autopilotStatus) {//2 running
|
||||
ctvAutopilotStatusIv.setImageResource(R.drawable.sweeper_right_autopilot_icon);
|
||||
@@ -337,7 +337,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
ctvAutopilotStatusTv.setText(getResources().getString(R.string.sweeper_loading_autopilot_success_tv));
|
||||
ctvAutopilotStatus.setSelected(false);
|
||||
ctvAutopilotStatus.setFocusableInTouchMode(false);
|
||||
}else {
|
||||
} else {
|
||||
ctvAutopilotStatusIv.setImageResource(R.drawable.sweeper_wrong_autopilot_icon);
|
||||
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.sweeper_autopilot_text_color_normal));
|
||||
ctvAutopilotStatusTv.setText(getResources().getString(R.string.sweeper_loading_autopilot_failure_tv));
|
||||
@@ -349,7 +349,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
public void run() {
|
||||
setAutopilotBtnStatus(autopilotStatus);
|
||||
}
|
||||
},1000);
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
private void changeAutopilotBtnView(int autopilotStatus, boolean isAnimateRunning) {
|
||||
@@ -360,10 +360,10 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
// 主动开启自动驾驶中,不为2(为0、1)则继续loading
|
||||
return;
|
||||
}
|
||||
if (isAnimateRunning){
|
||||
if (isAnimateRunning) {
|
||||
stopAutopilotAnimation();
|
||||
updateAutopilotStatus(autopilotStatus);
|
||||
}else {
|
||||
} else {
|
||||
setAutopilotBtnStatus(autopilotStatus);
|
||||
}
|
||||
|
||||
@@ -417,6 +417,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
/**
|
||||
* 获取清扫车操作面板layout id
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public abstract int getSweepOperatePanelViewId();
|
||||
@@ -455,19 +456,20 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
}
|
||||
|
||||
private void startingAutoApilotCountDown(){
|
||||
private void startingAutoApilotCountDown() {
|
||||
//10s 若自动驾驶没有开启,则结束动画
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() { //未启动成功做处理
|
||||
if (isAnimateRunning){// 只判断动画是否在进行,根据自动驾驶当前状态去设置自动驾驶状态
|
||||
if (isAnimateRunning) {// 只判断动画是否在进行,根据自动驾驶当前状态去设置自动驾驶状态
|
||||
stopAutopilotAnimation();
|
||||
updateAutopilotStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState());
|
||||
}
|
||||
}
|
||||
},TIMER_START_AUTOPILOT_INTERVAL);
|
||||
}, TIMER_START_AUTOPILOT_INTERVAL);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止自动驾驶中间动画
|
||||
*/
|
||||
@@ -487,7 +489,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
*/
|
||||
public void updateSpeedView(float newSpeed) {
|
||||
int speed = (int) (Math.abs(newSpeed) * 3.6F); // 倒车时工控机反馈定位信息中speed为负值
|
||||
if (mTrafficDataView != null){
|
||||
if (mTrafficDataView != null) {
|
||||
mTrafficDataView.updateSpeedWithValue(speed);
|
||||
}
|
||||
}
|
||||
@@ -522,7 +524,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
/**
|
||||
* Bus调试信息:线路、轨迹等信息
|
||||
*
|
||||
* <p>
|
||||
* START
|
||||
*/
|
||||
private View busTestBar;
|
||||
|
||||
@@ -15,6 +15,9 @@ import com.elegant.network.utils.GsonUtil;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.module.status.StatusDescriptor;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
@@ -47,8 +50,6 @@ import com.mogo.och.sweeper.util.SweeperAnalyticsManager;
|
||||
import com.mogo.och.sweeper.util.SweeperTrajectoryManager;
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
|
||||
import com.mogo.och.common.module.utils.PinYinUtil;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.zhjt.service.chain.ChainLog;
|
||||
import com.zhjt.service.chain.TracingConstants;
|
||||
|
||||
@@ -64,7 +65,7 @@ import mogo.telematics.pad.MessagePad;
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2021/3/23
|
||||
*
|
||||
* <p>
|
||||
* 小巴订单管理
|
||||
*/
|
||||
public class SweeperOrderModel {
|
||||
@@ -101,21 +102,18 @@ public class SweeperOrderModel {
|
||||
|
||||
private volatile boolean isArrivedStation = false;
|
||||
|
||||
private final Handler handler = new Handler(new Handler.Callback() {
|
||||
@Override
|
||||
public boolean handleMessage(Message msg) {
|
||||
if ( msg.what == MSG_QUERY_BUS_STATION ) {
|
||||
SweeperOrderModel.getInstance().querySweeperRoutes();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
private final Handler handler = new Handler(msg -> {
|
||||
if (msg.what == MSG_QUERY_BUS_STATION) {
|
||||
SweeperOrderModel.getInstance().querySweeperRoutes();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
public static SweeperOrderModel getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( SweeperOrderModel.class ) {
|
||||
if ( sInstance == null ) {
|
||||
if (sInstance == null) {
|
||||
synchronized (SweeperOrderModel.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new SweeperOrderModel();
|
||||
}
|
||||
}
|
||||
@@ -136,10 +134,7 @@ public class SweeperOrderModel {
|
||||
.getApis()
|
||||
.getRegisterCenterApi()
|
||||
.registerCarLocationChangedListener(TAG, mCarLocationChangedListener2);
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getStatusManagerApi()
|
||||
.registerStatusChangedListener( TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener );
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
//自动驾驶路线规划接口
|
||||
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
|
||||
@@ -154,45 +149,45 @@ public class SweeperOrderModel {
|
||||
public void accept(Throwable e) {
|
||||
if (e instanceof UndeliverableException) {
|
||||
e = e.getCause();
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"UndeliverableException");
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "UndeliverableException");
|
||||
}
|
||||
if ((e instanceof IOException)) {//
|
||||
// fine, irrelevant network problem or API that throws on cancellation
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"IOException");
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "IOException");
|
||||
return;
|
||||
}
|
||||
if (e instanceof InterruptedException) {
|
||||
// fine, some blocking code was interrupted by a dispose call
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"InterruptedException");
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "InterruptedException");
|
||||
return;
|
||||
}
|
||||
if ((e instanceof NullPointerException) || (e instanceof IllegalArgumentException)) {
|
||||
// that's likely a bug in the application
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"NullPointerException or IllegalArgumentException");
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "NullPointerException or IllegalArgumentException");
|
||||
Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e);
|
||||
return;
|
||||
}
|
||||
if (e instanceof IllegalStateException) {
|
||||
// that's a bug in RxJava or in a custom operator
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"IllegalStateException");
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "IllegalStateException");
|
||||
Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e);
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"Undeliverable exception");
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "Undeliverable exception");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void setCarOperationStatusCallback(ICarOperationStatusCallback callback){
|
||||
public void setCarOperationStatusCallback(ICarOperationStatusCallback callback) {
|
||||
this.carOperationStatusCallback = callback;
|
||||
}
|
||||
|
||||
public void setRefreshBusStationsCallback(IRefreshSweeperStationsCallback callback){
|
||||
public void setRefreshBusStationsCallback(IRefreshSweeperStationsCallback callback) {
|
||||
this.refreshBusStationsCallback = callback;
|
||||
}
|
||||
|
||||
public void setSlidePannelHideCallback(ISlidePannelHideCallback callback){
|
||||
public void setSlidePannelHideCallback(ISlidePannelHideCallback callback) {
|
||||
this.slidePannelHideCallback = callback;
|
||||
}
|
||||
|
||||
@@ -209,9 +204,9 @@ public class SweeperOrderModel {
|
||||
|
||||
@Override
|
||||
public void onAutopilotRotting(MessagePad.GlobalPathResp routeList) {
|
||||
if (null != routeList && routeList.getWayPointsList().size() > 0){
|
||||
if (null != routeList && routeList.getWayPointsList().size() > 0) {
|
||||
points.clear();
|
||||
points.addAll(coordinateConverterWgsToGcjList(mContext,routeList.getWayPointsList()));
|
||||
points.addAll(coordinateConverterWgsToGcjList(mContext, routeList.getWayPointsList()));
|
||||
updateOrderRoute();
|
||||
}
|
||||
}
|
||||
@@ -234,12 +229,12 @@ public class SweeperOrderModel {
|
||||
* 上报订单全路径规划数据
|
||||
*/
|
||||
public void updateOrderRoute() {
|
||||
if (!isGoingToNextStation || backgroundCurrentStationIndex+1 >= stationList.size() || points.size() == 0){
|
||||
if (!isGoingToNextStation || backgroundCurrentStationIndex + 1 >= stationList.size() || points.size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
SweeperStationBean currentStation = stationList.get( backgroundCurrentStationIndex);
|
||||
SweeperStationBean nextStation = stationList.get( backgroundCurrentStationIndex +1);
|
||||
SweeperStationBean currentStation = stationList.get(backgroundCurrentStationIndex);
|
||||
SweeperStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1);
|
||||
|
||||
SweeperServiceManager.getInstance().updateOrderRoute(mContext, currentLineId, currentStation.getSiteId()
|
||||
, nextStation.getSiteId(), points, new ISweeperServiceCallback<BaseData>() {
|
||||
@@ -250,26 +245,22 @@ public class SweeperOrderModel {
|
||||
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
if (isGoingToNextStation){//重试
|
||||
if (isGoingToNextStation) {//重试
|
||||
updateOrderRoute();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void debugUpdateOrderRoute(List<MessagePad.Location> list){
|
||||
public void debugUpdateOrderRoute(List<MessagePad.Location> list) {
|
||||
points.clear();
|
||||
points.addAll(coordinateConverterWgsToGcjList(mContext,list));
|
||||
points.addAll(coordinateConverterWgsToGcjList(mContext, list));
|
||||
updateOrderRoute();
|
||||
}
|
||||
|
||||
public void release(){
|
||||
public void release() {
|
||||
startOrStopOrderLoop(false);
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getStatusManagerApi()
|
||||
.unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
// 注销到达起始站围栏监听
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
@@ -285,7 +276,7 @@ public class SweeperOrderModel {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private IMogoStatusChangedListener mMogoStatusChangedListener = new IMogoStatusChangedListener() {
|
||||
private final IMogoStatusChangedListener mMogoStatusChangedListener = new IMogoStatusChangedListener() {
|
||||
// VR mode变更回调
|
||||
@Override
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
@@ -301,7 +292,7 @@ public class SweeperOrderModel {
|
||||
private final IMogoCarLocationChangedListener2 mCarLocationChangedListener2 = new IMogoCarLocationChangedListener2() {
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged2( Location location ) {
|
||||
public void onCarLocationChanged2(Location location) {
|
||||
// CallerLogger.INSTANCE.d(M_BUS + TAG,"location = "+location.getLongitude()+","+location.getLatitude());
|
||||
mLongitude = location.getLongitude();
|
||||
mLatitude = location.getLatitude();
|
||||
@@ -310,7 +301,7 @@ public class SweeperOrderModel {
|
||||
}
|
||||
|
||||
//是否到站的围栏判断 离站状态并且自动驾驶还未触发到站
|
||||
if (isGoingToNextStation && !isArrivedStation){
|
||||
if (isGoingToNextStation && !isArrivedStation) {
|
||||
judgeStartStation(location);
|
||||
}
|
||||
}
|
||||
@@ -319,26 +310,26 @@ public class SweeperOrderModel {
|
||||
//根据围栏判断,是否到达起点
|
||||
private void judgeStartStation(Location location) {
|
||||
|
||||
if (backgroundCurrentStationIndex +1 > stationList.size() - 1 ){
|
||||
if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) {
|
||||
return;
|
||||
}
|
||||
SweeperStationBean upcomingStation = stationList.get( backgroundCurrentStationIndex +1);
|
||||
SweeperStationBean upcomingStation = stationList.get(backgroundCurrentStationIndex + 1);
|
||||
|
||||
double startLon = upcomingStation.getGcjLon();
|
||||
double startLat = upcomingStation.getGcjLat();
|
||||
double distance = CoordinateUtils.calculateLineDistance(
|
||||
startLon, startLat,
|
||||
location.getLongitude(), location.getLatitude() );
|
||||
location.getLongitude(), location.getLatitude());
|
||||
|
||||
Logger.i(TAG, "judgeStartStation() distance = " + distance);
|
||||
|
||||
if ( distance > SweeperConst.ARRIVE_AT_END_STATION_DISTANCE ) {
|
||||
if (distance > SweeperConst.ARRIVE_AT_END_STATION_DISTANCE) {
|
||||
distance = CoordinateUtils.calculateLineDistance(startLon, startLat,
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon(),
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat());
|
||||
}
|
||||
|
||||
if ( distance <= SweeperConst.ARRIVE_AT_END_STATION_DISTANCE ) {
|
||||
if (distance <= SweeperConst.ARRIVE_AT_END_STATION_DISTANCE) {
|
||||
onArriveAt(null); //无自动驾驶到站信息传null
|
||||
return;
|
||||
}
|
||||
@@ -352,15 +343,16 @@ public class SweeperOrderModel {
|
||||
SweeperServiceManager.getInstance().queryBusRoutes(mContext, new ISweeperServiceCallback<SweeperRoutesResponse>() {
|
||||
@Override
|
||||
public void onSuccess(SweeperRoutesResponse data) {
|
||||
if ( data == null
|
||||
if (data == null
|
||||
|| data.getResult() == null
|
||||
|| data.getResult().getSites() == null
|
||||
|| data.getResult().getSites().isEmpty() ) {
|
||||
|| data.getResult().getSites().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据: " + data );
|
||||
renderBusStationsStatus( data.getResult());
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据: " + data);
|
||||
renderBusStationsStatus(data.getResult());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
// 重复请求小巴路线,直至成功
|
||||
@@ -374,62 +366,63 @@ public class SweeperOrderModel {
|
||||
* 测试、重置站点状态
|
||||
*/
|
||||
public void debugResetStationStatus() {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "测试、重置站点状态");
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "测试、重置站点状态");
|
||||
SweeperServiceManager.getInstance().resetStationStatus(mContext, currentLineId
|
||||
, new ISweeperServiceCallback<SweeperRoutesResponse>() {
|
||||
@Override
|
||||
public void onSuccess(SweeperRoutesResponse o) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据: " + o);
|
||||
isGoingToNextStation = false;
|
||||
if (o.getResult() == null || o.getResult().getSites() == null || o.getResult().getSites().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
renderBusStationsStatus(o.getResult());
|
||||
}
|
||||
@Override
|
||||
public void onSuccess(SweeperRoutesResponse o) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据: " + o);
|
||||
isGoingToNextStation = false;
|
||||
if (o.getResult() == null || o.getResult().getSites() == null || o.getResult().getSites().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
renderBusStationsStatus(o.getResult());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
// 重复请求小巴路线,直至成功
|
||||
queryBusStationDelay();
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
// 重复请求小巴路线,直至成功
|
||||
queryBusStationDelay();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 离站上报
|
||||
*/
|
||||
public void leaveStation(boolean isOneWayOver,boolean isRestart){
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"leaveStation-backgroundCurrentStationIndex = "+backgroundCurrentStationIndex);
|
||||
public void leaveStation(boolean isOneWayOver, boolean isRestart) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "leaveStation-backgroundCurrentStationIndex = " + backgroundCurrentStationIndex);
|
||||
SweeperServiceManager.getInstance().leaveStation(mContext, stationList.get(backgroundCurrentStationIndex).getSeq()
|
||||
, stationList.get(backgroundCurrentStationIndex).getSiteId(), new ISweeperServiceCallback<SweeperRoutesResponse>() {
|
||||
@Override
|
||||
public void onSuccess(SweeperRoutesResponse o) {
|
||||
if ( o.getResult() == null || o.getResult().getSites() == null || o.getResult().getSites().isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
isArrivedStation = false;
|
||||
if (!isOneWayOver){
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "自动驾驶开启开往下一站====" );
|
||||
//需要更改当前站和下一站的状态 然后渲染
|
||||
leaveStationSuccess(o.getResult(),isRestart);
|
||||
}else {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "单程真的结束了====" );
|
||||
isGoingToNextStation = false;
|
||||
backgroundCurrentStationIndex = 0;
|
||||
CallerAutoPilotManager.INSTANCE.cancelAutoPilot();
|
||||
querySweeperRoutes();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
}else{
|
||||
ToastUtils.showShort("离站上报失败:"+failMsg);
|
||||
}
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onSuccess(SweeperRoutesResponse o) {
|
||||
if (o.getResult() == null || o.getResult().getSites() == null || o.getResult().getSites().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
isArrivedStation = false;
|
||||
if (!isOneWayOver) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "自动驾驶开启开往下一站====");
|
||||
//需要更改当前站和下一站的状态 然后渲染
|
||||
leaveStationSuccess(o.getResult(), isRestart);
|
||||
} else {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "单程真的结束了====");
|
||||
isGoingToNextStation = false;
|
||||
backgroundCurrentStationIndex = 0;
|
||||
CallerAutoPilotManager.INSTANCE.cancelAutoPilot();
|
||||
querySweeperRoutes();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
} else {
|
||||
ToastUtils.showShort("离站上报失败:" + failMsg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -449,11 +442,12 @@ public class SweeperOrderModel {
|
||||
return;
|
||||
}
|
||||
isGoingToNextStation = true;
|
||||
AIAssist.getInstance( mContext ).speakTTSVoice( "欢迎乘坐’蘑菇车联‘无人驾驶小巴车,请您坐好,注意乘车安全,行程即将开始" );
|
||||
AIAssist.getInstance(mContext).speakTTSVoice("欢迎乘坐’蘑菇车联‘无人驾驶小巴车,请您坐好,注意乘车安全,行程即将开始");
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启自动驾驶
|
||||
*
|
||||
* @param isRestart
|
||||
*/
|
||||
private void startAutopilot(boolean isRestart) {
|
||||
@@ -491,7 +485,7 @@ public class SweeperOrderModel {
|
||||
// }
|
||||
// CallerLogger.INSTANCE.d( M_BUS + TAG, "开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
|
||||
// +" startLatLon="+currentStation.getName()+",endLatLon="+nextStation.getName());
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "开启自动驾驶====" + GsonUtil.jsonFromObject(parameters));
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "开启自动驾驶====" + GsonUtil.jsonFromObject(parameters));
|
||||
CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters);
|
||||
|
||||
if (mControllerStatusCallback != null) {
|
||||
@@ -503,23 +497,23 @@ public class SweeperOrderModel {
|
||||
* 到站后重置站点状态
|
||||
*/
|
||||
private void arriveSiteStation(boolean isRestart) {
|
||||
if ( backgroundCurrentStationIndex +1 > stationList.size() - 1 ) { //到站短时间内调用多次
|
||||
CallerLogger.INSTANCE.e( M_BUS + TAG, "数组越界" );
|
||||
if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) { //到站短时间内调用多次
|
||||
CallerLogger.INSTANCE.e(M_BUS + TAG, "数组越界");
|
||||
return;
|
||||
}
|
||||
int arrivedStationIndex = 0;
|
||||
if (!isRestart){
|
||||
if (!isRestart) {
|
||||
arrivedStationIndex = backgroundCurrentStationIndex + 1;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"arriveSiteStation-currentStationIndex = "+ arrivedStationIndex);
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "arriveSiteStation-currentStationIndex = " + arrivedStationIndex);
|
||||
|
||||
SweeperServiceManager.getInstance().arriveSiteStation(mContext
|
||||
, stationList.get(arrivedStationIndex).getSeq(), stationList.get(arrivedStationIndex).getSiteId()
|
||||
, new ISweeperServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"arriveSiteStation success");
|
||||
if (!isRestart){
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "arriveSiteStation success");
|
||||
if (!isRestart) {
|
||||
renderArriveBusStation();
|
||||
}
|
||||
}
|
||||
@@ -538,11 +532,11 @@ public class SweeperOrderModel {
|
||||
|
||||
private void renderArriveBusStation() {
|
||||
List<SweeperStationBean> site = sweeperRoutesResult.getSites();
|
||||
if (site != null && site.size() > 0){
|
||||
backgroundCurrentStationIndex ++;
|
||||
if (refreshBusStationsCallback != null){
|
||||
refreshBusStationsCallback.refreshBusStations(sweeperRoutesResult.getName(),stationList, backgroundCurrentStationIndex
|
||||
, getNextStopStation(),true);
|
||||
if (site != null && site.size() > 0) {
|
||||
backgroundCurrentStationIndex++;
|
||||
if (refreshBusStationsCallback != null) {
|
||||
refreshBusStationsCallback.refreshBusStations(sweeperRoutesResult.getName(), stationList, backgroundCurrentStationIndex
|
||||
, getNextStopStation(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -550,7 +544,7 @@ public class SweeperOrderModel {
|
||||
/**
|
||||
* 收车
|
||||
*/
|
||||
public void stopTakeOrder(){
|
||||
public void stopTakeOrder() {
|
||||
SweeperServiceManager.getInstance().stopTakeOrder(mContext, new ISweeperServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
@@ -560,12 +554,13 @@ public class SweeperOrderModel {
|
||||
startOrStopOrderLoop(mIsWorking);
|
||||
SweeperTrajectoryManager.getInstance().stopTrajReqLoop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
}else {
|
||||
ToastUtils.showShort("收车失败:"+failMsg);
|
||||
} else {
|
||||
ToastUtils.showShort("收车失败:" + failMsg);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -585,25 +580,26 @@ public class SweeperOrderModel {
|
||||
/**
|
||||
* 出车
|
||||
*/
|
||||
public void startTakeOrder(){
|
||||
public void startTakeOrder() {
|
||||
SweeperServiceManager.getInstance().startTakeOrder(mContext, new ISweeperServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
mIsWorking = !mIsWorking;
|
||||
startOrStopOrderLoop(mIsWorking);
|
||||
if ( stationList != null && stationList.size() > 0 ) {
|
||||
AIAssist.getInstance( mContext ).speakTTSVoice( "车辆已整备完毕,请前往"
|
||||
+ stationList.get( backgroundCurrentStationIndex ).getName() + "站点" );
|
||||
if (stationList != null && stationList.size() > 0) {
|
||||
AIAssist.getInstance(mContext).speakTTSVoice("车辆已整备完毕,请前往"
|
||||
+ stationList.get(backgroundCurrentStationIndex).getName() + "站点");
|
||||
}
|
||||
carOperationStatusCallback.changeOperationStatus(isWorking());
|
||||
querySweeperRoutes();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
}else {
|
||||
ToastUtils.showShort("出车失败:"+failMsg);
|
||||
} else {
|
||||
ToastUtils.showShort("出车失败:" + failMsg);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -613,34 +609,35 @@ public class SweeperOrderModel {
|
||||
* 查询运营状态
|
||||
*/
|
||||
public void queryOperationStatus() {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "查询运营状态");
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "查询运营状态");
|
||||
SweeperServiceManager.getInstance().queryOperationStatus(mContext
|
||||
, new ISweeperServiceCallback<SweeperOperationStatusResponse>() {
|
||||
@Override
|
||||
public void onSuccess(SweeperOperationStatusResponse o) {
|
||||
if ( o.data != null ) {
|
||||
mIsWorking = o.data.serviceStatus == 1;
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "查询运营状态 result.status: " + o.data.serviceStatus);
|
||||
startOrStopOrderLoop(mIsWorking);
|
||||
}
|
||||
carOperationStatusCallback.changeOperationStatus(isWorking());
|
||||
}
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
}else {
|
||||
ToastUtils.showShort("出车收车状态查询:"+failMsg);
|
||||
}
|
||||
@Override
|
||||
public void onSuccess(SweeperOperationStatusResponse o) {
|
||||
if (o.data != null) {
|
||||
mIsWorking = o.data.serviceStatus == 1;
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "查询运营状态 result.status: " + o.data.serviceStatus);
|
||||
startOrStopOrderLoop(mIsWorking);
|
||||
}
|
||||
carOperationStatusCallback.changeOperationStatus(isWorking());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
} else {
|
||||
ToastUtils.showShort("出车收车状态查询:" + failMsg);
|
||||
}
|
||||
// queryOperationStatus();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启自动驾驶到下一站
|
||||
*/
|
||||
public void autoDriveToNextStation( boolean isRestart ) {
|
||||
public void autoDriveToNextStation(boolean isRestart) {
|
||||
// if ( backgroundCurrentStationIndex >= stationList.size() - 1 ) {
|
||||
// // 当前站是最后一站,结束当前行程
|
||||
// travelOver();
|
||||
@@ -654,6 +651,7 @@ public class SweeperOrderModel {
|
||||
* 渲染站点信息
|
||||
* 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站,
|
||||
* 车机端展示 离开站为当前站点,前往站为下一站, 下一站到站后在置为当前站
|
||||
*
|
||||
* @param result
|
||||
*/
|
||||
private void renderBusStationsStatus(SweeperRoutesResult result) {
|
||||
@@ -662,19 +660,19 @@ public class SweeperOrderModel {
|
||||
List<SweeperStationBean> site = result.getSites();
|
||||
currentLineId = result.getLineId();
|
||||
stationList.clear();
|
||||
stationList.addAll( site );
|
||||
for ( int i = 0; i < stationList.size(); i++ ) {
|
||||
SweeperStationBean s = stationList.get( i );
|
||||
stationList.addAll(site);
|
||||
for (int i = 0; i < stationList.size(); i++) {
|
||||
SweeperStationBean s = stationList.get(i);
|
||||
|
||||
CallerLogger.INSTANCE.d( M_BUS + "renderBusStationsStatus--",
|
||||
"Index="+ i+" ,name = "+s.getName()+" ,"+s.isLeaving()+","+s.getDrivingStatus());
|
||||
CallerLogger.INSTANCE.d(M_BUS + "renderBusStationsStatus--",
|
||||
"Index=" + i + " ,name = " + s.getName() + " ," + s.isLeaving() + "," + s.getDrivingStatus());
|
||||
|
||||
// 是否正在开往下一站
|
||||
if ( s.isLeaving()) {
|
||||
if (s.isLeaving()) {
|
||||
isGoingToNextStation = true;
|
||||
}
|
||||
// 当前站点信息
|
||||
if (s.getDrivingStatus() == STATION_STATUS_STOPPED ) {
|
||||
if (s.getDrivingStatus() == STATION_STATUS_STOPPED) {
|
||||
backgroundCurrentStationIndex = i;
|
||||
break;
|
||||
}
|
||||
@@ -682,31 +680,31 @@ public class SweeperOrderModel {
|
||||
|
||||
SweeperStationBean currentStation = stationList.get(backgroundCurrentStationIndex);
|
||||
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG,
|
||||
"渲染站点信息服务端currentStationIndex="+backgroundCurrentStationIndex
|
||||
+" isLeaving()="+currentStation.isLeaving());
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,
|
||||
"渲染站点信息服务端currentStationIndex=" + backgroundCurrentStationIndex
|
||||
+ " isLeaving()=" + currentStation.isLeaving());
|
||||
|
||||
//当前站点是始发站,告诉服务端到达始发站。 如果没有这个节点, 服务器不知道始发站到达状态
|
||||
// ,订单开始站下在始发站的状态流转有问题
|
||||
if (backgroundCurrentStationIndex == 0 && !currentStation.isLeaving()){
|
||||
if (backgroundCurrentStationIndex == 0 && !currentStation.isLeaving()) {
|
||||
arriveSiteStation(true);
|
||||
}
|
||||
|
||||
// 美化是否开始
|
||||
if (FunctionBuildConfig.isDemoMode && (backgroundCurrentStationIndex >= 0
|
||||
&& backgroundCurrentStationIndex <= stationList.size()-1)
|
||||
&& stationList.get(backgroundCurrentStationIndex).isLeaving()){//行驶过程中设置美化
|
||||
&& backgroundCurrentStationIndex <= stationList.size() - 1)
|
||||
&& stationList.get(backgroundCurrentStationIndex).isLeaving()) {//行驶过程中设置美化
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true;
|
||||
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(true);
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为true(每次滑动出发)");
|
||||
}
|
||||
|
||||
if (refreshBusStationsCallback != null){
|
||||
refreshBusStationsCallback.refreshBusStations(result.getName(),stationList
|
||||
, backgroundCurrentStationIndex, getNextStopStation(),!currentStation.isLeaving());
|
||||
if (refreshBusStationsCallback != null) {
|
||||
refreshBusStationsCallback.refreshBusStations(result.getName(), stationList
|
||||
, backgroundCurrentStationIndex, getNextStopStation(), !currentStation.isLeaving());
|
||||
}
|
||||
|
||||
if ( currentStation.isLeaving() && slidePannelHideCallback != null) {
|
||||
if (currentStation.isLeaving() && slidePannelHideCallback != null) {
|
||||
slidePannelHideCallback.hideSlidePanel();
|
||||
}
|
||||
|
||||
@@ -720,12 +718,12 @@ public class SweeperOrderModel {
|
||||
* @return -1 当前已是最后一个站点
|
||||
*/
|
||||
private int getNextStopStation() {
|
||||
if ( backgroundCurrentStationIndex >= stationList.size() - 1 ) {
|
||||
if (backgroundCurrentStationIndex >= stationList.size() - 1) {
|
||||
return -1;
|
||||
}
|
||||
int nextStationIndex = backgroundCurrentStationIndex + 1;
|
||||
for ( ; nextStationIndex < stationList.size() - 1; nextStationIndex++ ) {
|
||||
if ( stationList.get( nextStationIndex ).getIfStop() == 1 ) {
|
||||
for (; nextStationIndex < stationList.size() - 1; nextStationIndex++) {
|
||||
if (stationList.get(nextStationIndex).getIfStop() == 1) {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -737,7 +735,7 @@ public class SweeperOrderModel {
|
||||
* 延时查询站点信心
|
||||
*/
|
||||
private void queryBusStationDelay() {
|
||||
handler.sendEmptyMessageDelayed( MSG_QUERY_BUS_STATION, QUERY_BUS_STATION_DELAY );
|
||||
handler.sendEmptyMessageDelayed(MSG_QUERY_BUS_STATION, QUERY_BUS_STATION_DELAY);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -755,26 +753,26 @@ public class SweeperOrderModel {
|
||||
*
|
||||
* @param awayPassengersResponse
|
||||
*/
|
||||
private void playLeavePassengersMsg( QueryLeaveAwayPassengersResponse awayPassengersResponse ) {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "播报下车乘客信息currentStationIndex="
|
||||
private void playLeavePassengersMsg(QueryLeaveAwayPassengersResponse awayPassengersResponse) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "播报下车乘客信息currentStationIndex="
|
||||
+ String.valueOf(backgroundCurrentStationIndex + 1));
|
||||
|
||||
if ( backgroundCurrentStationIndex +1 > stationList.size() - 1 ) {
|
||||
if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) {
|
||||
return;
|
||||
}
|
||||
String station = stationList.get( backgroundCurrentStationIndex+1 ).getName();
|
||||
StringBuilder builder = new StringBuilder( "已到达" );
|
||||
builder.append( station );
|
||||
if ( !station.endsWith( "站" ) ) {
|
||||
builder.append( "站" );
|
||||
String station = stationList.get(backgroundCurrentStationIndex + 1).getName();
|
||||
StringBuilder builder = new StringBuilder("已到达");
|
||||
builder.append(station);
|
||||
if (!station.endsWith("站")) {
|
||||
builder.append("站");
|
||||
}
|
||||
if ( awayPassengersResponse == null || awayPassengersResponse.data == null
|
||||
|| awayPassengersResponse.data.orders == null || awayPassengersResponse.data.orders.isEmpty() ) {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "播报下车乘客信息为null");
|
||||
if (awayPassengersResponse == null || awayPassengersResponse.data == null
|
||||
|| awayPassengersResponse.data.orders == null || awayPassengersResponse.data.orders.isEmpty()) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "播报下车乘客信息为null");
|
||||
} else {
|
||||
builder.append( ",请尾号为 " );
|
||||
for ( QueryLeaveAwayPassengersResponse.LeaveAwayPassenger leaveAwayPassenger : awayPassengersResponse.data.orders ) {
|
||||
if ( leaveAwayPassenger == null ) {
|
||||
builder.append(",请尾号为 ");
|
||||
for (QueryLeaveAwayPassengersResponse.LeaveAwayPassenger leaveAwayPassenger : awayPassengersResponse.data.orders) {
|
||||
if (leaveAwayPassenger == null) {
|
||||
continue;
|
||||
}
|
||||
String tailNum = null;
|
||||
@@ -784,23 +782,23 @@ public class SweeperOrderModel {
|
||||
e.printStackTrace();
|
||||
tailNum = leaveAwayPassenger.passengerPhone;
|
||||
}
|
||||
builder.append( tailNum ).append( "。" );
|
||||
builder.append(tailNum).append("。");
|
||||
}
|
||||
builder.append( "的乘客下车" );
|
||||
builder.append("的乘客下车");
|
||||
}
|
||||
builder.append(",带好随身物品,下车请注意安全");
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "TTS:" + builder.toString());
|
||||
AIAssist.getInstance( mContext ).speakTTSVoice( builder.toString() );
|
||||
AIAssist.getInstance(mContext).speakTTSVoice(builder.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改小巴运营状态
|
||||
*/
|
||||
public void onChangeOperationStatus() {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "修改小巴运营状态");
|
||||
if (isWorking()){//收车
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "修改小巴运营状态");
|
||||
if (isWorking()) {//收车
|
||||
stopTakeOrder();
|
||||
}else {//出车
|
||||
} else {//出车
|
||||
startTakeOrder();
|
||||
}
|
||||
}
|
||||
@@ -810,14 +808,14 @@ public class SweeperOrderModel {
|
||||
*/
|
||||
private void travelOver() {
|
||||
|
||||
if ( backgroundCurrentStationIndex >= stationList.size() ) {
|
||||
CallerLogger.INSTANCE.e( M_BUS + TAG, "travel over index out of station list" );
|
||||
if (backgroundCurrentStationIndex >= stationList.size()) {
|
||||
CallerLogger.INSTANCE.e(M_BUS + TAG, "travel over index out of station list");
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "单程结束====" );
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "单程结束====");
|
||||
CallerAutoPilotManager.INSTANCE.cancelAutoPilot();
|
||||
AIAssist.getInstance( mContext ).speakTTSVoice( "感谢您体验'蘑菇车联'无人驾驶小巴车,请您携带好随身物品,我们下次再见" );
|
||||
leaveStation(true,true);
|
||||
AIAssist.getInstance(mContext).speakTTSVoice("感谢您体验'蘑菇车联'无人驾驶小巴车,请您携带好随身物品,我们下次再见");
|
||||
leaveStation(true, true);
|
||||
}
|
||||
|
||||
public boolean isWorking() {
|
||||
@@ -826,9 +824,10 @@ public class SweeperOrderModel {
|
||||
|
||||
/**
|
||||
* 到站
|
||||
*
|
||||
* @param data
|
||||
*/
|
||||
public void onArriveAt( MessagePad.ArrivalNotification data){
|
||||
public void onArriveAt(MessagePad.ArrivalNotification data) {
|
||||
// if ( backgroundCurrentStationIndex +1 > stationList.size() - 1 ) {
|
||||
// CallerLogger.INSTANCE.e( M_BUS + TAG, "到站异常,取消后续操作结束" );
|
||||
// return;
|
||||
@@ -842,7 +841,7 @@ public class SweeperOrderModel {
|
||||
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false);
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为false(到最后一站)");
|
||||
}
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "到站====currentStationIndex=" + backgroundCurrentStationIndex);
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "到站====currentStationIndex=" + backgroundCurrentStationIndex);
|
||||
isGoingToNextStation = false;
|
||||
|
||||
// arriveSiteStation(false);//到站上报
|
||||
@@ -878,11 +877,11 @@ public class SweeperOrderModel {
|
||||
}
|
||||
|
||||
public void triggerStartServiceEvent(boolean isRestart, boolean send) {
|
||||
if (stationList == null || backgroundCurrentStationIndex >= stationList.size()-1) {
|
||||
if (stationList == null || backgroundCurrentStationIndex >= stationList.size() - 1) {
|
||||
return;
|
||||
}
|
||||
SweeperStationBean currentStation = stationList.get( backgroundCurrentStationIndex);
|
||||
SweeperStationBean nextStation = stationList.get( backgroundCurrentStationIndex +1);
|
||||
SweeperStationBean currentStation = stationList.get(backgroundCurrentStationIndex);
|
||||
SweeperStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1);
|
||||
SweeperAnalyticsManager.getInstance().triggerStartAutopilotEvent(isRestart, send,
|
||||
currentStation.getName(), nextStation.getName(), currentLineId);
|
||||
}
|
||||
|
||||
@@ -8,14 +8,13 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.module.status.StatusDescriptor;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.och.taxi.passenger.constant.TaxiPassengerConst;
|
||||
import com.mogo.och.taxi.passenger.ui.TaxiPassengerBaseFragment;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -27,26 +26,27 @@ public
|
||||
* <p>
|
||||
* 网约车-出租车-乘客端
|
||||
*/
|
||||
@Route( path = TaxiPassengerConst.PATH )
|
||||
@Route(path = TaxiPassengerConst.PATH)
|
||||
class MogoOCHTaxiPassenger implements IMogoOCH, IMogoStatusChangedListener {
|
||||
|
||||
private static final String TAG = "MogoOCHTaxiPassenger";
|
||||
private TaxiPassengerBaseFragment ochTaxiPassengerFragment;
|
||||
private FragmentActivity mActivity;
|
||||
private int mContainerId;
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
CallerLogger.INSTANCE.d( M_TAXI_P + TAG, "init" );
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("ochTaxi", StatusDescriptor.VR_MODE,this);
|
||||
public void init(Context context) {
|
||||
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "init");
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener("ochTaxi", StatusDescriptor.VR_MODE, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 进入鹰眼模式,设置手势缩放地图失效
|
||||
*/
|
||||
private void stepIntoVrMode() {
|
||||
CallerLogger.INSTANCE.d( M_TAXI_P + TAG, "进入vr模式" );
|
||||
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "进入vr模式");
|
||||
MogoMapUIController.getInstance()
|
||||
.stepInVrMode( false );
|
||||
.stepInVrMode(false);
|
||||
}
|
||||
|
||||
private void showFragment() {
|
||||
@@ -60,18 +60,18 @@ class MogoOCHTaxiPassenger implements IMogoOCH, IMogoStatusChangedListener {
|
||||
mActivity.getSupportFragmentManager().beginTransaction().show(ochTaxiPassengerFragment).commitAllowingStateLoss();
|
||||
}
|
||||
|
||||
private void hideFragment(){
|
||||
if (ochTaxiPassengerFragment != null){
|
||||
private void hideFragment() {
|
||||
if (ochTaxiPassengerFragment != null) {
|
||||
mActivity.getSupportFragmentManager().beginTransaction().hide(ochTaxiPassengerFragment).commitAllowingStateLoss();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
if (descriptor == StatusDescriptor.VR_MODE){
|
||||
if (isTrue){
|
||||
if (descriptor == StatusDescriptor.VR_MODE) {
|
||||
if (isTrue) {
|
||||
showFragment();
|
||||
}else {
|
||||
} else {
|
||||
hideFragment();
|
||||
}
|
||||
}
|
||||
@@ -101,6 +101,7 @@ class MogoOCHTaxiPassenger implements IMogoOCH, IMogoStatusChangedListener {
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
// 若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener("ochTaxi", StatusDescriptor.VR_MODE, this);
|
||||
if (mActivity == null) return;
|
||||
mActivity.finish();
|
||||
}
|
||||
|
||||
@@ -15,6 +15,11 @@ import com.elegant.network.utils.GsonUtil;
|
||||
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.module.intent.IMogoIntentListener;
|
||||
import com.mogo.commons.module.intent.IntentManager;
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.module.status.StatusDescriptor;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
@@ -58,9 +63,6 @@ import com.mogo.och.taxi.passenger.constant.TaxiPassengerOrderStatusEnum;
|
||||
import com.mogo.och.taxi.passenger.network.TaxiPassengerServiceManager;
|
||||
import com.mogo.aicloud.services.socket.IMogoLifecycleListener;
|
||||
import com.mogo.och.taxi.passenger.utils.TaxiPassengerAnalyticsManager;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -229,14 +231,8 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
|
||||
// 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getIntentManagerApi()
|
||||
.registerIntentListener( ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getStatusManagerApi()
|
||||
.registerStatusChangedListener( TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener );
|
||||
IntentManager.getInstance().registerIntentListener( ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
// 达到起始站围栏监听
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
@@ -251,10 +247,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
}
|
||||
|
||||
private void releaseListeners() {
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getStatusManagerApi()
|
||||
.unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
// 注销到达起始站围栏监听
|
||||
MogoApisHandler.getInstance()
|
||||
|
||||
@@ -12,7 +12,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.hmi.IMoGoHmiViewProxy;
|
||||
@@ -20,15 +20,11 @@ import com.mogo.eagle.core.function.api.hmi.view.IViewNotification;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker;
|
||||
import com.mogo.eagle.core.utilcode.util.OverlayViewUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.map.MogoMarkerManager;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.constants.DataTypes;
|
||||
import com.mogo.och.taxi.passenger.R;
|
||||
import com.mogo.och.taxi.passenger.callback.ITPClickStartAutopilotCallback;
|
||||
import com.mogo.och.taxi.passenger.event.UIStatus;
|
||||
@@ -65,7 +61,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
private WeakReference<TaxiPassengerStartAutopilotView> mStartAutopilotView;
|
||||
protected TaxiPassengerServingOrderFragment ochServingOrderFragment = null;
|
||||
|
||||
private Handler mHandler = new Handler(Looper.getMainLooper());
|
||||
private final Handler mHandler = new Handler(Looper.getMainLooper());
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
@@ -102,11 +98,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
|
||||
onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState());
|
||||
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()){
|
||||
switchVRFlatMode(true);
|
||||
}else {
|
||||
switchVRFlatMode(false);
|
||||
}
|
||||
switchVRFlatMode(MogoStatusManager.getInstance().isVrMode());
|
||||
//预加载视频进程
|
||||
EmptyService.Companion.startService(getContext());
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.mogo.map.MogoOverlayManager;
|
||||
import com.mogo.map.overlay.IMogoOverlayManager;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.map.overlay.MogoPolylineOptions;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.module.status.StatusDescriptor;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.och.taxi.constant.TaxiConst;
|
||||
import com.mogo.och.taxi.ui.TaxiFragment;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -37,7 +37,7 @@ class TaxiProvider implements IMogoOCH , IMogoStatusChangedListener {
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
CallerLogger.INSTANCE.d( M_TAXI + TAG, "init" );
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("ochTaxi", StatusDescriptor.VR_MODE,this);
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener("ochTaxi", StatusDescriptor.VR_MODE,this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,6 +101,7 @@ class TaxiProvider implements IMogoOCH , IMogoStatusChangedListener {
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
//若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener("ochTaxi", StatusDescriptor.VR_MODE,this);
|
||||
if (mActivity == null) return;
|
||||
mActivity.finish();
|
||||
}
|
||||
|
||||
@@ -18,6 +18,11 @@ import com.amap.api.maps.model.LatLng;
|
||||
import com.elegant.network.utils.GsonUtil;
|
||||
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.commons.module.intent.IMogoIntentListener;
|
||||
import com.mogo.commons.module.intent.IntentManager;
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.module.status.StatusDescriptor;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
@@ -71,9 +76,6 @@ import com.mogo.och.taxi.utils.TaxiAnalyticsManager;
|
||||
import com.mogo.och.taxi.utils.OrderUtil;
|
||||
import com.mogo.aicloud.services.socket.IMogoLifecycleListener;
|
||||
import com.mogo.och.taxi.utils.TaxiTrajectoryManager;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.zhjt.service.chain.ChainLog;
|
||||
import com.zhjt.service.chain.TracingConstants;
|
||||
|
||||
@@ -159,8 +161,6 @@ public class TaxiModel {
|
||||
initListeners();
|
||||
loginService = (LoginService) ARouter.getInstance().build(OchCommonConst.LOGINSERVICE).navigation();
|
||||
|
||||
// IMogoServiceApis apis = MogoApisHandler.getInstance().getApis();
|
||||
// apis.getSocketManagerApi(mContext).init(mContext, DebugConfig.getSocketAppId());
|
||||
// TODO: 2021/8/27 因需要通过此回调的location进行坐标上传,暂改为全程监听,退出后再反注册,
|
||||
// 待后续整体调整location获取来源
|
||||
// if (DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) {
|
||||
@@ -217,14 +217,8 @@ public class TaxiModel {
|
||||
|
||||
// 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getIntentManagerApi()
|
||||
.registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener);
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getStatusManagerApi()
|
||||
.registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
IntentManager.getInstance().registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener);
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
// 达到起始站围栏监听
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
@@ -239,10 +233,7 @@ public class TaxiModel {
|
||||
}
|
||||
|
||||
private void releaseListeners() {
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getStatusManagerApi()
|
||||
.unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
// 注销到达起始站围栏监听
|
||||
MogoApisHandler.getInstance()
|
||||
|
||||
@@ -24,7 +24,6 @@ import androidx.fragment.app.FragmentTransaction;
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
@@ -39,7 +38,7 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.module.common.view.OnPreventFastClickListener;
|
||||
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
||||
import com.mogo.och.common.module.utils.AnimatorDrawableUtil;
|
||||
import com.mogo.och.taxi.R;
|
||||
|
||||
@@ -173,7 +172,6 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
// CallerLogger.INSTANCE.d(M_TAXI + TAG, "长按显示状态工具栏");
|
||||
// Intent intent = new Intent();
|
||||
// intent.putExtra("oper", 52);
|
||||
// MogoApisHandler.getInstance().getApis().getIntentManagerApi().invoke("com.mogo.mock", intent);
|
||||
// return true;
|
||||
// });
|
||||
// }
|
||||
|
||||
@@ -18,9 +18,9 @@ import androidx.annotation.RequiresApi;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.eagle.core.data.temp.EventLogout;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst;
|
||||
import com.mogo.och.common.module.biz.provider.LoginService;
|
||||
import com.mogo.och.taxi.R;
|
||||
@@ -115,14 +115,7 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
|
||||
mPersonalBtn.setVisibility(View.GONE);
|
||||
initFragment();
|
||||
hidPanel();
|
||||
if (MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getStatusManagerApi()
|
||||
.isVrMode()) {
|
||||
switchVRFlatMode(true);
|
||||
} else {
|
||||
switchVRFlatMode(false);
|
||||
}
|
||||
switchVRFlatMode(MogoStatusManager.getInstance().isVrMode());
|
||||
|
||||
tvOperationStatus.setVisibility(View.VISIBLE);
|
||||
initOrderTestBar();
|
||||
|
||||
@@ -39,7 +39,7 @@ import com.mogo.eagle.core.utilcode.util.ProcessUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadPoolService
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.map.location.GDLocationClient
|
||||
import com.mogo.module.common.constants.HostConst
|
||||
import com.mogo.eagle.core.data.constants.HostConst
|
||||
import com.rousetime.android_startup.AndroidStartup
|
||||
import com.zhjt.mogo_core_function_devatools.env.EnvChangeManager
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
|
||||
@@ -66,7 +66,6 @@ dependencies {
|
||||
implementation project(':libraries:mogo-adas')
|
||||
} else {
|
||||
implementation project(':modules:mogo-module-common')
|
||||
implementation project(':modules:mogo-module-service')
|
||||
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-utils')
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory;
|
||||
import com.mogo.eagle.core.network.RequestOptions;
|
||||
import com.mogo.eagle.core.network.SubscribeImpl;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.module.common.constants.HostConst;
|
||||
import com.mogo.eagle.core.data.constants.HostConst;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
@@ -8,16 +8,13 @@ import com.mogo.eagle.core.data.bindingcar.BindingcarInfo;
|
||||
import com.mogo.eagle.core.data.bindingcar.ModifyBindingcarInfo;
|
||||
import com.mogo.eagle.core.function.BindHostConst;
|
||||
import com.mogo.eagle.core.function.api.bindingcar.BindingcarCallBack;
|
||||
import com.mogo.eagle.core.function.bindingcar.R;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerHDMapManager;
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils;
|
||||
import com.mogo.module.common.constants.HostConst;
|
||||
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
|
||||
@@ -70,7 +70,6 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.mogo_core_res
|
||||
} else {
|
||||
implementation project(':modules:mogo-module-common')
|
||||
implementation project(':modules:mogo-module-service')
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':core:mogo-core-function-api')
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package com.mogo.eagle.core.function.chat.facade.analytics
|
||||
|
||||
import com.mogo.commons.analytics.AnalyticsUtils
|
||||
import com.mogo.eagle.core.function.api.chat.biz.IMoGoAnalyticsFacade
|
||||
import com.mogo.eagle.core.function.chat.facade.bridge.BridgeApi
|
||||
|
||||
object ChatAnalyticsFacade: IMoGoAnalyticsFacade {
|
||||
|
||||
override fun track(eventType: String, data: Map<String, Any>?) {
|
||||
BridgeApi.analytics()?.track(eventType, data)
|
||||
AnalyticsUtils.track(eventType, data)
|
||||
}
|
||||
}
|
||||
@@ -2,17 +2,12 @@ package com.mogo.eagle.core.function.chat.facade.bridge
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.utilcode.util.Utils
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
internal object BridgeApi {
|
||||
|
||||
private var contextHolder: WeakReference<Context>? = null
|
||||
|
||||
private val apis by lazy {
|
||||
MogoApisHandler.getInstance().apis
|
||||
}
|
||||
|
||||
internal fun init(context: Context?) {
|
||||
context?.let {
|
||||
contextHolder = WeakReference(context)
|
||||
@@ -21,13 +16,4 @@ internal object BridgeApi {
|
||||
|
||||
internal fun context(): Context = contextHolder?.get() ?: Utils.getApp()
|
||||
|
||||
internal fun intentManager() = apis?.intentManagerApi
|
||||
|
||||
internal fun statusManager() = apis?.statusManagerApi
|
||||
|
||||
internal fun analytics() = apis?.analyticsApi
|
||||
|
||||
internal fun topViewManager() = apis?.topViewManager
|
||||
|
||||
internal fun floatViewManager() = apis?.windowManagerApi
|
||||
}
|
||||
@@ -22,6 +22,7 @@ import com.mogo.eagle.core.function.api.chat.biz.ChatConsts
|
||||
import com.mogo.eagle.core.function.api.chat.biz.HangUpState
|
||||
import com.mogo.eagle.core.function.api.chat.biz.IMoGoVoiceControlFacade.IMoGoVoiceCallback
|
||||
import com.mogo.eagle.core.function.api.chat.biz.RefuseState
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiFloatViewManager
|
||||
import com.mogo.eagle.core.function.chat.R
|
||||
import com.mogo.eagle.core.function.chat.facade.MoGoChatFacade
|
||||
import com.mogo.eagle.core.function.chat.facade.OnCallingInterrupt
|
||||
@@ -30,8 +31,8 @@ import com.mogo.eagle.core.function.chat.facade.bridge.BridgeApi
|
||||
import com.mogo.eagle.core.function.chat.facade.utils.log
|
||||
import com.mogo.eagle.core.function.chat.facade.voice.VoiceControlFacade.REQUEST_CLOUD_VOICE_CALL
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideRoundedCornersTransform
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideRoundedCornersTransform.CornerType.LEFT
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform.CornerType.LEFT
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
import kotlinx.coroutines.channels.Channel.Factory.RENDEZVOUS
|
||||
@@ -200,7 +201,7 @@ internal class CallChatWindowManager {
|
||||
log(TAG, "由于对方呼出又挂断,导致来电界面隐藏")
|
||||
d2.safeCancel()
|
||||
}
|
||||
2 -> {
|
||||
2 -> {
|
||||
log(TAG, "由于自己主动拒接,导致来电界面隐藏")
|
||||
d1.safeCancel()
|
||||
}
|
||||
@@ -252,8 +253,11 @@ internal class CallChatWindowManager {
|
||||
|
||||
private fun getInComingLayoutParams(context: Context): FrameLayout.LayoutParams {
|
||||
return FrameLayout.LayoutParams(
|
||||
context.resources.getDimension(R.dimen.module_call_chat_state_incoming_hawk_eye_width).toInt(),
|
||||
context.resources.getDimension(R.dimen.module_call_chat_state_incoming_hawk_eye_height).toInt())
|
||||
context.resources.getDimension(R.dimen.module_call_chat_state_incoming_hawk_eye_width)
|
||||
.toInt(),
|
||||
context.resources.getDimension(R.dimen.module_call_chat_state_incoming_hawk_eye_height)
|
||||
.toInt()
|
||||
)
|
||||
.also {
|
||||
it.gravity = Gravity.BOTTOM or Gravity.START
|
||||
it.marginStart = 40.PX
|
||||
@@ -264,7 +268,11 @@ internal class CallChatWindowManager {
|
||||
/**
|
||||
* 重新开始计时
|
||||
*/
|
||||
private fun CoroutineScope.resetInComingTimer(old: Job?, user: UserInfo, incomingView: View): Job {
|
||||
private fun CoroutineScope.resetInComingTimer(
|
||||
old: Job?,
|
||||
user: UserInfo,
|
||||
incomingView: View
|
||||
): Job {
|
||||
old?.safeCancel()
|
||||
return inComingTimer(user, incomingView)
|
||||
}
|
||||
@@ -284,13 +292,13 @@ internal class CallChatWindowManager {
|
||||
var callingView = LayoutInflater.from(context)
|
||||
.inflate(R.layout.module_car_chatting_launcher_calling_hawk_eye_view, null)
|
||||
callingView.isClickable = true
|
||||
var calling= callingView.findViewById<View>(R.id.module_carchatting_rl_call_view)
|
||||
var calling = callingView.findViewById<View>(R.id.module_carchatting_rl_call_view)
|
||||
var head = callingView.findViewById<ImageView>(R.id.module_carchatting_call_head)
|
||||
var hangUp = callingView.findViewById<View>(R.id.module_carchatting_call_hangUp)
|
||||
var name = callingView.findViewById<TextView>(R.id.module_carchatting_call_nickname)
|
||||
var timer = callingView.findViewById<TextView>(R.id.module_carchatting_call_time)
|
||||
calling.visibility = View.VISIBLE
|
||||
name.text = "云平台"
|
||||
name.text = "云平台"
|
||||
timer.text = context.resources.getString(R.string.module_car_chat_matching_wait)
|
||||
GlideApp.with(context).load(user.icon)
|
||||
.apply(
|
||||
@@ -353,7 +361,7 @@ internal class CallChatWindowManager {
|
||||
}
|
||||
hide(callingView)
|
||||
facade.audioFocus().releaseAudioFocus()
|
||||
}.also { job = it }
|
||||
}.also { job = it }
|
||||
}
|
||||
if (itx == ON_DESTROY) {
|
||||
isCallingShow = false
|
||||
@@ -375,9 +383,9 @@ internal class CallChatWindowManager {
|
||||
|
||||
private fun getCallingLayoutParams(context: Context): FrameLayout.LayoutParams {
|
||||
return FrameLayout.LayoutParams(
|
||||
context.resources.getDimension(R.dimen.module_call_chat_state_hawk_eye_width).toInt(),
|
||||
context.resources.getDimension(R.dimen.module_call_chat_state_hawk_eye_height).toInt()
|
||||
)
|
||||
context.resources.getDimension(R.dimen.module_call_chat_state_hawk_eye_width).toInt(),
|
||||
context.resources.getDimension(R.dimen.module_call_chat_state_hawk_eye_height).toInt()
|
||||
)
|
||||
.also {
|
||||
it.gravity = Gravity.BOTTOM or Gravity.START
|
||||
it.marginStart = 40.PX
|
||||
@@ -393,17 +401,17 @@ internal class CallChatWindowManager {
|
||||
}
|
||||
|
||||
private fun show(view: View, params: FrameLayout.LayoutParams) {
|
||||
BridgeApi.floatViewManager()?.addView(view, params, true)
|
||||
CallerHmiFloatViewManager.addView(view, params, true)
|
||||
}
|
||||
|
||||
private fun hide(view: View) {
|
||||
if (!ViewCompat.isAttachedToWindow(view)) {
|
||||
return
|
||||
}
|
||||
BridgeApi.floatViewManager()?.removeView(view)
|
||||
CallerHmiFloatViewManager.removeView(view)
|
||||
}
|
||||
|
||||
private fun playAudioCall(onPlay:(() -> Unit)? = null) {
|
||||
private fun playAudioCall(onPlay: (() -> Unit)? = null) {
|
||||
facade.also {
|
||||
it.audioFocus().requireAudioFocus {
|
||||
it.media().play(context, R.raw.call, true, AudioManager.STREAM_RING)
|
||||
@@ -474,7 +482,13 @@ internal class CallChatWindowManager {
|
||||
* @param onExit: 当前用户退房通知(当前用户主动挂断或对方挂断)
|
||||
*/
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
private fun answer(user: UserInfo, onEnter: () -> Unit, onNewEnter: () -> Unit, onExit: () -> Unit, onError: (code: Int, msg: String, extra: Map<String, String>? ) -> Unit) {
|
||||
private fun answer(
|
||||
user: UserInfo,
|
||||
onEnter: () -> Unit,
|
||||
onNewEnter: () -> Unit,
|
||||
onExit: () -> Unit,
|
||||
onError: (code: Int, msg: String, extra: Map<String, String>?) -> Unit
|
||||
) {
|
||||
facade.also { itx ->
|
||||
if (hasAnswered) {
|
||||
return
|
||||
@@ -482,7 +496,7 @@ internal class CallChatWindowManager {
|
||||
hasAnswered = true
|
||||
itx.answer(user.sn)
|
||||
.onEach {
|
||||
when(it) {
|
||||
when (it) {
|
||||
is EnterRoomSuccess -> {
|
||||
onEnter.invoke()
|
||||
}
|
||||
@@ -507,7 +521,12 @@ internal class CallChatWindowManager {
|
||||
}
|
||||
}
|
||||
|
||||
private fun doRefuse(user: UserInfo, notify: Boolean = true, inComingView: View, isAnswerFail: Boolean) {
|
||||
private fun doRefuse(
|
||||
user: UserInfo,
|
||||
notify: Boolean = true,
|
||||
inComingView: View,
|
||||
isAnswerFail: Boolean
|
||||
) {
|
||||
refuse(user,
|
||||
onSuccess = {
|
||||
if (notify) {
|
||||
@@ -529,7 +548,11 @@ internal class CallChatWindowManager {
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
private fun refuse(user: UserInfo, onSuccess: () -> Unit, onError: (code: Int, msg: String, extra: Map<String, String>?) -> Unit){
|
||||
private fun refuse(
|
||||
user: UserInfo,
|
||||
onSuccess: () -> Unit,
|
||||
onError: (code: Int, msg: String, extra: Map<String, String>?) -> Unit
|
||||
) {
|
||||
facade.also {
|
||||
if (hasRefused) {
|
||||
return
|
||||
@@ -537,7 +560,7 @@ internal class CallChatWindowManager {
|
||||
hasRefused = true
|
||||
it.refuse(user.sn)
|
||||
.onEach { itx ->
|
||||
when(itx) {
|
||||
when (itx) {
|
||||
is RefuseState.Success -> {
|
||||
onSuccess.invoke()
|
||||
}
|
||||
@@ -591,13 +614,17 @@ internal class CallChatWindowManager {
|
||||
var counter = 1
|
||||
while (true) {
|
||||
delay(1000)
|
||||
emit(1000L * (counter ++))
|
||||
emit(1000L * (counter++))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
private fun hangUp(user: UserInfo, onSuccess: () -> Unit, onError:(code: Int, msg: String, extra: Map<String, String>?) -> Unit) {
|
||||
private fun hangUp(
|
||||
user: UserInfo,
|
||||
onSuccess: () -> Unit,
|
||||
onError: (code: Int, msg: String, extra: Map<String, String>?) -> Unit
|
||||
) {
|
||||
facade.also {
|
||||
if (hasHangUpped) {
|
||||
return
|
||||
@@ -605,13 +632,16 @@ internal class CallChatWindowManager {
|
||||
hasHangUpped = true
|
||||
it.handUp(user.sn)
|
||||
.onEach { itx ->
|
||||
when(itx) {
|
||||
when (itx) {
|
||||
HangUpState.Success -> {
|
||||
onSuccess.invoke()
|
||||
}
|
||||
is HangUpState.Error -> {
|
||||
hasHangUpped = false
|
||||
log(TAG, "-- 挂断失败 --: code:: ${itx.code}; msg:: ${itx.msg}; extra:: ${itx.extra}")
|
||||
log(
|
||||
TAG,
|
||||
"-- 挂断失败 --: code:: ${itx.code}; msg:: ${itx.msg}; extra:: ${itx.extra}"
|
||||
)
|
||||
onError.invoke(itx.code, itx.msg, itx.extra)
|
||||
}
|
||||
else -> {
|
||||
|
||||
@@ -3,13 +3,14 @@ package com.mogo.eagle.core.function.chat.facade.voice
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.module.intent.IMogoIntentListener
|
||||
import com.mogo.commons.module.intent.IntentManager
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
|
||||
import com.mogo.eagle.core.function.api.chat.biz.IMoGoVoiceControlFacade
|
||||
import com.mogo.eagle.core.function.api.chat.biz.IMoGoVoiceControlFacade.IMoGoVoiceCallback
|
||||
import com.mogo.eagle.core.function.chat.facade.bridge.BridgeApi
|
||||
import com.mogo.eagle.core.function.chat.facade.utils.log
|
||||
import com.mogo.service.intent.IMogoIntentListener
|
||||
import java.lang.ref.WeakReference
|
||||
import java.util.concurrent.CopyOnWriteArrayList
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
@@ -48,10 +49,6 @@ object VoiceControlFacade: IMoGoVoiceControlFacade, IMogoVoiceCmdCallBack, IMogo
|
||||
|
||||
private var onSpeechFinish: WeakReference<onSpeedFinish>? = null
|
||||
|
||||
private val intentManager by lazy {
|
||||
BridgeApi.intentManager()
|
||||
}
|
||||
|
||||
override fun speak(context: Context, content: String, listener: IMoGoVoiceCallback) {
|
||||
listeners += WeakReference(listener)
|
||||
AIAssist.getInstance(context).speakTTSVoiceWithLevel(content,AIAssist.LEVEL3 ,this)
|
||||
@@ -123,10 +120,8 @@ object VoiceControlFacade: IMoGoVoiceControlFacade, IMogoVoiceCmdCallBack, IMogo
|
||||
}
|
||||
hasRegister.set(true)
|
||||
AIAssist.getInstance(BridgeApi.context()).registerUnWakeupCommand(VOICE_REGISTER_CANCEL_CALL, customCancelCallArray, this)
|
||||
intentManager?.also {
|
||||
it.registerIntentListener(VOICE_INTENT_CANCEL_CALL_COMMAND, this)
|
||||
it.registerIntentListener(VOICE_INTENT_REFUSE_CALL, this)
|
||||
}
|
||||
IntentManager.getInstance().registerIntentListener(VOICE_INTENT_CANCEL_CALL_COMMAND, this)
|
||||
IntentManager.getInstance().registerIntentListener(VOICE_INTENT_REFUSE_CALL, this)
|
||||
}
|
||||
|
||||
override fun registerInviteJoinTeam(context: Context, listener: IMoGoVoiceCallback) {
|
||||
@@ -156,13 +151,13 @@ object VoiceControlFacade: IMoGoVoiceControlFacade, IMogoVoiceCmdCallBack, IMogo
|
||||
|
||||
override fun registerIntentInComingCall(listener: IMoGoVoiceCallback) {
|
||||
listeners += WeakReference(listener)
|
||||
intentManager?.registerIntentListener(VOICE_INTENT_ANSWER_CALL, this)
|
||||
intentManager?.registerIntentListener(VOICE_INTENT_REFUSE_CALL, this)
|
||||
IntentManager.getInstance().registerIntentListener(VOICE_INTENT_ANSWER_CALL, this)
|
||||
IntentManager.getInstance().registerIntentListener(VOICE_INTENT_REFUSE_CALL, this)
|
||||
}
|
||||
|
||||
override fun unRegisterIntentInComingCall(context: Context) {
|
||||
intentManager?.unregisterIntentListener(VOICE_INTENT_ANSWER_CALL, this)
|
||||
intentManager?.unregisterIntentListener(VOICE_INTENT_REFUSE_CALL, this)
|
||||
IntentManager.getInstance().unregisterIntentListener(VOICE_INTENT_ANSWER_CALL, this)
|
||||
IntentManager.getInstance().unregisterIntentListener(VOICE_INTENT_REFUSE_CALL, this)
|
||||
}
|
||||
|
||||
override fun speakAndRegisterCall(onCmdAgree: (Boolean) -> Unit, onSpeakFinish: () -> Unit, listener: IMoGoVoiceCallback) {
|
||||
@@ -204,10 +199,8 @@ object VoiceControlFacade: IMoGoVoiceControlFacade, IMogoVoiceCmdCallBack, IMogo
|
||||
hasRegister.set(false)
|
||||
listeners.clear()
|
||||
AIAssist.getInstance(BridgeApi.context()).unregisterUnWakeupCommand(VOICE_REGISTER_CANCEL_CALL, this)
|
||||
intentManager?.also {
|
||||
it.unregisterIntentListener(VOICE_INTENT_CANCEL_CALL_COMMAND, this)
|
||||
it.unregisterIntentListener(VOICE_INTENT_REFUSE_CALL, this)
|
||||
}
|
||||
IntentManager.getInstance().unregisterIntentListener(VOICE_INTENT_CANCEL_CALL_COMMAND, this)
|
||||
IntentManager.getInstance().unregisterIntentListener(VOICE_INTENT_REFUSE_CALL, this)
|
||||
}
|
||||
|
||||
override fun onIntentReceived(cmd: String?, intent: Intent?) {
|
||||
|
||||
@@ -70,8 +70,6 @@ dependencies {
|
||||
implementation project(':services:mogo-service-api')
|
||||
|
||||
implementation project(':modules:mogo-module-common')
|
||||
implementation project(':modules:mogo-module-service')
|
||||
//implementation project(':modules:mogo-module-carchattingprovider')
|
||||
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-utils')
|
||||
|
||||
@@ -3,6 +3,9 @@ package com.mogo.eagle.core.function.check
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.module.status.StatusDescriptor
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.check.ICheckProvider
|
||||
import com.mogo.eagle.core.function.api.check.IMogoCheckListener
|
||||
@@ -13,9 +16,6 @@ import com.mogo.eagle.core.function.check.view.CheckActivity
|
||||
import com.mogo.eagle.core.function.check.view.CheckDialog
|
||||
import com.mogo.eagle.core.function.report.IPCReportManager
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener
|
||||
import com.mogo.service.statusmanager.StatusDescriptor
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
/**
|
||||
@@ -38,11 +38,9 @@ class VehicleMonitoringManager : ICheckProvider, IMogoStatusChangedListener {
|
||||
|
||||
override fun init(context: Context) {
|
||||
mContext = context
|
||||
MogoApisHandler.getInstance().apis.statusManagerApi.registerStatusChangedListener(
|
||||
TAG,
|
||||
StatusDescriptor.MAIN_PAGE_RESUME,
|
||||
this
|
||||
)
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG,
|
||||
StatusDescriptor.MAIN_PAGE_RESUME,
|
||||
this)
|
||||
//开启工控机监控节点上报服务
|
||||
IPCReportManager.INSTANCE.initServer()
|
||||
}
|
||||
@@ -123,6 +121,9 @@ class VehicleMonitoringManager : ICheckProvider, IMogoStatusChangedListener {
|
||||
|
||||
override fun onDestroy() {
|
||||
//停止工控机监控节点上报服务
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG,
|
||||
StatusDescriptor.MAIN_PAGE_RESUME,
|
||||
this)
|
||||
IPCReportManager.INSTANCE.destroy()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.eagle.core.function.check.net;
|
||||
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory;
|
||||
import com.mogo.module.common.constants.HostConst;
|
||||
import com.mogo.eagle.core.data.constants.HostConst;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
|
||||
@@ -20,8 +20,7 @@ import com.mogo.eagle.core.function.check.api.ICheckResultCallBack;
|
||||
import com.mogo.eagle.core.function.check.net.CheckNetWork;
|
||||
import com.mogo.eagle.core.function.check.net.CheckResultData;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import com.mogo.module.common.view.ImageViewClipBounds;
|
||||
import com.mogo.module.common.view.SpacesItemDecoration;
|
||||
import com.mogo.eagle.core.utilcode.mogo.view.SpacesItemDecoration;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.mogo.eagle.core.function.check.view;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -9,7 +12,6 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.eagle.core.function.call.check.CallerCheckManager;
|
||||
import com.mogo.eagle.core.function.check.R;
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
@@ -17,13 +19,21 @@ import com.mogo.module.common.dialog.BaseFloatDialog;
|
||||
* 第一版本为添加长时间未检测的提示框,因为逻辑冲突,二期需求与产品确认,UI公用
|
||||
* @since: 7/30/21
|
||||
*/
|
||||
public class CheckDialog extends BaseFloatDialog {
|
||||
public class CheckDialog extends Dialog {
|
||||
|
||||
private boolean showWarning;
|
||||
private Context mContext;
|
||||
|
||||
public CheckDialog(@NonNull Context context, boolean hasError) {
|
||||
super(context);
|
||||
super(context,R.style.CheckInfoDialogStyle);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
|
||||
} else {
|
||||
getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
|
||||
}
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
|
||||
| WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION
|
||||
| WindowManager.LayoutParams.FLAG_LOCAL_FOCUS_MODE);
|
||||
mContext = context;
|
||||
showWarning = hasError;
|
||||
initView();
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.mogo.eagle.core.function.check.view;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -9,7 +12,6 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import com.mogo.eagle.core.function.check.R;
|
||||
import com.mogo.eagle.core.function.check.model.CheckItemInfo;
|
||||
import com.mogo.eagle.core.function.check.net.CheckResultData;
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -19,7 +21,7 @@ import java.util.List;
|
||||
* @description 检测指标详情弹框
|
||||
* @since: 9/22/21
|
||||
*/
|
||||
public class CheckInfoListDialog extends BaseFloatDialog {
|
||||
public class CheckInfoListDialog extends Dialog {
|
||||
|
||||
private static final String TAG = "CheckInfoListDialog";
|
||||
private CheckInfoRecyclerView mRecyclerView;
|
||||
@@ -28,10 +30,18 @@ public class CheckInfoListDialog extends BaseFloatDialog {
|
||||
private int span;
|
||||
private String mStyle;
|
||||
private CheckResultData mCheckResultData;
|
||||
private List<CheckResultData.CheckListItem> result = new ArrayList<>();
|
||||
private final List<CheckResultData.CheckListItem> result = new ArrayList<>();
|
||||
|
||||
public CheckInfoListDialog(@NonNull Context context, String style, CheckResultData checkResultData) {
|
||||
super(context);
|
||||
super(context,R.style.CheckInfoDialogStyle);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
|
||||
} else {
|
||||
getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
|
||||
}
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
|
||||
| WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION
|
||||
| WindowManager.LayoutParams.FLAG_LOCAL_FOCUS_MODE);
|
||||
mContext = context;
|
||||
mStyle = style;
|
||||
mCheckResultData = checkResultData;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.module.common.view;
|
||||
package com.mogo.eagle.core.function.check.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
@@ -7,6 +7,8 @@ import android.util.AttributeSet;
|
||||
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @date 2019-08-22
|
||||
@@ -37,7 +39,7 @@ public class ImageViewClipBounds extends AppCompatImageView {
|
||||
}
|
||||
|
||||
public void setClip(Rect clipBounds) {
|
||||
if (clipBounds == mClipBounds || (clipBounds != null && clipBounds.equals(mClipBounds))) {
|
||||
if (Objects.equals(clipBounds, mClipBounds)) {
|
||||
return;
|
||||
}
|
||||
if (clipBounds != null) {
|
||||
@@ -42,7 +42,7 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.module.common.view.ImageViewClipBounds
|
||||
<com.mogo.eagle.core.function.check.view.ImageViewClipBounds
|
||||
android:id="@+id/scan_car_top_image"
|
||||
android:layout_width="@dimen/check_scan_width"
|
||||
android:layout_height="@dimen/check_scan_height"
|
||||
@@ -53,7 +53,7 @@
|
||||
app:layout_constraintTop_toTopOf="@id/scan_car_image" />
|
||||
|
||||
|
||||
<com.mogo.module.common.view.ImageViewClipBounds
|
||||
<com.mogo.eagle.core.function.check.view.ImageViewClipBounds
|
||||
android:id="@+id/scan_car_tips"
|
||||
android:layout_width="@dimen/check_scan_width"
|
||||
android:layout_height="@dimen/check_scan_height"
|
||||
@@ -72,7 +72,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_120"
|
||||
android:text="自动驾驶车辆体检中,请稍候……"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_42"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="自动驾驶车辆存在风险"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_54"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="@id/error_view"
|
||||
@@ -54,13 +54,14 @@
|
||||
android:layout_height="@dimen/dp_56"
|
||||
android:layout_marginTop="@dimen/dp_25"
|
||||
android:src="@drawable/check_wrong"
|
||||
app:layout_constraintTop_toBottomOf="@id/error_title" />
|
||||
app:layout_constraintTop_toBottomOf="@id/error_title"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/error_txt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_26"
|
||||
android:layout_marginStart="@dimen/dp_26"
|
||||
android:layout_marginTop="@dimen/dp_23"
|
||||
android:text="软件运行异常"
|
||||
android:textColor="@color/check_tip_error_color"
|
||||
@@ -76,9 +77,10 @@
|
||||
android:background="@drawable/check_detail"
|
||||
android:gravity="center"
|
||||
android:text="查看详情"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/check_button_text_size"
|
||||
app:layout_constraintTop_toBottomOf="@id/error_image" />
|
||||
app:layout_constraintTop_toBottomOf="@id/error_image"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -97,8 +99,9 @@
|
||||
android:layout_width="@dimen/dp_520"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="您的自动驾驶系统已经很久没有进行体检了,建议立即体检。"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/dp_44" />
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_44"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/check_button"
|
||||
@@ -108,9 +111,10 @@
|
||||
android:background="@drawable/check_button"
|
||||
android:gravity="center"
|
||||
android:text="立即体检"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/check_button_text_size"
|
||||
app:layout_constraintTop_toBottomOf="@id/check_text_view" />
|
||||
app:layout_constraintTop_toBottomOf="@id/check_text_view"
|
||||
tools:ignore="MissingConstraints" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
android:layout_marginTop="@dimen/dp_50"
|
||||
android:gravity="left"
|
||||
android:text="硬件检测:"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_42"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -30,7 +30,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_50"
|
||||
android:text="(下面 1 项存在异常)"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_42"
|
||||
app:layout_constraintLeft_toRightOf="@+id/title"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -45,8 +45,8 @@
|
||||
android:layout_marginTop="@dimen/dp_236"
|
||||
android:gravity="center"
|
||||
android:text="角激光"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_42"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<!--车辆模型-->
|
||||
@@ -77,8 +77,8 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="center"
|
||||
android:text="Pad"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/dp_32" />
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_42" />
|
||||
<!--前摄像头3-->
|
||||
<TextView
|
||||
android:id="@+id/camera_front_txt"
|
||||
@@ -89,8 +89,8 @@
|
||||
android:layout_marginBottom="@dimen/dp_42"
|
||||
android:gravity="center"
|
||||
android:text="摄像头"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/dp_32" />
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_42" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/camera"
|
||||
@@ -163,8 +163,8 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="center"
|
||||
android:text="主激光"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/dp_32" />
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_42" />
|
||||
<!--RTK-->
|
||||
<ImageView
|
||||
android:id="@+id/rtk"
|
||||
@@ -184,8 +184,8 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="center"
|
||||
android:text="RTK"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/dp_32" />
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_42" />
|
||||
<!--摄像头-后1-->
|
||||
<ImageView
|
||||
android:id="@+id/camera_begind"
|
||||
@@ -205,8 +205,8 @@
|
||||
android:layout_marginBottom="@dimen/dp_42"
|
||||
android:gravity="center"
|
||||
android:text="摄像头"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/dp_32" />
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_42" />
|
||||
<!--路由器-->
|
||||
<ImageView
|
||||
android:id="@+id/luyouqi"
|
||||
@@ -226,8 +226,8 @@
|
||||
android:layout_marginTop="@dimen/dp_42"
|
||||
android:gravity="center"
|
||||
android:text="路由器"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/dp_32" />
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_42" />
|
||||
|
||||
<!--OBU-->
|
||||
<ImageView
|
||||
@@ -251,8 +251,8 @@
|
||||
android:layout_marginStart="@dimen/dp_1000"
|
||||
android:gravity="center"
|
||||
android:text="角激光"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_42"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/check_image" />
|
||||
<!--OBU文案-->
|
||||
@@ -265,15 +265,15 @@
|
||||
android:layout_marginTop="@dimen/dp_236"
|
||||
android:gravity="center"
|
||||
android:text="OBU"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_42"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/error_tip"
|
||||
android:layout_width="@dimen/dp_32"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_width="@dimen/dp_42"
|
||||
android:layout_height="@dimen/dp_42"
|
||||
android:layout_marginLeft="@dimen/dp_907"
|
||||
android:layout_marginTop="@dimen/dp_177"
|
||||
android:background="@drawable/check_little_btn"
|
||||
@@ -287,14 +287,14 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_24"
|
||||
android:text="设备故障"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
app:layout_constraintLeft_toRightOf="@+id/error_tip"
|
||||
app:layout_constraintTop_toTopOf="@+id/error_tip" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/error_tip_green"
|
||||
android:layout_width="@dimen/dp_32"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_width="@dimen/dp_42"
|
||||
android:layout_height="@dimen/dp_42"
|
||||
android:layout_marginLeft="@dimen/dp_160"
|
||||
android:layout_marginTop="88dp"
|
||||
android:background="@drawable/check_little_btn_green"
|
||||
@@ -307,7 +307,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_24"
|
||||
android:text="设备正常"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
app:layout_constraintLeft_toRightOf="@+id/error_tip_green"
|
||||
app:layout_constraintTop_toTopOf="@+id/error_tip_green" />
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
android:background="@drawable/check_top_item_no_line_shape"
|
||||
android:gravity="left"
|
||||
android:paddingLeft="@dimen/dp_40"
|
||||
android:paddingTop="@dimen/dp_32"
|
||||
android:paddingTop="@dimen/dp_42"
|
||||
android:text="模块名称"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="@dimen/dp_38"
|
||||
@@ -30,7 +30,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/check_top_item_left_shape"
|
||||
android:paddingLeft="@dimen/dp_40"
|
||||
android:paddingTop="@dimen/dp_32"
|
||||
android:paddingTop="@dimen/dp_42"
|
||||
android:text="运行状态"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="@dimen/dp_38"
|
||||
@@ -47,7 +47,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/check_top_item_left_shape"
|
||||
android:paddingLeft="@dimen/dp_40"
|
||||
android:paddingTop="@dimen/dp_32"
|
||||
android:paddingTop="@dimen/dp_42"
|
||||
android:text="模块名称"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="@dimen/dp_38"
|
||||
@@ -64,7 +64,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/check_top_item_left_shape"
|
||||
android:paddingLeft="@dimen/dp_40"
|
||||
android:paddingTop="@dimen/dp_32"
|
||||
android:paddingTop="@dimen/dp_42"
|
||||
android:text="运行状态"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="@dimen/dp_38"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
android:layout_marginLeft="@dimen/dp_50"
|
||||
android:layout_marginTop="@dimen/dp_50"
|
||||
android:text="硬件检测:"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_42"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -52,7 +52,7 @@
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
android:maxLines="2"
|
||||
android:text="自动驾驶"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_42"
|
||||
app:layout_constraintTop_toBottomOf="@id/icon_auto" />
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
android:text=" 鹰眼\n版本"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_42"
|
||||
app:layout_constraintTop_toBottomOf="@id/icon_auto" />
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
android:layout_marginLeft="@dimen/dp_65"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:text="暂无数据,请关闭重试"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_64"
|
||||
app:layout_constraintLeft_toRightOf="@+id/check_tip_image"
|
||||
app:layout_constraintTop_toTopOf="@+id/check_tip_image" />
|
||||
|
||||
@@ -8,4 +8,19 @@
|
||||
<item name="android:progressDrawable">@drawable/check_progress</item>
|
||||
<item name="android:listDivider">@drawable/check_item_left_shape</item>
|
||||
</style>
|
||||
|
||||
<style name="CheckInfoDialogStyle" parent="@android:style/Theme.Dialog">
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:backgroundDimAmount">0.6</item>
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:fullBright">@android:color/transparent</item>
|
||||
<item name="android:fullDark">@android:color/transparent</item>
|
||||
<item name="android:topBright">@android:color/transparent</item>
|
||||
<item name="android:topDark">@android:color/transparent</item>
|
||||
<item name="android:borderlessButtonStyle">@android:color/transparent</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -4,7 +4,7 @@ import com.mogo.eagle.core.data.Response
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.eagle.core.network.apiResponseCall
|
||||
import com.mogo.eagle.core.network.request
|
||||
import com.mogo.module.common.constants.HostConst
|
||||
import com.mogo.eagle.core.data.constants.HostConst
|
||||
import com.zhjt.mogo_core_function_devatools.upgrade.network.HostConst.Companion.getBaseUrl
|
||||
|
||||
class UpgradeVersionNetWorkModel {
|
||||
|
||||
@@ -66,8 +66,6 @@ public class DispatchAutoPilotManager implements IMogoOnMessageListener<Dispatch
|
||||
private boolean isDispatch = false;
|
||||
private boolean isArriveEnd = false;
|
||||
|
||||
private IMogoServiceApis mApis;
|
||||
|
||||
private DispatchAutoPilotManager() {
|
||||
|
||||
}
|
||||
@@ -104,10 +102,9 @@ public class DispatchAutoPilotManager implements IMogoOnMessageListener<Dispatch
|
||||
|
||||
public void initSocket(Context context) {
|
||||
mContext = context;
|
||||
mApis = MogoApisHandler.getInstance().getApis();
|
||||
|
||||
MogoAiCloudSocketManager.getInstance(context).registerOnMessageListener(MSG_SOCKET_TYPE, this);
|
||||
mApis.getRegisterCenterApi()
|
||||
MogoApisHandler.getInstance().getApis().getRegisterCenterApi()
|
||||
.registerCarLocationChangedListener(TAG, this);
|
||||
// 添加自动驾驶按钮选中监听
|
||||
CallerHmiListenerManager.INSTANCE.addCheckAutoPilotBtnListener(TAG, this);
|
||||
|
||||
@@ -1,16 +1,26 @@
|
||||
package com.zhjt.dispatch;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean;
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog;
|
||||
|
||||
public abstract class DispatchBaseDialog extends BaseFloatDialog {
|
||||
public abstract class DispatchBaseDialog extends Dialog {
|
||||
|
||||
public DispatchBaseDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
super(context,R.style.Base_AlertDialog_AppCompat);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
|
||||
} else {
|
||||
getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
|
||||
}
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
|
||||
| WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION
|
||||
| WindowManager.LayoutParams.FLAG_LOCAL_FOCUS_MODE);
|
||||
}
|
||||
|
||||
public abstract void addIDispatchRemindListener(IDispatchRemindClickListener listener);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.zhjt.dispatch.model;
|
||||
|
||||
import static com.mogo.commons.context.ContextHolderUtil.getContext;
|
||||
import static com.mogo.module.common.constants.HostConst.DATA_SERVICE_HOST;
|
||||
import static com.mogo.eagle.core.data.constants.HostConst.DATA_SERVICE_HOST;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
@@ -13,7 +13,6 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory;
|
||||
import com.mogo.eagle.core.network.RequestOptions;
|
||||
import com.mogo.eagle.core.network.SubscribeImpl;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="BaseFloatDialogStyle" parent="@android:style/Theme.Dialog">
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<item name="android:windowFrame">@null</item>
|
||||
@@ -16,19 +15,4 @@
|
||||
<item name="android:borderlessButtonStyle">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
<style name="customHeartHeartRatingBarStyle" parent="@style/Widget.AppCompat.RatingBar">
|
||||
<item name="android:maxWidth">@dimen/heart_ratingbar_width</item>
|
||||
<item name="android:minWidth">@dimen/heart_ratingbar_width</item>
|
||||
<item name="android:minHeight">@dimen/heart_ratingbar_height</item>
|
||||
<item name="android:maxHeight">@dimen/heart_ratingbar_height</item>
|
||||
<item name="android:numStars">5</item>
|
||||
<item name="android:rating">1</item>
|
||||
<item name="android:stepSize">0.5</item>
|
||||
<item name="android:progressDrawable">@drawable/module_commons_heart_ratingbar_drawable</item>
|
||||
</style>
|
||||
|
||||
<declare-styleable name="RoundLayout">
|
||||
<attr name="roundLayoutRadius" format="dimension" />
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
||||
@@ -114,7 +114,6 @@ dependencies {
|
||||
api project(':services:mogo-service-api')
|
||||
api project(':services:mogo-service')
|
||||
|
||||
api project(':modules:mogo-module-service')
|
||||
api project(':libraries:mogo-map')
|
||||
api project(':test:crashreport-upgrade')
|
||||
// api project(':test:crashreport-bugly')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.module.common.dialog;
|
||||
package com.mogo.eagle.core.function.hmi.dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
@@ -11,8 +11,8 @@ import android.widget.FrameLayout;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.module.common.R;
|
||||
|
||||
/**
|
||||
* 浮在各种wm上面的dialog基类,调用了window.setType
|
||||
@@ -1,12 +1,10 @@
|
||||
package com.mogo.module.common.wm;
|
||||
package com.mogo.eagle.core.function.hmi.dialog;
|
||||
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog;
|
||||
|
||||
/**
|
||||
* 采用Dialog实现接口
|
||||
*/
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.module.common.wm;
|
||||
package com.mogo.eagle.core.function.hmi.dialog;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.module.common.dialog;
|
||||
package com.mogo.eagle.core.function.hmi.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
@@ -7,8 +7,8 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.StringRes;
|
||||
|
||||
import com.mogo.module.common.R;
|
||||
import com.mogo.module.common.wm.WindowManagerView;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.module.common.wm;
|
||||
package com.mogo.eagle.core.function.hmi.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.PixelFormat;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.module.common.wm;
|
||||
package com.mogo.eagle.core.function.hmi.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -7,7 +7,7 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.hmi.WaringConst
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.module.common.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
|
||||
/**
|
||||
* V2X 预警广播接收。用于跨应用,跨进程,内部也可以通过这种方式弹出预警提示框
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.commons.mvp.BaseFragment
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.commons.voice.*
|
||||
@@ -83,6 +84,7 @@ import com.mogo.eagle.core.function.hmi.ui.tools.MaskView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.V2XNotificationView
|
||||
import com.mogo.eagle.core.function.main.utils.DisplayEffectsHelper
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.*
|
||||
@@ -96,7 +98,6 @@ import com.mogo.eagle.core.utilcode.reminder.api.impl.*
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils.millis2String
|
||||
import com.mogo.map.MogoMap
|
||||
import com.mogo.module.common.enums.*
|
||||
import com.zhidao.support.adas.high.common.MogoReport.Code.Error.EMAP.*
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import com.zhjt.service_biz.BizConfig
|
||||
@@ -133,7 +134,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
private var mSOPSettingView: SOPSettingView? = null
|
||||
|
||||
//StatusView
|
||||
private var statusBarViewFloat: WarningFloat.Builder? = null
|
||||
private var statusBarView: StatusBarView? = null
|
||||
|
||||
private var mNoticeFloat: WarningFloat.Builder? = null
|
||||
@@ -195,10 +195,10 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
//toggleStatusBarView()
|
||||
|
||||
initViewShowWithConfig()
|
||||
|
||||
val decorView = requireActivity().window.decorView as FrameLayout
|
||||
statusBarView = decorView.findViewWithTag<View>("status_bar") as StatusBarView?
|
||||
//设置StatusBar初始状态
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
statusBarView?.updateRightView(true, "demoMode", DemoModeView(requireContext()))
|
||||
@@ -592,6 +592,10 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
return HmiPresenter(this)
|
||||
}
|
||||
|
||||
override fun displayEffects() {
|
||||
DisplayEffectsHelper.getInstance().display()
|
||||
}
|
||||
|
||||
override fun setSpeedChartViewVisibility(visibility: Int) {
|
||||
viewSpeedChart?.visibility = visibility
|
||||
}
|
||||
@@ -746,52 +750,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
}
|
||||
}
|
||||
|
||||
private fun toggleStatusBarView() {
|
||||
activity?.let{
|
||||
if(statusBarViewFloat!= null){
|
||||
WarningFloat.dismiss(statusBarViewFloat!!.config.floatTag, false)
|
||||
statusBarViewFloat = null
|
||||
statusBarView = null
|
||||
}else{
|
||||
if (statusBarView == null){
|
||||
statusBarView = StatusBarView(it)
|
||||
}
|
||||
val side = TOP
|
||||
val gravity = Gravity.TOP
|
||||
statusBarViewFloat = WarningFloat.with(it)
|
||||
.setTag("statusBarView")
|
||||
.setLayout(statusBarView!!)
|
||||
.setSidePattern(side)
|
||||
.setWindowWidth(ScreenUtils.getScreenWidth())
|
||||
.setWindowHeight(BarUtils.getStatusBarHeight())
|
||||
.setGravity(gravity, 0)
|
||||
.setImmersionStatusBar(true)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = LinearInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示VR下V2X预警
|
||||
*
|
||||
|
||||
@@ -1,49 +1,54 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.bindingcar
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.module.status.StatusDescriptor
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener
|
||||
import com.mogo.service.statusmanager.StatusDescriptor
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
|
||||
|
||||
/**
|
||||
* @brief 修改车辆对话框
|
||||
* @author lixiaopeng
|
||||
*/
|
||||
class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver{
|
||||
class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||
|
||||
private val TAG = "BindingCarDialog"
|
||||
private var confirmTv: TextView? = null
|
||||
private var cancleTv: TextView? = null
|
||||
private var cancelTv: TextView? = null
|
||||
|
||||
private var mServiceApis: IMogoServiceApis? = null
|
||||
private val statusChangedListenerForCheckNotice = IMogoStatusChangedListener { descriptor, isTrue ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND) {
|
||||
dismiss()
|
||||
private val statusChangedListenerForCheckNotice =
|
||||
IMogoStatusChangedListener { descriptor, isTrue ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND) {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
setContentView(R.layout.dialog_modify_bindingcar)
|
||||
setCanceledOnTouchOutside(true)
|
||||
|
||||
confirmTv = findViewById(R.id.tv_bindingcar_confirm)
|
||||
cancleTv = findViewById(R.id.tv_bindingcar_cancel)
|
||||
cancelTv = findViewById(R.id.tv_bindingcar_cancel)
|
||||
|
||||
confirmTv?.setOnClickListener {
|
||||
modifyBindingcar()
|
||||
}
|
||||
|
||||
cancleTv?.setOnClickListener {
|
||||
cancelTv?.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(
|
||||
TAG,
|
||||
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||
statusChangedListenerForCheckNotice
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -62,6 +67,11 @@ class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifec
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(
|
||||
TAG,
|
||||
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||
statusChangedListenerForCheckNotice
|
||||
)
|
||||
}
|
||||
|
||||
fun showModifyBindingcarDialog() {
|
||||
|
||||
@@ -3,13 +3,13 @@ package com.mogo.eagle.core.function.hmi.ui.bindingcar
|
||||
import android.content.Context
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.module.status.StatusDescriptor
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener
|
||||
import com.mogo.service.statusmanager.StatusDescriptor
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
|
||||
|
||||
/**
|
||||
@@ -20,9 +20,8 @@ class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifecycle
|
||||
|
||||
private val TAG = "ToBindingCarDialog"
|
||||
private var confirmTv: TextView? = null
|
||||
private var cancleTv: TextView? = null
|
||||
private var cancelTv: TextView? = null
|
||||
|
||||
private var mServiceApis: IMogoServiceApis? = null
|
||||
private val statusChangedListenerForCheckNotice = IMogoStatusChangedListener { descriptor, isTrue ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND) {
|
||||
dismiss()
|
||||
@@ -34,15 +33,21 @@ class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifecycle
|
||||
setCanceledOnTouchOutside(true)
|
||||
|
||||
confirmTv = findViewById(R.id.tv_to_bindingcar_confirm)
|
||||
cancleTv = findViewById(R.id.tv_to_bindingcar_cancel)
|
||||
cancelTv = findViewById(R.id.tv_to_bindingcar_cancel)
|
||||
|
||||
confirmTv?.setOnClickListener {
|
||||
toBindingcar()
|
||||
}
|
||||
|
||||
cancleTv?.setOnClickListener {
|
||||
cancelTv?.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(
|
||||
TAG,
|
||||
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||
statusChangedListenerForCheckNotice
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,6 +66,11 @@ class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifecycle
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(
|
||||
TAG,
|
||||
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||
statusChangedListenerForCheckNotice
|
||||
)
|
||||
}
|
||||
|
||||
fun showToBindingcarDialog() {
|
||||
|
||||
@@ -1,24 +1,19 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.bindingcar
|
||||
|
||||
import android.content.Context
|
||||
import android.opengl.Visibility
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener
|
||||
import com.mogo.service.statusmanager.StatusDescriptor
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
|
||||
/**
|
||||
* @brief APP升级提示弹框
|
||||
* @author lixiaopeng
|
||||
*/
|
||||
class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver{
|
||||
class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||
|
||||
private val TAG = "UpgradeAppDialog"
|
||||
private var confirmTv: TextView? = null
|
||||
@@ -70,7 +65,13 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
|
||||
}
|
||||
|
||||
// 升级类型 1:提示升级 2:静默升级 3:强制升级
|
||||
fun showUpgradeAppDialog(name: String, url: String, title: String, content: String, installType: String) {
|
||||
fun showUpgradeAppDialog(
|
||||
name: String,
|
||||
url: String,
|
||||
title: String,
|
||||
content: String,
|
||||
installType: String
|
||||
) {
|
||||
if (isShowing) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ 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.ToastUtils
|
||||
import com.mogo.eagle.core.widget.media.video.SimpleVideoPlayer
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
||||
import com.shuyu.gsyvideoplayer.model.VideoOptionModel
|
||||
|
||||
@@ -18,7 +18,7 @@ import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.function.hmi.WaringConst;
|
||||
import com.mogo.eagle.core.function.hmi.notification.WarningFloat;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideRoundedCornersTransform;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform;
|
||||
import com.mogo.eagle.core.utilcode.util.BitmapHelper;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
|
||||
|
||||
@@ -7,19 +7,19 @@ import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.module.status.StatusDescriptor
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideRoundedCornersTransform
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
|
||||
import com.mogo.eagle.core.utilcode.util.BitmapHelper
|
||||
import com.mogo.eagle.core.widget.media.video.NoticeSimpleVideoPlayer
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener
|
||||
import com.mogo.service.statusmanager.StatusDescriptor
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
||||
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack
|
||||
@@ -94,13 +94,13 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
playVideo(mVideoUrl)
|
||||
}
|
||||
|
||||
mServiceApis = MogoApisHandler.getInstance().apis
|
||||
mServiceApis?.statusManagerApi?.registerStatusChangedListener(TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForCheckNotice)
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForCheckNotice)
|
||||
}
|
||||
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForCheckNotice)
|
||||
stopLive()
|
||||
}
|
||||
|
||||
@@ -125,7 +125,9 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
pushImageView?.let {
|
||||
GlideApp.with(context).load(noticeNormal.imageUrl).optionalTransform(
|
||||
GlideRoundedCornersTransform(
|
||||
20f, GlideRoundedCornersTransform.CornerType.ALL)
|
||||
20f,
|
||||
GlideRoundedCornersTransform.CornerType.ALL
|
||||
)
|
||||
).into(it)
|
||||
}
|
||||
|
||||
@@ -191,8 +193,12 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
playImageView!!.visibility = View.VISIBLE
|
||||
playImageView!!.setImageResource(R.drawable.notice_video_play)
|
||||
thumbnailImageView!!.visibility = View.VISIBLE
|
||||
GlideApp.with(context).load(firstbitmap).optionalTransform(GlideRoundedCornersTransform(
|
||||
20f, GlideRoundedCornersTransform.CornerType.ALL)).into(thumbnailImageView!!)
|
||||
GlideApp.with(context).load(firstbitmap).optionalTransform(
|
||||
GlideRoundedCornersTransform(
|
||||
20f,
|
||||
GlideRoundedCornersTransform.CornerType.ALL
|
||||
)
|
||||
).into(thumbnailImageView!!)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.function.hmi.WaringConst;
|
||||
import com.mogo.eagle.core.function.hmi.notification.WarningFloat;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideRoundedCornersTransform;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,27 +15,25 @@ import androidx.recyclerview.widget.StaggeredGridLayoutManager;
|
||||
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.module.status.StatusDescriptor;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo;
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData;
|
||||
import com.mogo.eagle.core.data.notice.NoticeValue;
|
||||
import com.mogo.eagle.core.function.api.notice.NoticeNetCallBack;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.function.call.notice.CallerNoticeManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideRoundedCornersTransform;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform;
|
||||
import com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.BitmapHelper;
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
|
||||
import com.mogo.eagle.core.widget.media.video.NoticeSimpleSmallVideoPlayer;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.imageloader.MogoImageView;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog;
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager;
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder;
|
||||
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack;
|
||||
@@ -64,9 +62,8 @@ public class NoticeTrafficDialog extends BaseFloatDialog implements LifecycleObs
|
||||
private TextView refuse;//拒绝
|
||||
private TextView connect;//连接
|
||||
private NoticeTrafficAdapter adapter;
|
||||
private final ArrayList dataArrayList = new ArrayList();
|
||||
private final ArrayList<NoticeValue> dataArrayList = new ArrayList<>();
|
||||
private NoticeTrafficStyleInfo.NoticeTrafficAccountInfo mTrafficStyleInfo;
|
||||
private IMogoServiceApis mServiceApis;
|
||||
|
||||
public NoticeTrafficDialog(@NonNull Context context, NoticeTrafficStylePushData pushData) {
|
||||
super(context);
|
||||
@@ -84,8 +81,7 @@ public class NoticeTrafficDialog extends BaseFloatDialog implements LifecycleObs
|
||||
setCanceledOnTouchOutside(true);
|
||||
playerShow();//视频播放器及接操作按钮
|
||||
recyclerVie();//详情信息列表
|
||||
mServiceApis = MogoApisHandler.getInstance().getApis();
|
||||
mServiceApis.getStatusManagerApi().registerStatusChangedListener(M_HMI + TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForNotice);
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(M_HMI + TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForNotice);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -169,7 +165,7 @@ public class NoticeTrafficDialog extends BaseFloatDialog implements LifecycleObs
|
||||
* 开启自动驾驶
|
||||
*/
|
||||
private void startAutoPilot() {
|
||||
if (mTrafficStyleInfo != null){
|
||||
if (mTrafficStyleInfo != null) {
|
||||
AutopilotControlParameters parameters = new AutopilotControlParameters();
|
||||
parameters.isSpeakVoice = false;
|
||||
parameters.vehicleType = 10;
|
||||
@@ -356,13 +352,10 @@ public class NoticeTrafficDialog extends BaseFloatDialog implements LifecycleObs
|
||||
*/
|
||||
private void requestTrafficInfo() {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "requestTrafficInfo");
|
||||
CallerNoticeManager.getNoticeProvider().requestAccidentInfo(mPushData.getInfoId(), MoGoAiCloudClientConfig.getInstance().getSn(), new NoticeNetCallBack() {
|
||||
@Override
|
||||
public void callBackWithResult(NoticeTrafficStyleInfo trafficInfo) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "交通事故详情::" + trafficInfo);
|
||||
mTrafficStyleInfo = trafficInfo.getResult().getAccidentInfo();
|
||||
infoRefresh(mTrafficStyleInfo);
|
||||
}
|
||||
CallerNoticeManager.getNoticeProvider().requestAccidentInfo(mPushData.getInfoId(), MoGoAiCloudClientConfig.getInstance().getSn(), trafficInfo -> {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "交通事故详情::" + trafficInfo);
|
||||
mTrafficStyleInfo = trafficInfo.getResult().getAccidentInfo();
|
||||
infoRefresh(mTrafficStyleInfo);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -445,6 +438,7 @@ public class NoticeTrafficDialog extends BaseFloatDialog implements LifecycleObs
|
||||
public void dismiss() {
|
||||
super.dismiss();
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "trafficDialog dismiss");
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(M_HMI + TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForNotice);
|
||||
releasePlayer();
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ import com.mogo.map.MogoMap
|
||||
import com.mogo.map.MogoMapUIController
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.*
|
||||
import com.mogo.module.service.routeoverlay.*
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.*
|
||||
import com.zhidao.easysocket.utils.L
|
||||
import com.zhidao.support.adas.high.other.permission.BackgrounderPermission
|
||||
import com.zhjt.mogo_core_function_devatools.env.*
|
||||
|
||||
@@ -17,8 +17,7 @@ import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.kotlin.currentPadding
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.module.service.routeoverlay.RouteStrategy
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.RouteStrategy
|
||||
import kotlinx.android.synthetic.main.view_sop_setting.view.*
|
||||
import kotlinx.android.synthetic.main.view_sop_setting.view.tbRouteDynamicEffect
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import android.content.Context
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
|
||||
@@ -4,7 +4,7 @@ import android.content.Context
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
|
||||
@@ -18,7 +18,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import kotlinx.android.synthetic.main.view_autopilot_status.view.*
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.*
|
||||
import android.util.*
|
||||
import android.view.*
|
||||
import android.widget.*
|
||||
import com.mogo.commons.*
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.FrameLayout
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.*
|
||||
import com.mogo.map.*
|
||||
import com.mogo.map.uicontroller.*
|
||||
import com.mogo.module.common.constants.*
|
||||
import com.mogo.map.MogoMapUIController
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import kotlinx.android.synthetic.main.view_perspective_switch.view.*
|
||||
|
||||
/**
|
||||
@@ -34,17 +32,20 @@ class PerspectiveSwitchView @JvmOverloads constructor(
|
||||
if (MogoMapUIController.getInstance().currentMapVisualAngle.isLongSight) {
|
||||
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
|
||||
// .visibleAllMarkers()
|
||||
MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
|
||||
MogoMapUIController.getInstance()
|
||||
.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
|
||||
textSwitch.setText(R.string.module_map_model_normal)
|
||||
} else if (MogoMapUIController.getInstance().currentMapVisualAngle.isMediumSight) {
|
||||
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
|
||||
// .inVisibleWithoutMarkers(DataTypes.TYPE_MARKER_ADAS)
|
||||
MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null)
|
||||
MogoMapUIController.getInstance()
|
||||
.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null)
|
||||
textSwitch.setText(R.string.module_map_model_faster)
|
||||
} else {
|
||||
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
|
||||
// .visibleAllMarkers()
|
||||
MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
|
||||
MogoMapUIController.getInstance()
|
||||
.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
|
||||
textSwitch.setText(R.string.module_map_model_normal)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,8 +28,10 @@ import com.kwai.koom.base.MonitorManager;
|
||||
import com.kwai.koom.nativeoom.leakmonitor.LeakMonitor;
|
||||
import com.kwai.koom.nativeoom.leakmonitor.LeakMonitorConfig;
|
||||
import com.kwai.koom.nativeoom.leakmonitor.LeakRecord;
|
||||
import com.mogo.commons.analytics.AnalyticsUtils;
|
||||
import com.mogo.commons.context.ContextHolderUtil;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.mvp.BaseFragment;
|
||||
import com.mogo.commons.mvp.MvpActivity;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
@@ -58,10 +60,6 @@ import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.fragmentmanager.FragmentStackTransactionListener;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.rousetime.android_startup.StartupManager;
|
||||
import com.rousetime.android_startup.model.LoggerLevel;
|
||||
import com.rousetime.android_startup.model.StartupConfig;
|
||||
@@ -85,15 +83,11 @@ import system_master.SystemStatusInfo;
|
||||
*/
|
||||
public class MainActivity extends MvpActivity<MainView, MainPresenter> implements MainView,
|
||||
IMogoLocationListener,
|
||||
FragmentStackTransactionListener,
|
||||
IMoGoAutopilotStatusListener {
|
||||
|
||||
protected static final String TAG = "MainActivity";
|
||||
private static final int REQUEST_CODE_DIALOG = 100;
|
||||
|
||||
protected IMogoServiceApis mServiceApis;
|
||||
protected IMogoStatusManager mMogoStatusManager;
|
||||
|
||||
protected FrameLayout mFloatingLayout;
|
||||
protected View mCoverUpLayout;
|
||||
|
||||
@@ -103,7 +97,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
|
||||
private RecyclerView mConnectInfoRV;
|
||||
private ConnInfoAdapter mConnAdapter;
|
||||
private List<AutopilotStatusInfo> dataList = new ArrayList<>();
|
||||
private final List<AutopilotStatusInfo> dataList = new ArrayList<>();
|
||||
private int mLastStatus = 0x00;
|
||||
private boolean isFloatingLayerHidden = false;
|
||||
|
||||
@@ -218,16 +212,12 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
properties.put("app_launch_hotStartTime", hotStartTime);
|
||||
}
|
||||
}
|
||||
MogoApisHandler.getInstance().getApis().getAnalyticsApi().track("app_launch_time", properties);
|
||||
AnalyticsUtils.track("app_launch_time", properties);
|
||||
}
|
||||
}
|
||||
|
||||
private void init() {
|
||||
if (mServiceApis == null) {
|
||||
mServiceApis = MogoApisHandler.getInstance().getApis();
|
||||
}
|
||||
mMogoStatusManager = mServiceApis.getStatusManagerApi();
|
||||
mMogoStatusManager.setMainPageLaunchedStatus(TAG, true);
|
||||
MogoStatusManager.getInstance().setMainPageLaunchedStatus(TAG, true);
|
||||
}
|
||||
|
||||
private void initConnectInfoRV() {
|
||||
@@ -275,7 +265,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
loadFunctionFragment();
|
||||
|
||||
// TODO 这里临时兼容进入VR模式,标记状态机。有些业务(OCH)会根据状态判断加载
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode(TAG, true);
|
||||
MogoStatusManager.getInstance().setVrMode(TAG, true);
|
||||
// 设置地图样式
|
||||
MogoMapListenerHandler.getInstance().onMapModeChanged(EnumMapUI.MAP_STYLE_DAY_VR);
|
||||
});
|
||||
@@ -286,21 +276,11 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
loadFunctionMapView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransaction(int size) {
|
||||
if (size == 0) {
|
||||
showLayout();
|
||||
} else if (size == 1) {
|
||||
hideLayout();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载其它模块
|
||||
*/
|
||||
protected void loadOthersModules() {
|
||||
// 加载地图,触发地图加载完毕回调,在初始化其他卡片模块,保证卡片模块可以正确获取地图相关服务。
|
||||
MogoModulesManager.getInstance().loadModules();
|
||||
MogoModulesManager.getInstance().loadFunctionModules();
|
||||
mPresenter.delayOperations();
|
||||
MogoModulesManager.getInstance().loadFunctionModulesServer();
|
||||
@@ -317,8 +297,8 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
* 启动后台服务
|
||||
*/
|
||||
private void startBaseService() {
|
||||
Intent intentMainServicee = new Intent(this, MogoMainService.class);
|
||||
startService(intentMainServicee);
|
||||
Intent intentMainService = new Intent(this, MogoMainService.class);
|
||||
startService(intentMainService);
|
||||
|
||||
// USB 摄像头行车记录仪进程
|
||||
// Intent intentCarcorderService = new Intent(this, CarcorderService.class);
|
||||
@@ -404,23 +384,20 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
mMogoStatusManager.setMainPageResumeStatus(TAG, true);
|
||||
mMogoStatusManager.setMainPageIsBackgroundStatus(TAG, false);
|
||||
MogoStatusManager.getInstance().setMainPageResumeStatus(TAG, true);
|
||||
MogoStatusManager.getInstance().setMainPageIsBackgroundStatus(TAG, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
mMogoStatusManager.setMainPageResumeStatus(TAG, false);
|
||||
MogoStatusManager.getInstance().setMainPageResumeStatus(TAG, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
if (mMogoStatusManager != null) {
|
||||
mMogoStatusManager.setMainPageIsBackgroundStatus(TAG, true);
|
||||
}
|
||||
MogoStatusManager.getInstance().setMainPageIsBackgroundStatus(TAG, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -431,15 +408,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
mPresenter.handleSchemeIntent(intent, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoServiceApis getApis() {
|
||||
if (mServiceApis == null) {
|
||||
mServiceApis = MogoApisHandler.getInstance().getApis();
|
||||
}
|
||||
return mServiceApis;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -492,17 +460,16 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
listenerRegister.unregisterMarkerClickListener();
|
||||
listenerRegister.unregisterHostMapListener();
|
||||
}
|
||||
mMogoStatusManager.setMainPageLaunchedStatus(TAG, false);
|
||||
mMogoStatusManager.setMainPageIsBackgroundStatus(TAG, false);
|
||||
|
||||
IMogoMapUIController mapUIController = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
||||
if (mapUIController != null) {
|
||||
mapUIController.destroy();
|
||||
}
|
||||
MogoStatusManager.getInstance().setMainPageLaunchedStatus(TAG, false);
|
||||
MogoStatusManager.getInstance().setMainPageIsBackgroundStatus(TAG, false);
|
||||
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "destroy.");
|
||||
ContextHolderUtil.releaseContext();
|
||||
MogoModulesManager.getInstance().onDestroy();
|
||||
SchemeIntent.getInstance().clear();
|
||||
FloatingViewHandler.clear();
|
||||
ProcessUtils.killAllBackgroundProcesses();
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Process;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.widget.FrameLayout;
|
||||
@@ -22,12 +21,13 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.module.intent.IMogoIntentListener;
|
||||
import com.mogo.commons.module.intent.IntentManager;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.function.main.moujie.BluetoothMonitorReceiver;
|
||||
@@ -36,8 +36,6 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.rousetime.android_startup.model.CostTimesModel;
|
||||
import com.zhjt.service.chain.ChainLog;
|
||||
import com.zhjt.service.chain.TracingConstants;
|
||||
@@ -48,7 +46,6 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.Timer;
|
||||
@@ -73,7 +70,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
|
||||
private BluetoothMonitorReceiver mBluetoothReceiver = null;
|
||||
private BluetoothAdapter mBluetoothAdapter;
|
||||
// private List<BluetoothDevice> mAreadlyConnectedList = new ArrayList<>();//已连接设备集合
|
||||
// private List<BluetoothDevice> mAreadlyConnectedList = new ArrayList<>();//已连接设备集合
|
||||
private int numberA = 0;
|
||||
private boolean isLongPressA = false;
|
||||
private int numberB = 0;
|
||||
@@ -123,7 +120,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
getApis().getIntentManagerApi().registerIntentListener(Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this);
|
||||
IntentManager.getInstance().registerIntentListener(Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this);
|
||||
// 添加换肤监听
|
||||
CallerSkinModeListenerManager.INSTANCE.addListener(TAG, this);
|
||||
//ActivityLifecycleManager.getInstance().setAppActive(true);
|
||||
@@ -138,7 +135,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
getApis().getIntentManagerApi().unregisterIntentListener(Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this);
|
||||
IntentManager.getInstance().unregisterIntentListener(Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this);
|
||||
//ActivityLifecycleManager.getInstance().setAppActive(false);
|
||||
}
|
||||
|
||||
@@ -381,7 +378,6 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
|
||||
/**
|
||||
* 查找蓝牙连接过的蓝牙设备
|
||||
*
|
||||
*/
|
||||
private void showBondedDevice(BluetoothAdapter bluetoothAdapter) {
|
||||
// mAreadlyConnectedList.clear();
|
||||
|
||||
@@ -10,6 +10,8 @@ import com.elegant.utils.UiThreadHandler;
|
||||
import com.mogo.cloud.socket.SocketBuildConfig;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.module.MogoModule;
|
||||
import com.mogo.commons.module.MogoModulePaths;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig;
|
||||
@@ -17,7 +19,6 @@ import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.function.api.chat.biz.ChatConsts;
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.notice.PushUIConstants;
|
||||
import com.mogo.eagle.core.function.overview.OverviewDb;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils;
|
||||
@@ -25,9 +26,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.ProcessUtils;
|
||||
import com.mogo.map.MapApiPath;
|
||||
import com.mogo.module.common.MogoModule;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.zhidao.support.obu.ami.AmiClientManager;
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.CpuInfo;
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.MemInfo;
|
||||
@@ -138,7 +136,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
MogoModulePaths.addModuleFunction(new MogoModule("/och/api", "IMoGoFunctionProvider"));
|
||||
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MapApiPath.PATH, "CustomMapApiBuilder"));
|
||||
MogoModulePaths.addBaseModule(new MogoModule(ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY));
|
||||
// MogoModulePaths.addBaseModule(new MogoModule(V2XConst.PATH_V2X_UI, V2XConst.MODULE_NAME));
|
||||
|
||||
// OBU 模块
|
||||
@@ -155,8 +152,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_V2X_MODULE, "V2XProvider"));
|
||||
// 自动驾驶系统检测模块
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_CHECK, "CheckProvider"));
|
||||
// 推送模块
|
||||
MogoModulePaths.addModule(new MogoModule(PushUIConstants.PATH, "PUSH_UI"));
|
||||
// 绑定车辆
|
||||
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_BINDING_CAR, "IMoGoBindingcarProvider"));
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.main;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
@@ -43,7 +42,6 @@ public class MainPresenter extends Presenter<MainView> {
|
||||
|
||||
public MainPresenter(MainView view) {
|
||||
super(view);
|
||||
SchemeIntent.getInstance().init(getContext(), mView.getApis());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -109,7 +107,4 @@ public class MainPresenter extends Presenter<MainView> {
|
||||
mMsgHandler.sendMessage(msg);
|
||||
}
|
||||
|
||||
public void handleSchemeIntent(Intent intent, boolean isOnNewIntent) {
|
||||
SchemeIntent.getInstance().handle(intent, isOnNewIntent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,11 +26,4 @@ public interface MainView extends IView {
|
||||
*/
|
||||
void loadModules();
|
||||
|
||||
/**
|
||||
* 接口水龙头
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
IMogoServiceApis getApis();
|
||||
|
||||
}
|
||||
|
||||
@@ -1,204 +0,0 @@
|
||||
package com.mogo.eagle.core.function.main;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.CommonUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-04-20
|
||||
* <p>
|
||||
* scheme 意图处理
|
||||
* <p>
|
||||
* 导航:adb shell am start -d "mogo://launcher/main/switch2?type=navi'&'lon=116.327007'&'lat=39.977639"
|
||||
*/
|
||||
public class SchemeIntent implements IMogoStatusChangedListener {
|
||||
|
||||
private static final String TAG = "SchemeIntent";
|
||||
|
||||
public static final String TYPE_NAVI = "navi";
|
||||
|
||||
public static final String TYPE_SEARCH_ROAD_CONDITION = "search-road-condition";
|
||||
|
||||
public static final String TYPE_LAUNCH = "launch";
|
||||
|
||||
public static final String TYPE_SHOW_ONLINE_CAR_PANEL = "showOnlineCarPanel";
|
||||
|
||||
public static final String TYPE_SHOW_SHARE_PANEL = "showSharePanel";
|
||||
public static final String TYPE_SHOW_HISTORY_PANEL = "showHistoryPanel";
|
||||
public static final String TYPE_SHOW_SURROUNDING_PANEL = "showSurroundingPanel";
|
||||
|
||||
private IMogoServiceApis mApis;
|
||||
private Context mContext;
|
||||
|
||||
private IntentWrapper mNextIntent;
|
||||
|
||||
private static class IntentWrapper {
|
||||
public Intent mIntent;
|
||||
public long mDelay;
|
||||
|
||||
public IntentWrapper(Intent intent, long delay) {
|
||||
this.mIntent = intent;
|
||||
this.mDelay = delay;
|
||||
}
|
||||
}
|
||||
|
||||
private static volatile SchemeIntent sInstance;
|
||||
|
||||
private SchemeIntent() {
|
||||
}
|
||||
|
||||
public static SchemeIntent getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (SchemeIntent.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new SchemeIntent();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
public void init(Context context, IMogoServiceApis apis) {
|
||||
mContext = context;
|
||||
mApis = apis;
|
||||
mApis.getStatusManagerApi().registerStatusChangedListener(TAG, StatusDescriptor.MAIN_PAGE_RESUME, this);
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
mApis.getStatusManagerApi().unregisterStatusChangedListener(TAG, StatusDescriptor.MAIN_PAGE_RESUME, this);
|
||||
mContext = null;
|
||||
mApis = null;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理scheme
|
||||
*
|
||||
* @param intent 跳转的intent
|
||||
* @param isOnNewIntent 根据这个参数判断是从onCreate过来还是从onNewIntent过来,从而可以在{@link #isDelay(Intent, boolean)}里面确定延时逻辑,如果是从onNewIntent过来是不需要延时的
|
||||
*/
|
||||
public void handle(Intent intent, boolean isOnNewIntent) {
|
||||
if (intent == null || intent.getData() == null) {
|
||||
return;
|
||||
}
|
||||
Uri target = intent.getData();
|
||||
String path = target.getPath();
|
||||
if (path == null || path.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mApis.getStatusManagerApi().isMainPageOnResume()) {
|
||||
long delay = 0L;
|
||||
if (isDelay(intent, isOnNewIntent)) {
|
||||
delay = 5_000L;
|
||||
}
|
||||
mNextIntent = new IntentWrapper(intent, delay);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (path) {
|
||||
case "/main/switch2":
|
||||
handleSwitch2Action(target);
|
||||
break;
|
||||
case "/main/share":
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "收到打开分享框的scheme,准备打开分享框");
|
||||
// Map<String, Object> properties = new HashMap<>();
|
||||
// properties.put("from", "1");
|
||||
// mApis.getAnalyticsApi().track("v2x_share_click", properties);
|
||||
// mApis.getShareManager().showShareDialog();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
mNextIntent = null;
|
||||
}
|
||||
|
||||
private boolean isDelay(Intent intent, boolean isOnNewIntent) {
|
||||
if (isOnNewIntent || intent == null || intent.getData() == null) {
|
||||
return false;
|
||||
}
|
||||
Uri target = intent.getData();
|
||||
String type = target.getQueryParameter("type");
|
||||
return TextUtils.equals(TYPE_NAVI, type) || TextUtils.equals(TYPE_SHOW_SHARE_PANEL, type);
|
||||
}
|
||||
|
||||
private void handleSwitch2Action(Uri target) {
|
||||
String type = target.getQueryParameter("type");
|
||||
if (TextUtils.isEmpty(type)) {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "语音打开事件面板" + type);
|
||||
switch (type) {
|
||||
case TYPE_LAUNCH:
|
||||
handleLaunchIntent(target);
|
||||
break;
|
||||
case TYPE_SHOW_HISTORY_PANEL:
|
||||
handleShowEventPanel(0);
|
||||
break;
|
||||
case TYPE_SHOW_SURROUNDING_PANEL:
|
||||
handleShowEventPanel(1);
|
||||
break;
|
||||
case TYPE_SHOW_SHARE_PANEL:
|
||||
handleShowEventPanel(2);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void handleLaunchIntent(Uri uri) {
|
||||
String type = uri.getQueryParameter("channelType");
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("appname", CommonUtils.getAppName(mContext));
|
||||
properties.put("appversion", CommonUtils.getVersionName(mContext));
|
||||
properties.put("from", type);
|
||||
mApis.getAnalyticsApi().track("appenterfront", properties);
|
||||
}
|
||||
|
||||
/**
|
||||
* 语音打开事件面板
|
||||
*/
|
||||
private void handleShowEventPanel(int item) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "语音打开事件面板" + item);
|
||||
//mApis.getEventPanelManager().showPanelWithSelectedItem(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_RESUME) {
|
||||
if (mNextIntent == null) {
|
||||
return;
|
||||
}
|
||||
if (isTrue) {
|
||||
// 保证回到桌面后在开始该规划路线。
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
if (mNextIntent == null) {
|
||||
return;
|
||||
}
|
||||
handle(mNextIntent.mIntent, false);
|
||||
}, mNextIntent.mDelay);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,11 +8,6 @@ package com.mogo.eagle.core.function.main.cards;
|
||||
*/
|
||||
public interface MogoModulesHandler {
|
||||
|
||||
/**
|
||||
* 加载模块
|
||||
*/
|
||||
void loadModules();
|
||||
|
||||
/**
|
||||
* 架构升级v1.1加载功能模块
|
||||
*/
|
||||
@@ -27,7 +22,6 @@ public interface MogoModulesHandler {
|
||||
* 加载基本服务模块,需要不启动页面就能运行
|
||||
* <p>
|
||||
* 1. v2x
|
||||
* 2. mogo-module-service
|
||||
*/
|
||||
void loadBaseModule();
|
||||
|
||||
|
||||
@@ -5,18 +5,14 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.module.MogoModule;
|
||||
import com.mogo.commons.module.MogoModulePaths;
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.function.main.MainActivity;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.ResourcesHelper;
|
||||
import com.mogo.module.common.MogoModule;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
@@ -35,18 +31,15 @@ public class MogoModulesManager implements MogoModulesHandler {
|
||||
|
||||
private MainActivity mActivity;
|
||||
private Application mApp;
|
||||
|
||||
private Map<MogoModule, IMogoModuleProvider> mModuleProviders = new HashMap<>();
|
||||
// 空间换效率
|
||||
private Map<String, IMogoModuleProvider> mModuleNameProviders = new HashMap<>();
|
||||
private static final byte[] obj = new byte[0];
|
||||
|
||||
// 架构升级后的加载功能模块的方式
|
||||
private Map<MogoModule, IMoGoFunctionProvider> mModuleFunctionProviders = new HashMap<>();
|
||||
private Map<String, IMoGoFunctionProvider> mModuleNameFunctionProviders = new HashMap<>();
|
||||
private final Map<MogoModule, IMoGoFunctionProvider> mModuleFunctionProviders = new HashMap<>();
|
||||
private final Map<String, IMoGoFunctionProvider> mModuleNameFunctionProviders = new HashMap<>();
|
||||
|
||||
// 架构升级后的加载功能模块的方式
|
||||
private Map<MogoModule, IMoGoFunctionServerProvider> mModuleFunctionServerProviders = new HashMap<>();
|
||||
private Map<String, IMoGoFunctionServerProvider> mModuleNameFunctionServerProviders = new HashMap<>();
|
||||
private final Map<MogoModule, IMoGoFunctionServerProvider> mModuleFunctionServerProviders = new HashMap<>();
|
||||
private final Map<String, IMoGoFunctionServerProvider> mModuleNameFunctionServerProviders = new HashMap<>();
|
||||
|
||||
private static volatile MogoModulesManager sInstance;
|
||||
|
||||
@@ -55,7 +48,7 @@ public class MogoModulesManager implements MogoModulesHandler {
|
||||
|
||||
public static MogoModulesManager getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (MogoModulesManager.class) {
|
||||
synchronized (obj) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new MogoModulesManager();
|
||||
}
|
||||
@@ -84,21 +77,6 @@ public class MogoModulesManager implements MogoModulesHandler {
|
||||
return mApp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadModules() {
|
||||
final List<MogoModule> modules = MogoModulePaths.getModules();
|
||||
if (modules != null && !modules.isEmpty()) {
|
||||
for (MogoModule module : modules) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "module.getPath():" + module.getPath() + " name: " + module.getName());
|
||||
IMogoModuleProvider provider = load(module.getPath());
|
||||
if (provider != null) {
|
||||
mModuleProviders.put(module, provider);
|
||||
mModuleNameProviders.put(module.getName(), provider);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadFunctionModules() {
|
||||
final List<MogoModule> modules = MogoModulePaths.getModuleFunctions();
|
||||
@@ -151,15 +129,6 @@ public class MogoModulesManager implements MogoModulesHandler {
|
||||
}
|
||||
}
|
||||
|
||||
private IMogoModuleProvider load(String path) {
|
||||
try {
|
||||
return (IMogoModuleProvider) ARouter.getInstance().build(path).navigation(getContext());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private IMoGoFunctionProvider loadFunction(String path) {
|
||||
try {
|
||||
return (IMoGoFunctionProvider) ARouter.getInstance().build(path).navigation(getContext());
|
||||
@@ -178,45 +147,8 @@ public class MogoModulesManager implements MogoModulesHandler {
|
||||
}
|
||||
}
|
||||
|
||||
private void addFragment(IMogoModuleProvider provider, int containerId) {
|
||||
if (provider == null) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "add fragment fail cause provider == null, container is " + ResourcesHelper.getResNameById(getApplicationContext(), containerId));
|
||||
return;
|
||||
}
|
||||
Fragment fragment = null;
|
||||
fragment = mActivity.getSupportFragmentManager().findFragmentByTag(provider.getModuleName());
|
||||
if (fragment == null) {
|
||||
fragment = provider.createFragment(getContext(), null);
|
||||
}
|
||||
if (fragment == null) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "add fragment fail cause fragment == null, container is " + ResourcesHelper.getResNameById(getApplicationContext(), containerId));
|
||||
return;
|
||||
}
|
||||
mActivity.getSupportFragmentManager().beginTransaction()
|
||||
.replace(containerId, fragment, provider.getModuleName())
|
||||
.commitAllowingStateLoss();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (mModuleNameProviders != null) {
|
||||
Collection<IMogoModuleProvider> modules = mModuleNameProviders.values();
|
||||
if (modules != null) {
|
||||
for (IMogoModuleProvider module : modules) {
|
||||
try {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "destroy module: " + module.getModuleName());
|
||||
module.onDestroy();
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, e + " onDestroy");
|
||||
}
|
||||
}
|
||||
}
|
||||
mModuleNameProviders.clear();
|
||||
}
|
||||
if (mModuleProviders != null) {
|
||||
mModuleProviders.clear();
|
||||
}
|
||||
if (mModuleFunctionProviders != null) {
|
||||
Collection<IMoGoFunctionProvider> modules = mModuleFunctionProviders.values();
|
||||
if (modules != null) {
|
||||
|
||||
@@ -21,8 +21,6 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.navi.MogoCarLocationChangedListenerRegister;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
|
||||
public
|
||||
/**
|
||||
@@ -35,7 +33,6 @@ public
|
||||
class MogoMainService extends Service implements IMogoLocationListener {
|
||||
|
||||
private static final String TAG = "MogoMainService";
|
||||
private IMogoServiceApis mServiceApis;
|
||||
|
||||
/**
|
||||
* 主模块管控定位,可以向各个模块发送统一定位信息
|
||||
@@ -45,7 +42,6 @@ class MogoMainService extends Service implements IMogoLocationListener {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "基本服务启动");
|
||||
mServiceApis = MogoApisHandler.getInstance().getApis();
|
||||
initAndStartLocation();
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "5秒已过,启动基础服务……");
|
||||
@@ -106,6 +102,5 @@ class MogoMainService extends Service implements IMogoLocationListener {
|
||||
mLocationClient.destroy();
|
||||
mLocationClient = null;
|
||||
}
|
||||
mServiceApis = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.mogo.eagle.core.function.main.utils;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.service.v2x.DisplayEffectsInterface;
|
||||
|
||||
/**
|
||||
* created by wujifei on 2021/3/30 15:45
|
||||
* describe:
|
||||
*/
|
||||
@Route(path = MogoServicePaths.PATH_MAIN_DISPLAY_EFFECTS_MANAGER)
|
||||
public class DisplayEffectsManager implements DisplayEffectsInterface {
|
||||
private Context context;
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayEffects(String type) {
|
||||
DisplayEffectsHelper.getInstance().display();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import android.widget.FrameLayout;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.service.windowview.IMogoWindowManager;
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewLayoutSet;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -14,8 +14,8 @@ import com.mogo.service.windowview.IMogoWindowManager;
|
||||
* <p>
|
||||
* 根据优先级控制显示 window view.
|
||||
*/
|
||||
@Route( path = MogoServicePaths.PATH_WINDOW_MANAGER )
|
||||
public class MogoWindowManager implements IMogoWindowManager {
|
||||
@Route( path = MogoServicePaths.PATH_FLOAT_VIEW_MANAGER )
|
||||
public class FloatViewManager implements IViewLayoutSet {
|
||||
|
||||
@Override
|
||||
public void addView( View view, int x, int y, boolean movable ) {
|
||||
@@ -1,14 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"
|
||||
>
|
||||
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#3E7FFC"
|
||||
android:startColor="#5CC1FF" />
|
||||
|
||||
<corners
|
||||
android:bottomLeftRadius="@dimen/dp_30"
|
||||
/>
|
||||
<corners android:bottomLeftRadius="@dimen/dp_30" />
|
||||
</shape>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#50526E"
|
||||
android:startColor="#333F4057" />
|
||||
<corners android:bottomRightRadius="@dimen/dp_30"/>
|
||||
<corners android:bottomRightRadius="@dimen/dp_30" />
|
||||
|
||||
</shape>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/module_commons_dlg_bkg"
|
||||
android:background="@color/color_99000000"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -19,7 +19,7 @@
|
||||
android:layout_height="@dimen/dp_56"
|
||||
android:layout_marginTop="@dimen/dp_134"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
@@ -33,7 +33,7 @@
|
||||
android:layout_height="@dimen/dp_128"
|
||||
android:background="@drawable/module_commons_shape_left_btn_bkg"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
@@ -45,7 +45,7 @@
|
||||
android:layout_height="@dimen/dp_128"
|
||||
android:background="@drawable/module_commons_shape_right_btn_bkg"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
@@ -79,7 +79,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_push_dialog_acc_title" />
|
||||
|
||||
<!--缩略图-->
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/thumbnail_image"
|
||||
android:layout_width="@dimen/module_push_dialog_check_acc_image_width"
|
||||
android:layout_height="@dimen/module_push_dialog_check_acc_image__height"
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/notice_traffic_dialog_title" />
|
||||
<!---->
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/thumbnail_image"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
|
||||
@@ -53,4 +53,19 @@
|
||||
<attr name="defaultColor" format="color"/> <!--档位默认色值-->
|
||||
<attr name="selectColor" format="color"/> <!--当前档位色值-->
|
||||
</declare-styleable>
|
||||
|
||||
<style name="BaseFloatDialogStyle" parent="@android:style/Theme.Dialog">
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:backgroundDimAmount">0.6</item>
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:fullBright">@android:color/transparent</item>
|
||||
<item name="android:fullDark">@android:color/transparent</item>
|
||||
<item name="android:topBright">@android:color/transparent</item>
|
||||
<item name="android:topDark">@android:color/transparent</item>
|
||||
<item name="android:borderlessButtonStyle">@android:color/transparent</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -40,6 +40,7 @@
|
||||
<color name="color_FF2966EC">#FF2966EC</color>
|
||||
<color name="color_FFA7B6F0">#FFA7B6F0</color>
|
||||
<color name="color_B3FFFFFF">#B3FFFFFF</color>
|
||||
<color name="color_99000000">#99000000</color>
|
||||
|
||||
|
||||
<color name="version_latest_start_color">#6D7BAF</color>
|
||||
|
||||
@@ -94,7 +94,6 @@ dependencies {
|
||||
implementation project(":libraries:mogo-map")
|
||||
implementation project(":libraries:mogo-map-api")
|
||||
implementation project(':libraries:mogo-adas')
|
||||
implementation project(':modules:mogo-module-service')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.map
|
||||
package com.mogo.eagle.core.function.business
|
||||
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.impl.collect
|
||||
package com.mogo.eagle.core.function.business.collect
|
||||
|
||||
import android.content.Context
|
||||
import android.text.TextUtils
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.map.identify;
|
||||
package com.mogo.eagle.core.function.business.identify;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.map.identify
|
||||
package com.mogo.eagle.core.function.business.identify
|
||||
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import mogo.telematics.pad.MessagePad
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.mogo.eagle.core.function.map.identify
|
||||
package com.mogo.eagle.core.function.business.identify
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.w
|
||||
import com.mogo.map.MogoMarkerManager
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
|
||||
@@ -38,7 +38,7 @@ class IdentifyBeautifyDataDrawer : Identify {
|
||||
w(TAG, "感知数据为空无需渲染……")
|
||||
return
|
||||
}
|
||||
if (!MogoApisHandler.getInstance().apis.statusManagerApi.isVrMode) {
|
||||
if (!MogoStatusManager.getInstance().isVrMode) {
|
||||
TrackManager.getInstance().clearAll()
|
||||
w(TAG, "渲染 adas 识别的数据 当前不是VR模式")
|
||||
return
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.map.identify
|
||||
package com.mogo.eagle.core.function.business.identify
|
||||
|
||||
import android.os.Handler
|
||||
import android.os.Message
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.mogo.eagle.core.function.map.identify
|
||||
package com.mogo.eagle.core.function.business.identify
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import androidx.collection.ArraySet
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.w
|
||||
import com.mogo.map.MogoMarkerManager
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import mogo.telematics.pad.MessagePad.PlanningObject
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
@@ -60,7 +60,7 @@ class IdentifyOriginDataDrawer : Identify {
|
||||
w(TAG, "感知数据为空无需渲染……")
|
||||
return
|
||||
}
|
||||
if (!MogoApisHandler.getInstance().apis.statusManagerApi.isVrMode) {
|
||||
if (!MogoStatusManager.getInstance().isVrMode) {
|
||||
clearOldMarker()
|
||||
w(TAG, "渲染 adas 识别的数据 当前不是VR模式")
|
||||
return
|
||||
@@ -69,7 +69,7 @@ class IdentifyOriginDataDrawer : Identify {
|
||||
//清除缓存
|
||||
for (data in resultList) {
|
||||
if (trafficDataUuidList.size > 0 && trafficDataUuidList.contains("" + data.uuid)) {
|
||||
if (TrackerSourceHelper.filterData(data)) {
|
||||
if (TrackerSourceColorHelper.filterData(data)) {
|
||||
continue
|
||||
}
|
||||
trafficDataUuidList.remove("" + data.uuid)
|
||||
@@ -105,7 +105,7 @@ class IdentifyOriginDataDrawer : Identify {
|
||||
trafficDataUuidList.clear()
|
||||
for (data in trafficData) {
|
||||
// 过滤掉未知感知数据
|
||||
if (TrackerSourceHelper.filterData(data)) {
|
||||
if (TrackerSourceColorHelper.filterData(data)) {
|
||||
continue
|
||||
}
|
||||
var temp: TrackedObject = data
|
||||
@@ -113,7 +113,7 @@ class IdentifyOriginDataDrawer : Identify {
|
||||
//首次过来的数据不添加,首次未添加的感知物在调用完绘制方法后再塞入cache map
|
||||
val cacheData = mMarkersCaches[uuid]
|
||||
if (cacheData != null) {
|
||||
val color = TrackerSourceHelper.getDefaultColor(data)
|
||||
val color = TrackerSourceColorHelper.getDefaultColor(data)
|
||||
temp = data.toBuilder().setColor(color).build()
|
||||
mFilterTrafficData[uuid] = temp
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.map.identify;
|
||||
package com.mogo.eagle.core.function.business.identify;
|
||||
|
||||
public class KalmanFilter {
|
||||
private final double q = 1.0E-6D;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user