wait to finish

This commit is contained in:
zhongchao
2022-11-10 10:54:57 +08:00
parent 7868bf626f
commit a836c31728
189 changed files with 780 additions and 4887 deletions

View File

@@ -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();
}
}
}

View File

@@ -17,6 +17,9 @@ 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;
@@ -44,8 +47,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.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.StatusDescriptor;
import org.jetbrains.annotations.NotNull;
@@ -247,10 +248,7 @@ public class BusPassengerModel {
// 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
IntentManager.getInstance().registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
MogoApisHandler.getInstance()
.getApis()
.getStatusManagerApi()
.registerStatusChangedListener( TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener );
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener );
// 达到起始站围栏监听
MogoApisHandler.getInstance()
.getApis()
@@ -262,10 +260,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()
@@ -293,15 +288,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);
}
}
}

View File

@@ -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();
}

View File

@@ -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;
@@ -61,8 +64,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;
@@ -76,7 +77,7 @@ import mogo.telematics.pad.MessagePad;
/**
* @author congtaowang
* @since 2021/3/23
*
* <p>
* 小巴订单管理
*/
public class BusOrderModel {
@@ -119,7 +120,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;
}
@@ -128,9 +129,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();
}
}
@@ -152,10 +153,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);
@@ -170,44 +168,44 @@ 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");
}
});
}
public void setRefreshBusStationsCallback(IRefreshBusStationsCallback callback){
public void setRefreshBusStationsCallback(IRefreshBusStationsCallback callback) {
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;
}
@@ -224,9 +222,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();
}
}
@@ -249,12 +247,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>() {
@@ -265,27 +263,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()
@@ -303,7 +298,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) {
@@ -319,7 +314,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();
@@ -328,7 +323,7 @@ public class BusOrderModel {
}
//是否到站的围栏判断 离站状态并且自动驾驶还未触发到站
if (isGoingToNextStation && !isArrivedStation){
if (isGoingToNextStation && !isArrivedStation) {
judgeArrivedStation(location);
}
}
@@ -337,21 +332,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;
}
@@ -365,13 +360,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();
@@ -379,9 +374,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) {
// 重复请求小巴路线,直至成功
@@ -394,26 +390,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;
@@ -429,16 +426,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();
}
@@ -448,25 +445,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);
}
});
}
@@ -478,12 +475,12 @@ public class BusOrderModel {
isGoingToNextStation = false;
backgroundCurrentStationIndex = 0;
if (busRoutesResult != null){
if (busRoutesResult != null) {
BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.END_TRIP
, busRoutesResult.getName()
,""
,""
,false);
, ""
, ""
, false);
}
}
@@ -492,23 +489,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);
}
}
@@ -516,27 +513,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);
@@ -548,9 +546,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();
@@ -560,21 +558,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);
@@ -588,21 +586,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();
@@ -613,26 +611,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);
@@ -642,10 +640,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);
}
}
@@ -653,18 +651,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
@@ -675,10 +673,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();
@@ -691,18 +689,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);
}
}
});
@@ -712,7 +711,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);
}
/**
@@ -731,7 +730,7 @@ public class BusOrderModel {
* 开启自动驾驶到下一站
*/
public void autoDriveToNextStation() {
if ( backgroundCurrentStationIndex >= stationList.size() - 1 ) {
if (backgroundCurrentStationIndex >= stationList.size() - 1) {
// 当前站是最后一站,结束当前行程
travelOver();
return;
@@ -743,6 +742,7 @@ public class BusOrderModel {
* 渲染站点信息
* 服务端返回的OchBusRoutesResult逻辑 离开站为当前站, 到达下一站后才会将下一站置为当前站,
* 车机端展示 三站: 中间为即将到到达或者刚到达的站
*
* @param result
*/
private void updateBusStatus(BusRoutesResult result) {
@@ -752,20 +752,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;
}
@@ -773,40 +773,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, "美化模式-ignorefalse到达中间站");
clearStartAutopilotTag();
}else{
} else {
closeBeautificationMode();
clearStartAutopilotTag();
}
}
if ( currentStation.isLeaving() && slidePanelHideCallback != null) {
if (currentStation.isLeaving() && slidePanelHideCallback != null) {
slidePanelHideCallback.hideSlidePanel();
}
@@ -827,8 +827,8 @@ public class BusOrderModel {
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(true);
}
public void clearBusStationDatas(){
if (refreshBusStationsCallback != null){
public void clearBusStationDatas() {
if (refreshBusStationsCallback != null) {
refreshBusStationsCallback.clearBusStationsMarkers();
}
}
@@ -837,19 +837,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;
}
@@ -858,11 +858,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();
@@ -872,13 +872,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();// 重新获取任务
@@ -896,28 +896,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;
}
}
@@ -925,7 +926,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;
@@ -964,25 +965,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());
@@ -1002,7 +1003,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;
}
@@ -1010,7 +1011,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);
}
@@ -1019,20 +1020,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();
@@ -1041,9 +1042,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(

View File

@@ -3,13 +3,13 @@ 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
/**
* 带有title, tip,confirm,cancel的dialog
*/
class OCHCommitDialog: BaseFloatDialog, LifecycleObserver {
class OCHCommitDialog: com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog, LifecycleObserver {
private var commonConfirm : TextView? = null
private var commonCancel : TextView? = null

View File

@@ -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;

View File

@@ -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();
}

View File

@@ -17,6 +17,9 @@ 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;
@@ -59,8 +62,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.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.StatusDescriptor;
import org.jetbrains.annotations.NotNull;
@@ -230,10 +231,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
// 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
IntentManager.getInstance().registerIntentListener( ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
MogoApisHandler.getInstance()
.getApis()
.getStatusManagerApi()
.registerStatusChangedListener( TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener );
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
// 达到起始站围栏监听
MogoApisHandler.getInstance()
.getApis()
@@ -248,10 +246,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()

View File

@@ -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());
}

View File

@@ -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();
}

View File

@@ -20,6 +20,9 @@ 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,8 +74,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.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.StatusDescriptor;
import com.zhjt.service.chain.ChainLog;
import com.zhjt.service.chain.TracingConstants;
@@ -217,10 +218,7 @@ public class TaxiModel {
// 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
IntentManager.getInstance().registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener);
MogoApisHandler.getInstance()
.getApis()
.getStatusManagerApi()
.registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
// 达到起始站围栏监听
MogoApisHandler.getInstance()
.getApis()
@@ -232,10 +230,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()

View File

@@ -16,9 +16,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;
@@ -111,14 +111,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();

View File

@@ -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

View File

@@ -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;

View File

@@ -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;

View File

@@ -21,7 +21,5 @@ internal object BridgeApi {
internal fun context(): Context = contextHolder?.get() ?: Utils.getApp()
internal fun statusManager() = apis?.statusManagerApi
internal fun floatViewManager() = apis?.windowManagerApi
}

View File

@@ -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()
}

View File

@@ -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

View File

@@ -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 {

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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 预警广播接收。用于跨应用,跨进程,内部也可以通过这种方式弹出预警提示框

View File

@@ -23,7 +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.module.common.enums.EventTypeEnum
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.*

View File

@@ -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() {

View File

@@ -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() {

View File

@@ -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
}

View File

@@ -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

View File

@@ -7,6 +7,9 @@ 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
@@ -15,11 +18,8 @@ import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
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()
}

View File

@@ -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.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.eagle.core.utilcode.mogo.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();
}

View File

@@ -74,7 +74,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.*

View File

@@ -16,8 +16,7 @@ import com.mogo.eagle.core.function.call.obu.CallerOBUManager
import com.mogo.eagle.core.function.hmi.R
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

View File

@@ -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

View File

@@ -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

View File

@@ -31,6 +31,7 @@ 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;
@@ -61,7 +62,6 @@ 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.statusmanager.IMogoStatusManager;
import com.rousetime.android_startup.StartupManager;
import com.rousetime.android_startup.model.LoggerLevel;
import com.rousetime.android_startup.model.StartupConfig;
@@ -91,7 +91,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
private static final int REQUEST_CODE_DIALOG = 100;
protected IMogoServiceApis mServiceApis;
protected IMogoStatusManager mMogoStatusManager;
protected FrameLayout mFloatingLayout;
protected View mCoverUpLayout;
@@ -102,7 +101,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;
@@ -225,8 +224,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
if (mServiceApis == null) {
mServiceApis = MogoApisHandler.getInstance().getApis();
}
mMogoStatusManager = mServiceApis.getStatusManagerApi();
mMogoStatusManager.setMainPageLaunchedStatus(TAG, true);
MogoStatusManager.getInstance().setMainPageLaunchedStatus(TAG, true);
}
private void initConnectInfoRV() {
@@ -274,7 +272,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);
});
@@ -394,23 +392,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
@@ -481,13 +476,13 @@ 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();

View File

@@ -26,7 +26,6 @@ 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;

View File

@@ -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

View File

@@ -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

View File

@@ -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;

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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;

View File

@@ -1,10 +1,9 @@
package com.mogo.eagle.core.function.map
package com.mogo.eagle.core.function.business.identify
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.api.base.IMoGoSubscriber
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.eagle.core.function.map.identify.IdentifyFactory
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import mogo.telematics.pad.MessagePad
import mogo.telematics.pad.MessagePad.TrackedObject

View File

@@ -1,4 +1,4 @@
package com.mogo.eagle.core.function.map.identify;
package com.mogo.eagle.core.function.business.identify;
public class ObjQueue {

View File

@@ -1,4 +1,4 @@
package com.mogo.eagle.core.function.map.identify
package com.mogo.eagle.core.function.business.identify
data class PlanningTrack(var color: String, var time: Double) {
}

View File

@@ -1,4 +1,4 @@
package com.mogo.eagle.core.function.map.identify;
package com.mogo.eagle.core.function.business.identify;
import android.annotation.SuppressLint;
import android.os.Build;

View File

@@ -1,9 +1,8 @@
package com.mogo.eagle.core.function.map.identify;
package com.mogo.eagle.core.function.business.identify;
import static com.mogo.eagle.core.function.map.identify.TrackManager.LIMIT_SPEED;
import static com.mogo.eagle.core.function.business.identify.TrackManager.LIMIT_SPEED;
import android.annotation.SuppressLint;
import android.util.Log;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.eagle.core.data.enums.TrafficTypeEnum;

View File

@@ -1,4 +1,4 @@
package com.mogo.eagle.core.function.map.identify
package com.mogo.eagle.core.function.business.identify
import android.annotation.SuppressLint
import com.mogo.eagle.core.data.config.FunctionBuildConfig

View File

@@ -1,13 +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.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.FOUNDATION
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.eagle.core.data.traffic.threatLevelColor
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84SatelliteTime
import com.zhjt.service_biz.BizConfig
import mogo.telematics.pad.MessagePad
import mogo.telematics.pad.MessagePad.PlanningObject
import java.util.concurrent.ConcurrentHashMap

View File

@@ -1,4 +1,4 @@
package com.mogo.module.service.routeoverlay;
package com.mogo.eagle.core.function.business.routeoverlay;
import androidx.annotation.NonNull;

View File

@@ -1,17 +1,13 @@
package com.mogo.module.service.routeoverlay;
package com.mogo.eagle.core.function.business.routeoverlay;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_OLD_ROUTE;
import android.annotation.SuppressLint;
import android.graphics.Color;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.SystemClock;
import android.util.Log;
import androidx.core.util.Pools;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
import com.mogo.map.MogoOverlayManager;
import com.mogo.map.overlay.IMogoOverlayManager;
import com.mogo.map.overlay.IMogoPolyline;

View File

@@ -1,14 +1,14 @@
package com.mogo.module.service.routeoverlay
package com.mogo.eagle.core.function.business.routeoverlay
import android.animation.*
import android.graphics.*
import android.view.animation.*
import com.mogo.eagle.core.data.config.*
import com.mogo.eagle.core.utilcode.mogo.*
import com.mogo.module.service.routeoverlay.Colors.Companion.COLOR_BLUE
import com.mogo.module.service.routeoverlay.Colors.Companion.COLOR_BLUE_DARK
import com.mogo.module.service.routeoverlay.Colors.Companion.COLOR_RED_DARK
import com.mogo.module.service.routeoverlay.Colors.Companion.COLOR_TRANSPARENT
import com.mogo.eagle.core.function.business.routeoverlay.Colors.Companion.COLOR_BLUE
import com.mogo.eagle.core.function.business.routeoverlay.Colors.Companion.COLOR_BLUE_DARK
import com.mogo.eagle.core.function.business.routeoverlay.Colors.Companion.COLOR_RED_DARK
import com.mogo.eagle.core.function.business.routeoverlay.Colors.Companion.COLOR_TRANSPARENT
import java.util.*
import kotlin.collections.ArrayList

View File

@@ -6,7 +6,6 @@ import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.mogo.eagle.core.function.api.map.IMogoMapService;
import com.mogo.eagle.core.function.api.map.marker.IMogoMarkerService;
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager;
import com.mogo.eagle.core.function.marker.MogoMarkerServiceImpl;
import com.mogo.map.MogoGeoSearch;
import com.mogo.map.MogoLocationClient;
import com.mogo.map.MogoMap;

View File

@@ -0,0 +1,79 @@
package com.mogo.eagle.core.function.impl;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity;
import com.mogo.eagle.core.data.traffic.TrafficData;
import com.mogo.eagle.core.function.api.map.marker.IMogoMarkerService;
import com.mogo.eagle.core.function.impl.marker.MarkerDrawer;
import com.mogo.eagle.core.function.impl.marker.TrafficMarkerDrawer;
import com.mogo.eagle.core.function.impl.marker.V2XWarnDataDrawer;
import com.mogo.map.marker.IMogoMarker;
public class MogoMarkerServiceImpl implements IMogoMarkerService {
private static volatile MogoMarkerServiceImpl sInstance;
private static final byte[] obj = new byte[0];
private MogoMarkerServiceImpl() {
}
public static MogoMarkerServiceImpl getInstance() {
if (sInstance == null) {
synchronized (obj) {
if (sInstance == null) {
sInstance = new MogoMarkerServiceImpl();
}
}
}
return sInstance;
}
@Nullable
@Override
public IMogoMarker drawMarker(Object object) {
if (object instanceof MarkerShowEntity) {
return MarkerDrawer.getInstance().drawMapMarkerImpl(((MarkerShowEntity) object), MarkerDrawer.MARKER_Z_INDEX_HIGH, null);
}
return null;
}
@Override
public void renderWarningMoveMarker(double lon, double lat, int type, double collisionlat, double collisionLon, double angle, long showTime) {
V2XWarnDataDrawer.getInstance().renderWarnData(lon, lat, type, collisionlat, collisionLon, angle, showTime);
}
@Override
public void renderStopLineMarker(double lon, double lat) {
V2XWarnDataDrawer.getInstance().renderStopLineData(lon, lat);
}
@Override
public void drawerArrowsMarkerWithLocation(MogoLatLng location, String markerType, int type, int rotate) {
V2XWarnDataDrawer.getInstance().drawerArrowsMarkerWithLocation(location, markerType, type, rotate);
}
@Override
public void updateITrafficInfo(TrafficData trafficData) {
TrafficMarkerDrawer.INSTANCE.updateITrafficInfo(trafficData);
}
@Override
public void updateITrafficLocationInfo(TrafficData trafficData) {
TrafficMarkerDrawer.INSTANCE.updateITrafficLocationInfo(trafficData);
}
@Override
public void updateITrafficThreatLevelInfo(TrafficData trafficData) {
TrafficMarkerDrawer.INSTANCE.updateITrafficThreatLevelInfo(trafficData);
}
@Override
public void removeCvxRvInfoIndInfo(String uuid) {
TrafficMarkerDrawer.INSTANCE.removeCvxRvInfoIndInfo(uuid);
}
}

View File

@@ -1,4 +1,4 @@
package com.mogo.module.common.constants;
package com.mogo.eagle.core.function.impl.marker;
public enum AdasRecognizedType {
//背景

View File

@@ -1,11 +1,10 @@
package com.mogo.module.common.drawer;
package com.mogo.eagle.core.function.impl.marker;
import android.content.Context;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.module.common.R;
import com.mogo.module.common.constants.AdasRecognizedType;
/**
* @author congtaowang

View File

@@ -1,4 +1,4 @@
package com.mogo.module.common.drawer.marker;
package com.mogo.eagle.core.function.impl.marker;
import android.content.Context;
import android.util.AttributeSet;

View File

@@ -1,4 +1,4 @@
package com.mogo.module.common.drawer.marker;
package com.mogo.eagle.core.function.impl.marker;
import android.graphics.Bitmap;
import android.view.View;

View File

@@ -1,4 +1,4 @@
package com.mogo.module.common.drawer.marker;
package com.mogo.eagle.core.function.impl.marker;
import android.content.Context;
import android.util.AttributeSet;
@@ -8,9 +8,9 @@ import android.widget.ImageView;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.R;
import com.mogo.module.common.entity.MarkerShowEntity;
/**
* author : 李小鹏

View File

@@ -1,12 +1,12 @@
package com.mogo.module.common.drawer.marker;
package com.mogo.eagle.core.function.impl.marker;
import android.content.Context;
import android.text.TextUtils;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.ModuleNames;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.entity.MarkerShowEntity;
/**
* author : donghongyu
@@ -24,12 +24,12 @@ public class MapMarkerAdapter {
* @param markerShowEntity 要填充的数据
* @return MarkerView
*/
public static IMarkerView getMarkerView( Context context, MarkerShowEntity markerShowEntity, MogoMarkerOptions options ) {
public static IMarkerView getMarkerView(Context context, MarkerShowEntity markerShowEntity, MogoMarkerOptions options ) {
if ( TextUtils.equals( markerShowEntity.getMarkerType(), ModuleNames.CARD_TYPE_USER_DATA ) ) {
return OnlineCarMarkerView.getInstance();
} else {
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
if ( MogoStatusManager.getInstance().isVrMode() ) {
return new EmptyMarkerView( context );
} else {
if ( markerShowEntity.isChecked() ) {

View File

@@ -1,4 +1,4 @@
package com.mogo.module.common.drawer.marker;
package com.mogo.eagle.core.function.impl.marker;
import android.content.Context;
import android.graphics.Bitmap;
@@ -11,6 +11,7 @@ import android.widget.LinearLayout;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity;
import com.mogo.eagle.core.utilcode.mogo.glide.GlideImageLoader;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.eagle.core.utilcode.util.ViewUtils;
@@ -18,7 +19,6 @@ import com.mogo.eagle.core.utilcode.util.WindowUtils;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.R;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.eagle.core.utilcode.mogo.imageloader.IMogoImageLoaderListener;
import com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView;

View File

@@ -1,4 +1,4 @@
package com.mogo.module.common.drawer.marker;
package com.mogo.eagle.core.function.impl.marker;
import android.content.Context;
import android.text.TextUtils;
@@ -11,13 +11,13 @@ import android.widget.TextView;
import androidx.annotation.Nullable;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay;
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.ModuleNames;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.R;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.common.marker.PoiWrapper;
import com.mogo.module.common.utils.CloudPoiManager;
@@ -74,7 +74,7 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
Object bindObj = markerShowEntity.getBindObj();
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
if (MogoStatusManager.getInstance().isVrMode()) {
ivCar.setImageResource(R.drawable.icon_map_marker_location_yellow_vr);
} else {
ivCar.setImageResource(R.drawable.icon_map_marker_location_yellow);

View File

@@ -1,4 +1,4 @@
package com.mogo.module.common.drawer.marker;
package com.mogo.eagle.core.function.impl.marker;
import android.content.Context;
import android.util.AttributeSet;
@@ -7,13 +7,13 @@ import android.widget.FrameLayout;
import androidx.annotation.Nullable;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay;
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity;
import com.mogo.eagle.core.function.map.R;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.ModuleNames;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.R;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.common.marker.PoiWrapper;
import com.mogo.module.common.utils.CloudPoiManager;
@@ -55,7 +55,7 @@ public class MapMarkerView extends MapMarkerBaseView {
@Override
protected void initView( Context context ) {
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
if ( MogoStatusManager.getInstance().isVrMode() ) {
LayoutInflater.from( context ).inflate( R.layout.modudle_services_marker_vr_layout, this );
} else {
LayoutInflater.from( context ).inflate( R.layout.modudle_services_marker_layout, this );

View File

@@ -1,25 +1,21 @@
package com.mogo.module.common.drawer;
package com.mogo.eagle.core.function.impl.marker;
import android.text.TextUtils;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay;
import com.mogo.eagle.core.data.map.entity.MarkerNoveltyInfo;
import com.mogo.eagle.core.data.map.entity.MarkerOnlineCar;
import com.mogo.eagle.core.data.map.entity.MarkerShareMusic;
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity;
import com.mogo.map.MogoMarkerManager;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.drawer.marker.EmptyMarkerView;
import com.mogo.module.common.drawer.marker.IMarkerView;
import com.mogo.module.common.drawer.marker.MapMarkerAdapter;
import com.mogo.module.common.drawer.marker.OnlineCarMarkerView;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerNoveltyInfo;
import com.mogo.module.common.entity.MarkerOnlineCar;
import com.mogo.module.common.entity.MarkerShareMusic;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.eagle.core.data.enums.EventTypeEnum;
/**
* @author congtaowang
@@ -75,9 +71,9 @@ public class MarkerDrawer {
if (markerShowEntity == null || markerShowEntity.getMarkerLocation() == null) {
return null;
}
MogoMarkerOptions options = new MogoMarkerOptions().icon3DRes(icon3DRes).set3DMode(MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()).matchOnRoadSide(matchRoadSide).owner(markerShowEntity.getMarkerType()).zIndex(zIndex).data(markerShowEntity).latitude(markerShowEntity.getMarkerLocation().getLat()).longitude(markerShowEntity.getMarkerLocation().getLon());
MogoMarkerOptions options = new MogoMarkerOptions().icon3DRes(icon3DRes).set3DMode(MogoStatusManager.getInstance().isVrMode()).matchOnRoadSide(matchRoadSide).owner(markerShowEntity.getMarkerType()).zIndex(zIndex).data(markerShowEntity).latitude(markerShowEntity.getMarkerLocation().getLat()).longitude(markerShowEntity.getMarkerLocation().getLon());
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
if (MogoStatusManager.getInstance().isVrMode()) {
Object bindObj = markerShowEntity.getBindObj();
if (bindObj instanceof MarkerExploreWay && ((MarkerExploreWay) bindObj).getPoiType() != null) {
String poiType = ((MarkerExploreWay) bindObj).getPoiType();
@@ -107,7 +103,6 @@ public class MarkerDrawer {
marker.setOwner(markerShowEntity.getMarkerType());
markerView.setMarker(marker);
marker.setOnMarkerClickListener(listener);
markerShowEntity.setMarker(marker);
}
return marker;
}

View File

@@ -1,4 +1,4 @@
package com.mogo.module.common.drawer.marker;
package com.mogo.eagle.core.function.impl.marker;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
@@ -21,7 +21,6 @@ import java.util.Map;
public class OnlineCarMarkerView implements IMarkerView {
private static Map< Integer, SoftReference< Bitmap > > sRef = new HashMap<>();
private static Map< Integer, SoftReference< Bitmap > > sTypedRef = new HashMap<>();
private OnlineCarMarkerView() {
// private constructor

View File

@@ -1,4 +1,4 @@
package com.mogo.module.common.drawer
package com.mogo.eagle.core.function.impl.marker
import android.annotation.SuppressLint
import android.content.Context
@@ -7,6 +7,7 @@ import android.os.Message
import android.text.TextUtils
import com.mogo.commons.AbsMogoApplication
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.constants.DataTypes
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.eagle.core.data.traffic.threatLevelColor
@@ -15,7 +16,6 @@ import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler
import com.mogo.map.MogoMarkerManager
import com.mogo.map.marker.IMogoMarker
import com.mogo.map.marker.MogoMarkerOptions
import com.mogo.module.common.constants.DataTypes
import java.util.concurrent.ConcurrentHashMap
/**

View File

@@ -1,17 +1,15 @@
package com.mogo.module.common.drawer;
package com.mogo.eagle.core.function.impl.marker;
import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_STOP_LINE_DATA;
import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_DATA;
import static com.mogo.eagle.core.data.constants.DataTypes.TYPE_MARKER_CLOUD_STOP_LINE_DATA;
import static com.mogo.eagle.core.data.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_DATA;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.entity.MarkerLocation;
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.MogoMarkerManager;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.drawer.marker.IMarkerView;
import com.mogo.module.common.drawer.marker.MapMarkerAdapter;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerShowEntity;
/**
@@ -19,8 +17,8 @@ import com.mogo.module.common.entity.MarkerShowEntity;
*/
public class V2XWarnDataDrawer extends BaseDrawer {
private static final String TAG = "V2XWarnDataDrawer";
private static volatile V2XWarnDataDrawer sInstance;
private static final byte[] obj = new byte[0];
private V2XWarnDataDrawer() {
super();
@@ -28,7 +26,7 @@ public class V2XWarnDataDrawer extends BaseDrawer {
public static V2XWarnDataDrawer getInstance() {
if (sInstance == null) {
synchronized (V2XWarnDataDrawer.class) {
synchronized (obj) {
if (sInstance == null) {
sInstance = new V2XWarnDataDrawer();
}
@@ -54,9 +52,7 @@ public class V2XWarnDataDrawer extends BaseDrawer {
markerShowEntity.setMarkerType(TYPE_MARKER_CLOUD_WARN_DATA);
IMogoMarker marker = drawMarker(markerShowEntity, modeResType(type));
// marker.addDynamicAnchorPosition(new MogoLatLng(collisionlat, collisionLon), (float) heading, showTime * 1000);
UiThreadHandler.postDelayed(() -> {
marker.remove();
}, showTime * 1000);
UiThreadHandler.postDelayed(marker::remove, showTime * 1000);
}
@@ -83,7 +79,7 @@ public class V2XWarnDataDrawer extends BaseDrawer {
.rotate((float) markerShowEntity.getMarkerLocation().getAngle())
.setGps(true);
IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
options.icon3DRes(getModelRes(modeResType)); //TODO
options.icon3DRes(getModelRes(modeResType));
options.anchorColor("#FB3C3CFF");
IMogoMarker marker = MogoMarkerManager.getInstance(mContext).addMarker(markerShowEntity.getMarkerType(), options);
iMarkerView.setMarker(marker);

View File

@@ -15,6 +15,9 @@ import com.mogo.eagle.core.data.map.CenterLine;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener;
import com.mogo.eagle.core.function.api.map.hd.IMoGoMapFragmentProvider;
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener;
import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber;
import com.mogo.eagle.core.function.business.MapPointCloudSubscriber;
import com.mogo.eagle.core.function.business.routeoverlay.MogoRouteOverlayManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
import com.mogo.eagle.core.function.call.map.CallerHDMapManager;
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager;
@@ -186,6 +189,7 @@ public class MapFragment extends MvpFragment<MapView, MapPresenter>
// TODO 临时初始化地图监听工控机、OBU等数据监听器用于感知元素绘制
MapIdentifySubscriber.Companion.getInstance();
MogoRouteOverlayManager.getInstance().init();
MapPointCloudSubscriber.Companion.getInstance();
}

View File

@@ -1,41 +0,0 @@
package com.mogo.eagle.core.function.marker;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.function.api.map.marker.IMogoMarkerService;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.module.common.drawer.MarkerDrawer;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.service.marker.MapMarkerManager;
public class MogoMarkerServiceImpl implements IMogoMarkerService {
private static volatile MogoMarkerServiceImpl sInstance;
private static final byte[] obj = new byte[0];
private MogoMarkerServiceImpl() {
}
public static MogoMarkerServiceImpl getInstance() {
if (sInstance == null) {
synchronized (obj) {
if (sInstance == null) {
sInstance = new MogoMarkerServiceImpl();
}
}
}
return sInstance;
}
@Nullable
@Override
public IMogoMarker drawMarker(Object object) {
if (object instanceof MarkerShowEntity) {
return MapMarkerManager.getInstance().drawMapMarker(((MarkerShowEntity) object), MarkerDrawer.MARKER_Z_INDEX_HIGH);
}
return null;
}
}

View File

@@ -56,7 +56,6 @@ public class SmallMapFragment extends BaseFragment
@Override
protected void initViews() {
SmpServiceManager.init(getContext());
}
@Override
@@ -85,24 +84,14 @@ public class SmallMapFragment extends BaseFragment
public void drawablePolyline(List<MogoLatLng> coordinates) {
if (mSmallMapDirectionView != null) {
mSmallMapDirectionView.convert(coordinates);
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
mSmallMapDirectionView.drawablePolyline();
}
});
UiThreadHandler.post(() -> mSmallMapDirectionView.drawablePolyline());
}
}
@Override
public void clearPolyline() {
if (mSmallMapDirectionView != null) {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
mSmallMapDirectionView.clearPolyline();
}
});
UiThreadHandler.post(() -> mSmallMapDirectionView.clearPolyline());
}
}

View File

@@ -1,45 +0,0 @@
package com.mogo.eagle.core.function.smp;
import android.content.Context;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.service.IMogoServiceApis;
import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.mogo.service.module.IMogoRegisterCenter;
/**
* author : donghongyu
* e-mail : 1358506549@qq.com
* date : 2020-01-2114:01
* desc : V2X 服务
* version: 1.0
*/
public class SmpServiceManager {
private static final String TAG = "V2XServiceManager";
private static boolean isInit;
private static Context mContext;
private static IMogoServiceApis mMogoServiceApis;
private static IMogoRegisterCenter mMogoRegisterCenter;
private SmpServiceManager() {
}
public static void init(final Context context) {
if (!isInit) {
isInit = true;
mContext = context;
mMogoServiceApis = (IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(context);
mMogoRegisterCenter = mMogoServiceApis.getRegisterCenterApi();
}
}
public static Context getContext() {
return mContext;
}
public static IMogoRegisterCenter getMogoRegisterCenter() {
return mMogoRegisterCenter;
}
}

View File

@@ -12,7 +12,7 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MONITOR
import com.mogo.map.MogoLocationClient
import com.mogo.module.common.constants.HostConst
import com.mogo.eagle.core.data.constants.HostConst
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable

View File

@@ -19,9 +19,8 @@ import com.mogo.eagle.core.function.obu.mogo.utils.TrafficDataConvertUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.module.common.drawer.TrafficMarkerDrawer
import com.mogo.module.common.enums.EventTypeEnum
import com.mogo.module.common.enums.EventTypeHelper
import com.mogo.eagle.core.data.enums.EventTypeEnum
import com.mogo.eagle.core.data.enums.EventTypeHelper
import com.mogo.service.IMogoServiceApis
import com.zhidao.support.obu.MogoObuManager
import com.zhidao.support.obu.OnMogoObuListener
@@ -77,16 +76,16 @@ class MogoPrivateObuManager private constructor() {
}
}
fun disConnectObu(){
fun disConnectObu() {
try {
MogoObuManager.getInstance().disConnect()
} catch (e: Exception) {
e.printStackTrace()
}
}
fun isConnected(): Boolean{
fun isConnected(): Boolean {
return MogoObuManager.getInstance().isConnected
}
@@ -219,7 +218,7 @@ class MogoPrivateObuManager private constructor() {
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_RV", true) }
// 更新数据
TrafficDataConvertUtils.cvxRvInfoIndInfo2TrafficData(info)?.let {
TrafficMarkerDrawer.updateITrafficLocationInfo(it)
CallerMapUIServiceManager.getMarkerService()?.updateITrafficLocationInfo(it)
}
}
@@ -389,7 +388,8 @@ class MogoPrivateObuManager private constructor() {
// 更新数据
TrafficDataConvertUtils.cvxRtiThreatIndInfo2TrafficData(info)?.let {
CallerObuListenerManager.invokeTrackerWarningInfo(it)
TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it)
CallerMapUIServiceManager.getMarkerService()
?.updateITrafficThreatLevelInfo(it)
}
}
// 删除
@@ -403,7 +403,8 @@ class MogoPrivateObuManager private constructor() {
CallerObuListenerManager.removeTrackerWarningInfo(it)
// 事件结束,还原车辆颜色
it.threatLevel = 0x01
TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it)
CallerMapUIServiceManager.getMarkerService()
?.updateITrafficThreatLevelInfo(it)
}
}
}
@@ -507,7 +508,8 @@ class MogoPrivateObuManager private constructor() {
// 更新数据
TrafficDataConvertUtils.cvxPtcThreatIndInfo2TrafficData(info)?.let {
CallerObuListenerManager.invokeTrackerWarningInfo(it)
TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it)
CallerMapUIServiceManager.getMarkerService()
?.updateITrafficThreatLevelInfo(it)
}
}
// 删除
@@ -519,7 +521,8 @@ class MogoPrivateObuManager private constructor() {
CallerObuListenerManager.removeTrackerWarningInfo(it)
// 事件结束,还原交通参与者颜色
it.threatLevel = 0x01
TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it)
CallerMapUIServiceManager.getMarkerService()
?.updateITrafficThreatLevelInfo(it)
}
CallerHmiManager.disableWarningV2X(ObuConstants.USE_CASE_ID.VRUCW.toString())
}
@@ -849,21 +852,21 @@ class MogoPrivateObuManager private constructor() {
}
//前车急刹预警
EventTypeEnum.TYPE_USECASE_ID_EBW.poiType -> {
EventTypeHelper.getEBW(appId){ alert, tts ->
EventTypeHelper.getEBW(appId) { alert, tts ->
alertContent = alert
ttsContent = tts
}
}
//前向碰撞预警
EventTypeEnum.TYPE_USECASE_ID_FCW.poiType -> {
EventTypeHelper.getFCW(appId){ alert, tts ->
EventTypeHelper.getFCW(appId) { alert, tts ->
alertContent = alert
ttsContent = tts
}
}
//逆向超车预警
EventTypeEnum.TYPE_USECASE_ID_DNPW.poiType -> {
EventTypeHelper.getDNPW(appId){ alert, tts ->
EventTypeHelper.getDNPW(appId) { alert, tts ->
alertContent = alert
ttsContent = tts
}
@@ -917,7 +920,7 @@ class MogoPrivateObuManager private constructor() {
//更新周边车辆进行预警颜色变换,车辆实时移动和变色
TrafficDataConvertUtils.cvxV2vThreatIndInfo2TrafficData(info)?.let {
CallerObuListenerManager.invokeTrackerWarningInfo(it)
TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it)
CallerMapUIServiceManager.getMarkerService()?.updateITrafficThreatLevelInfo(it)
}
}
// 删除
@@ -930,7 +933,7 @@ class MogoPrivateObuManager private constructor() {
TrafficDataConvertUtils.cvxV2vThreatIndInfo2TrafficData(info)?.let {
CallerObuListenerManager.removeTrackerWarningInfo(it)
it.threatLevel = 0x01
TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it)
CallerMapUIServiceManager.getMarkerService()?.updateITrafficThreatLevelInfo(it)
}
}
}

View File

@@ -53,6 +53,7 @@ dependencies {
implementation rootProject.ext.dependencies.mogo_v2x
implementation rootProject.ext.dependencies.mogoaicloudtrafficlive
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
implementation rootProject.ext.dependencies.mogocommons
implementation rootProject.ext.dependencies.modulecommon
implementation rootProject.ext.dependencies.moduleservice
implementation rootProject.ext.dependencies.mogo_core_data
@@ -62,6 +63,7 @@ dependencies {
//implementation rootProject.ext.dependencies.callchatprovider
implementation rootProject.ext.dependencies.mogo_core_res
} else {
implementation project(":foudations:mogo-commons")
implementation project(':modules:mogo-module-common')
implementation project(':modules:mogo-module-service')
implementation project(':core:mogo-core-data')

View File

@@ -8,14 +8,21 @@ import androidx.core.util.Pair
import androidx.localbroadcastmanager.content.*
import com.mogo.cloud.commons.utils.*
import com.mogo.cloud.passport.*
import com.mogo.module.common.enums.EventTypeEnum
import com.mogo.module.common.enums.EventTypeHelper
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.enums.EventTypeEnum
import com.mogo.eagle.core.data.enums.EventTypeHelper
import com.mogo.commons.network.*
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_V2N
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CLOUD_SHOW
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CLOUD_V2N
import com.mogo.eagle.core.data.enums.*
import com.mogo.eagle.core.data.map.*
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
import com.mogo.eagle.core.data.traffic.*
import com.mogo.eagle.core.function.api.hmi.warning.*
import com.mogo.eagle.core.function.api.map.listener.*
@@ -49,12 +56,6 @@ import com.mogo.eagle.core.utilcode.util.Utils
import com.mogo.map.listener.*
import com.mogo.map.marker.*
import com.mogo.module.common.*
import com.mogo.module.common.drawer.*
import com.mogo.module.common.entity.*
import com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum
import com.mogo.service.statusmanager.*
import com.mogo.service.statusmanager.StatusDescriptor.ACC_STATUS
import com.mogo.service.statusmanager.StatusDescriptor.SEEK_HELPING
import com.mogo.v2x.*
import com.mogo.v2x.callback.*
import com.mogo.v2x.config.*
@@ -135,10 +136,9 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
}
})
}
BridgeApi.statusManager()?.let {
it.registerStatusChangedListener(MODULE_NAME, ACC_STATUS, this)
it.registerStatusChangedListener(MODULE_NAME, SEEK_HELPING, this)
}
MogoStatusManager.getInstance().registerStatusChangedListener(MODULE_NAME, StatusDescriptor.ACC_STATUS, this)
MogoStatusManager.getInstance().registerStatusChangedListener(MODULE_NAME, StatusDescriptor.SEEK_HELPING, this)
}
private fun unRegisterListener() {
@@ -148,10 +148,9 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
it.unregisterMogoMapListener(MODULE_NAME)
it.unregisterMogoMarkerClickListener(ModuleNames.CARD_TYPE_ROAD_CONDITION)
}
BridgeApi.statusManager()?.let {
it.unregisterStatusChangedListener(MODULE_NAME, ACC_STATUS, this)
it.unregisterStatusChangedListener(MODULE_NAME, SEEK_HELPING, this)
}
MogoStatusManager.getInstance().unregisterStatusChangedListener(MODULE_NAME, StatusDescriptor.ACC_STATUS, this)
MogoStatusManager.getInstance().unregisterStatusChangedListener(MODULE_NAME, StatusDescriptor.SEEK_HELPING, this)
}
private fun initData() {
@@ -201,7 +200,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
val v2XMessageEntity: V2XMessageEntity<V2XRoadEventEntity> =
V2XMessageEntity<V2XRoadEventEntity>()
v2XMessageEntity.type = V2XTypeEnum.ALERT_ROAD_WARNING
v2XMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING
v2XMessageEntity.isShowState = true
v2XMessageEntity.isOnlyShow = true
v2XMessageEntity.isNeedAddLine = false
@@ -242,20 +241,18 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
CallerLogger.d("$M_V2X$TAG", "状态发生改变\ndescriptor:$descriptor\nisTrue:$isTrue") // 记录状态更改
// 记录状态更改
SharedPrefsMgr.getInstance(Utils.getApp()).putBoolean("descriptor_$descriptor", isTrue)
if (descriptor == ACC_STATUS) {
if (descriptor == StatusDescriptor.ACC_STATUS) {
if (isTrue) { // 刷新配置文件
refreshStrategyConfig()
// 记录开机时间
FatigueDrivingUtils.refreshAccOnTime()
initCarForHelpStatus()
BridgeApi.statusManager()?.let {
V2XManager.forceRefresh()
}
V2XManager.forceRefresh()
} else { // 记录关机时间
SharedPrefsMgr.getInstance(Utils.getApp())
.putString(V2X_ACC_OFF_TIME_STR, TimeUtils.getNowString())
}
} else if (descriptor == SEEK_HELPING) {
} else if (descriptor == StatusDescriptor.SEEK_HELPING) {
refreshMeSeekHelp(isTrue)
}
}
@@ -267,7 +264,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
*/
private fun refreshMeSeekHelp(isTrue: Boolean) {
val entity = V2XMessageEntity<Boolean>()
entity.type = V2XTypeEnum.ALERT_CAR_FOR_HELP
entity.type = V2XMessageEntity.V2XTypeEnum.ALERT_CAR_FOR_HELP
entity.content = isTrue
V2XScenarioManager.getInstance().handlerMessage(entity)
}
@@ -286,10 +283,10 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
val vehicleType: Int = resultBean.vehicleType //故障车
if (vehicleType == 4) {
refreshMeSeekHelp(true)
BridgeApi.statusManager()?.setSeekHelping(MODULE_NAME, true)
MogoStatusManager.getInstance().setSeekHelping(MODULE_NAME, true)
} else {
refreshMeSeekHelp(false)
BridgeApi.statusManager()?.setSeekHelping(MODULE_NAME, false)
MogoStatusManager.getInstance().setSeekHelping(MODULE_NAME, false)
}
}
}
@@ -360,7 +357,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
Logger.d(TAG, "--- trigger show ---:poiType:" + v2XRoadEventEntity.poiType)
TrackUtils.trackV2xRoadProduceEvent(1)
val v2XMessageEntity = V2XMessageEntity<V2XRoadEventEntity>()
v2XMessageEntity.type = V2XTypeEnum.ALERT_ROAD_WARNING
v2XMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING
v2XMessageEntity.content = v2XRoadEventEntity
v2XMessageEntity.isShowState = true
V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity)
@@ -470,7 +467,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
private fun handleWarningTargetEvent(data: V2XWarningTarget) {
val v2xMessageEntity = V2XMessageEntity<V2XWarningTarget>()
v2xMessageEntity.type = V2XTypeEnum.ALERT_THE_FRONT_WEAKNESS
v2xMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_WEAKNESS
// 设置数据
v2xMessageEntity.content = data
val intent = Intent(BROADCAST_SCENE_HANDLER_ACTION)
@@ -491,7 +488,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
private fun handleOptimalRouteEvent(event: V2XEvent.OptimalRoute) {
val v2xMessageEntity: V2XMessageEntity<V2XOptimalRoute> =
V2XMessageEntity<V2XOptimalRoute>() // 控制类型
v2xMessageEntity.type = V2XTypeEnum.ALERT_PUSH_VR_SHOW // 设置数据
v2xMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_VR_SHOW // 设置数据
v2xMessageEntity.content = event.data // 控制展示状态
v2xMessageEntity.isShowState = true
val intent = Intent(BROADCAST_SCENE_HANDLER_ACTION)
@@ -595,14 +592,14 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
true,
5000L
)
TrafficMarkerDrawer.updateITrafficInfo(trafficData)
CallerMapUIServiceManager.getMarkerService()?.updateITrafficInfo(trafficData)
}
2 -> {
TrafficMarkerDrawer.updateITrafficInfo(trafficData)
CallerMapUIServiceManager.getMarkerService()?.updateITrafficInfo(trafficData)
}
3 -> {
trafficData.uuid?.let {
TrafficMarkerDrawer.removeCvxRvInfoIndInfo(it)
CallerMapUIServiceManager.getMarkerService()?.removeCvxRvInfoIndInfo(it)
}
}
}

View File

@@ -1,10 +1,10 @@
package com.mogo.eagle.core.function.v2x.events.alarm;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.data.map.entity.MarkerLocation;
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity;
import com.mogo.eagle.core.function.v2x.events.utils.DrivingDirectionUtils;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.eagle.core.data.enums.EventTypeEnum;
import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArrayList;
import io.netty.util.internal.ConcurrentSet;

View File

@@ -8,7 +8,6 @@ import com.mogo.eagle.core.function.v2x.events.manager.*
import com.mogo.eagle.core.function.v2x.events.network.V2XRefreshModel
import com.mogo.eagle.core.utilcode.util.Utils
import com.mogo.module.common.MogoApisHandler
import com.mogo.service.statusmanager.IMogoStatusManager
import java.lang.ref.WeakReference
import java.util.concurrent.atomic.AtomicReference
@@ -60,8 +59,6 @@ internal object BridgeApi {
fun context(): Context = this.context.get()?.get() ?: Utils.getApp()
fun statusManager(): IMogoStatusManager? = apis?.statusManagerApi
fun v2xMarker() = v2xMarker
fun v2xPolyline() = v2xPolyline

View File

@@ -6,8 +6,8 @@ import android.text.TextUtils;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.mogo.eagle.core.data.BaseData;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerOnlineCar;
import com.mogo.eagle.core.data.map.entity.MarkerLocation;
import com.mogo.eagle.core.data.map.entity.MarkerOnlineCar;
import java.io.Serializable;
import java.util.ArrayList;

View File

@@ -2,7 +2,7 @@ package com.mogo.eagle.core.function.v2x.events.entity.net;
import com.google.gson.annotations.Expose;
import com.mogo.eagle.core.data.BaseData;
import com.mogo.module.common.entity.V2XLiveCarInfoEntity;
import com.mogo.eagle.core.data.map.entity.V2XLiveCarInfoEntity;
import java.io.Serializable;
import java.util.List;

View File

@@ -1,7 +1,7 @@
package com.mogo.eagle.core.function.v2x.events.entity.panel;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay;
import com.mogo.eagle.core.data.enums.EventTypeEnum;
import java.io.Serializable;
import java.util.ArrayList;

View File

@@ -1,7 +1,7 @@
package com.mogo.eagle.core.function.v2x.events.entity.panel;
import com.mogo.eagle.core.data.BaseData;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay;
import java.util.List;

View File

@@ -3,8 +3,8 @@ package com.mogo.eagle.core.function.v2x.events.manager;
import android.content.Context;
import com.alibaba.android.arouter.facade.template.IProvider;
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.v2x.data.V2XMarkerCardResult;
import java.util.concurrent.CopyOnWriteArrayList;

View File

@@ -3,8 +3,8 @@ package com.mogo.eagle.core.function.v2x.events.manager;
import android.content.Context;
import com.alibaba.android.arouter.facade.template.IProvider;
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity;
import com.mogo.map.overlay.IMogoPolyline;
import com.mogo.module.common.entity.V2XRoadEventEntity;
/**
* author : donghongyu

View File

@@ -2,7 +2,7 @@ package com.mogo.eagle.core.function.v2x.events.manager;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity;
/**
* author : donghongyu

View File

@@ -6,9 +6,15 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X
import android.content.Context;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay;
import com.mogo.eagle.core.data.map.entity.MarkerLocation;
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity;
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
import com.mogo.eagle.core.function.v2x.events.consts.MoGoV2XServicePaths;
@@ -25,14 +31,7 @@ import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.marker.IMogoMarkerManager;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.service.ServiceConst;
import com.mogo.module.service.Utils;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.mogo.eagle.core.data.enums.EventTypeEnum;
import com.mogo.v2x.V2XManager;
import com.mogo.v2x.data.V2XMarkerCardResult;
import com.mogo.v2x.data.V2XMarkerExploreWay;
@@ -58,6 +57,7 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
private static final CopyOnWriteArraySet<V2XRoadEventEntity> mV2XRoadEventEntityArrayList = new CopyOnWriteArraySet<>();
// 上次的道路事件的预警Marker
private static IMogoMarker mAlarmInfoMarker;
public static final String CARD_TYPE_NOVELTY = "CARD_TYPE_NOVELTY";
@Override
public void drawableLastAllPOI() {
@@ -81,10 +81,8 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
// 事件位置
MarkerLocation location = v2XRoadEventEntity.getLocation();
if (location != null) {
float calculateDistance = Utils.calculateLineDistance(
new MogoLatLng(location.getLat(), location.getLon()),
new MogoLatLng(currentLocation.getLatitude(), currentLocation.getLongitude())
);
float calculateDistance = CoordinateUtils.calculateLineDistance(location.getLat(), location.getLon(),
currentLocation.getLatitude(), currentLocation.getLongitude());
v2XRoadEventEntity.setDistance(calculateDistance);
}
roadEventEntities.add(v2XRoadEventEntity);
@@ -157,16 +155,12 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
markerShowEntity.setChecked(false);
markerShowEntity.setTextContent(markerExploreWay.getAddr());
markerShowEntity.setMarkerLocation(markerExploreWay.getLocation());
markerShowEntity.setMarkerType(ServiceConst.CARD_TYPE_NOVELTY);
markerShowEntity.setMarkerType(CARD_TYPE_NOVELTY);
optionsRipple.icons(V2XMarkerAdapter.getV2XRoadEventViewGif(context, roadEventEntity));
optionsRipple.period(1);
boolean isVrMode = false;
IMogoStatusManager statusManager = BridgeApi.INSTANCE.statusManager();
if (statusManager != null) {
isVrMode = statusManager.isVrMode();
}
if (isVrMode) {
if (MogoStatusManager.getInstance().isVrMode()) {
mAlarmInfoMarker = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerService()).drawMarker(markerShowEntity);
} else {
optionsRipple.icon(V2XMarkerAdapter.getV2XRoadEventViewPng(context, roadEventEntity));

View File

@@ -3,11 +3,11 @@ package com.mogo.eagle.core.function.v2x.events.manager.impl;
import android.content.Context;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity;
import com.mogo.eagle.core.function.v2x.events.consts.MoGoV2XServicePaths;
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XPolylineManager;
import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager;
import com.mogo.map.overlay.IMogoPolyline;
import com.mogo.module.common.entity.V2XRoadEventEntity;
/**
* author : donghongyu

View File

@@ -3,13 +3,12 @@ package com.mogo.eagle.core.function.v2x.events.manager.impl;
import android.content.Context;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.eagle.core.function.v2x.events.consts.MoGoV2XServicePaths;
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst;
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XStatusChangedListener;
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XStatusManager;
import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusDescriptor;
import com.mogo.service.statusmanager.IMogoStatusManager;
import java.util.List;
import java.util.Map;
@@ -54,10 +53,7 @@ public class MoGoV2XStatusManager implements IMoGoV2XStatusManager {
@Override
public void setRoadEventPOIShow(String tag, boolean show) {
IMogoStatusManager statusManager = BridgeApi.INSTANCE.statusManager();
if (statusManager != null) {
statusManager.setV2XUIShow(V2XConst.MODULE_NAME, show);
}
MogoStatusManager.getInstance().setV2XUIShow(V2XConst.MODULE_NAME, show);
mStatus.put(V2XStatusDescriptor.RoadEventPOI_UI, show);
invokeStatusChangedListener(V2XStatusDescriptor.RoadEventPOI_UI, show);
recordStatusModifier(tag, V2XStatusDescriptor.RoadEventPOI_UI);

View File

@@ -3,9 +3,9 @@ package com.mogo.eagle.core.function.v2x.events.marker;
import android.content.Context;
import android.graphics.Bitmap;
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity;
import com.mogo.eagle.core.function.v2x.R;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.eagle.core.data.enums.EventTypeEnum;
import java.util.ArrayList;

View File

@@ -5,10 +5,10 @@ import android.content.Context
import android.graphics.Bitmap
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
import com.mogo.eagle.core.function.v2x.R
import com.mogo.eagle.core.utilcode.util.ViewUtils
import com.mogo.module.common.entity.V2XRoadEventEntity
import com.mogo.module.common.enums.EventTypeEnum
import com.mogo.eagle.core.data.enums.EventTypeEnum
import kotlinx.android.synthetic.main.view_marker_event_car.view.*
/**

View File

@@ -1,7 +1,7 @@
package com.mogo.eagle.core.function.v2x.events.network;
import com.mogo.eagle.core.network.MoGoRetrofitFactory;
import com.mogo.module.common.constants.HostConst;
import com.mogo.eagle.core.data.constants.HostConst;
/**
* 应对不同接口对应不同服务域名的工厂累

View File

@@ -3,9 +3,9 @@ package com.mogo.eagle.core.function.v2x.events.receiver
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst
import com.mogo.eagle.core.function.v2x.events.scenario.impl.V2XScenarioManager
import com.mogo.module.common.entity.V2XMessageEntity
import java.lang.Exception
class SceneBroadcastReceiver: BroadcastReceiver() {

View File

@@ -6,20 +6,19 @@ import android.content.Intent;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay;
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity;
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity;
import com.mogo.eagle.core.function.call.chat.CallerChatManager;
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst;
import com.mogo.eagle.core.function.v2x.events.entity.net.V2XOptimalRouteDataRes;
import com.mogo.eagle.core.function.v2x.events.entity.net.V2XSpecialCarRes;
import com.mogo.eagle.core.function.v2x.events.utils.TestOnLineCarUtils;
import com.mogo.eagle.core.function.v2x.events.utils.V2XSQLiteUtils;
import com.mogo.eagle.core.utilcode.util.Utils;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.service.statusmanager.IMogoStatusManager;
import java.util.List;
@@ -66,7 +65,8 @@ public class TestPanelBroadcastReceiver extends BroadcastReceiver {
// 存储本地,出行动态作展示
saveLocalStory(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING,
v2XMessageEntity.getContent().getNoveltyInfo());
} if (sceneType == 2) {// 触发AI道路施工事件
}
if (sceneType == 2) {// 触发AI道路施工事件
V2XMessageEntity<V2XRoadEventEntity> v2XMessageEntity =
TestOnLineCarUtils.getV2XScenarioAIRoadEventData();
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
@@ -129,10 +129,7 @@ public class TestPanelBroadcastReceiver extends BroadcastReceiver {
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
IMogoStatusManager statusManager = BridgeApi.INSTANCE.statusManager();
if (statusManager != null) {
statusManager.setSeekHelping(V2XConst.MODULE_NAME, true);
}
MogoStatusManager.getInstance().setSeekHelping(V2XConst.MODULE_NAME, true);
} else if (sceneType == 20) {// 小地图绘制线
List<MogoLatLng> coordinates = TestOnLineCarUtils.getTestCoordinates();
CallerSmpManager.drawablePolyline(coordinates);

View File

@@ -1,6 +1,6 @@
package com.mogo.eagle.core.function.v2x.events.scenario;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity;
/**
* author : donghongyu

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.core.function.v2x.events.scenario;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity;
/**
* author : donghongyu

View File

@@ -2,9 +2,10 @@ package com.mogo.eagle.core.function.v2x.events.scenario.impl;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity;
import com.mogo.eagle.core.function.v2x.events.scenario.IV2XScenario;
import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker;
import com.mogo.module.common.entity.V2XMessageEntity;
/**
* author : donghongyu

View File

@@ -6,22 +6,19 @@ import android.content.Intent;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity;
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst;
import com.mogo.eagle.core.function.v2x.events.scenario.IV2XScenarioManager;
import com.mogo.eagle.core.function.v2x.events.scenario.scene.road.V2XRoadEventScenario;
import com.mogo.eagle.core.function.v2x.events.scenario.scene.route.V2XOptimalRouteVREventScenario;
import com.mogo.eagle.core.function.v2x.events.scenario.scene.warning.V2XFrontWarningScenario;
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.mogo.eagle.core.utilcode.util.Utils;
import com.mogo.map.MogoMapUIController;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.service.statusmanager.IMogoStatusManager;
/**
* author : donghongyu
@@ -74,12 +71,7 @@ public class V2XScenarioManager implements IV2XScenarioManager {
break;
case V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_WEAKNESS:
sceneChange();
boolean isVrMode1 = false;
IMogoStatusManager statusManager1 = BridgeApi.INSTANCE.statusManager();
if (statusManager1 != null) {
isVrMode1 = statusManager1.isVrMode();
}
if (isVrMode1) {
if (MogoStatusManager.getInstance().isVrMode()) {
mV2XScenario = new V2XFrontWarningScenario();
} else {
mV2XScenario = null;

View File

@@ -12,6 +12,7 @@ import androidx.lifecycle.Lifecycle.Event.ON_CREATE
import androidx.lifecycle.Lifecycle.Event.ON_DESTROY
import com.mogo.eagle.core.data.map.*
import com.mogo.eagle.core.data.map.MapRoadInfo.StopLine
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
import com.mogo.eagle.core.function.api.map.listener.*
import com.mogo.eagle.core.function.api.v2x.*
import com.mogo.eagle.core.function.call.map.*
@@ -23,7 +24,6 @@ import com.mogo.eagle.core.utilcode.kotlin.*
import com.mogo.eagle.core.utilcode.mogo.logger.*
import com.mogo.map.*
import com.mogo.map.overlay.*
import com.mogo.module.common.entity.*
import com.mogo.module.common.utils.*
import io.netty.util.internal.*
import java.lang.Runnable

View File

@@ -4,13 +4,13 @@ import android.graphics.*
import android.util.*
import com.mogo.cloud.commons.utils.*
import com.mogo.eagle.core.data.map.*
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi.context
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi.v2xMarker
import com.mogo.map.*
import com.mogo.map.R.raw
import com.mogo.map.marker.*
import com.mogo.map.overlay.*
import com.mogo.module.common.entity.*
import com.mogo.module.common.utils.*
import java.util.*
import java.util.concurrent.atomic.*

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