Merge branch 'dev_robotaxi-d-app-module_2130_221116_2.13.0' into mutidev_robotaxi-d-app-module_2130_221116_2.13.0_multi_display
# Conflicts: # app/src/main/java/com/mogo/launcher/stageone/HttpDnsStartUp.kt
@@ -1,6 +1,6 @@
|
||||
package com.mogo.och.bus.passenger.callback;
|
||||
|
||||
import android.location.Location;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
|
||||
/**
|
||||
* Created on 2022/3/31
|
||||
@@ -11,5 +11,5 @@ public interface IBusPassengerControllerStatusCallback {
|
||||
// 是否vr map模式
|
||||
void onVRModeChanged(boolean isVRMode);
|
||||
// 自车定位
|
||||
void onCarLocationChanged(Location location);
|
||||
void onCarLocationChanged(MogoLocation location);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mogo.och.bus.passenger.model;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.location.Location;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
@@ -11,7 +10,6 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.mogo.aicloud.services.socket.IMogoLifecycleListener;
|
||||
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
@@ -22,8 +20,10 @@ 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.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
|
||||
@@ -32,8 +32,6 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.och.bus.passenger.bean.BusPassengerOperationStatusResponse;
|
||||
import com.mogo.och.bus.passenger.bean.BusPassengerRoutesResponse;
|
||||
import com.mogo.och.bus.passenger.bean.BusPassengerRoutesResult;
|
||||
@@ -70,7 +68,7 @@ import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STAT
|
||||
public class BusPassengerModel {
|
||||
private static final String TAG = BusPassengerModel.class.getSimpleName();
|
||||
|
||||
private List<Location> mRoutePoints = new ArrayList<>();
|
||||
private List<MogoLocation> mRoutePoints = new ArrayList<>();
|
||||
|
||||
private static final class SingletonHolder {
|
||||
private static final BusPassengerModel INSTANCE = new BusPassengerModel();
|
||||
@@ -88,14 +86,13 @@ public class BusPassengerModel {
|
||||
private IBusPassegerDriverStatusCallback mDriverStatusCallback; //出车收车状态
|
||||
private IBusPassengerRouteLineInfoCallback mRouteLineInfoCallback; // bus路线信息更新
|
||||
|
||||
// private double mLongitude, mLatitude;
|
||||
private Location mLocation = null;
|
||||
private MogoLocation mLocation = null;
|
||||
|
||||
private BusPassengerRoutesResult routesResult = null;
|
||||
|
||||
List<BusPassengerStation> mStations = new ArrayList<>();
|
||||
private int mNextStationIndex = 0;// 要到达站的index
|
||||
private List<Location> mTwoStationsRouts = new ArrayList<>();
|
||||
private List<MogoLocation> mTwoStationsRouts = new ArrayList<>();
|
||||
private int mPreRouteIndex = 0;
|
||||
|
||||
private static final int MSG_QUERY_BUS_P_STATION = 1001;
|
||||
@@ -252,11 +249,8 @@ public class BusPassengerModel {
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
|
||||
IntentManager.getInstance().registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener );
|
||||
// 达到起始站围栏监听
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getRegisterCenterApi()
|
||||
.registerCarLocationChangedListener( TAG, mCarLocationChangedListener2);
|
||||
// 定位监听
|
||||
CallerMapLocationListenerManager.INSTANCE.addListener(TAG, mMapLocationListener,false);
|
||||
|
||||
//2021.11.1 自动驾驶路线规划接口
|
||||
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG,moGoAutopilotPlanningListener);
|
||||
@@ -265,11 +259,8 @@ public class BusPassengerModel {
|
||||
private void releaseListeners() {
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
// 注销到达起始站围栏监听
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getRegisterCenterApi()
|
||||
.unregisterCarLocationChangedListener(TAG, mCarLocationChangedListener2);
|
||||
// 注销定位监听
|
||||
CallerMapLocationListenerManager.INSTANCE.removeListener(TAG,false);
|
||||
|
||||
MogoAiCloudSocketManager.getInstance(mContext)
|
||||
.unregisterLifecycleListener(10010);
|
||||
@@ -302,15 +293,9 @@ public class BusPassengerModel {
|
||||
}
|
||||
};
|
||||
|
||||
// 自车定位
|
||||
private final IMogoCarLocationChangedListener2 mCarLocationChangedListener2 = new IMogoCarLocationChangedListener2() {
|
||||
|
||||
private final IMoGoMapLocationListener mMapLocationListener = new IMoGoMapLocationListener() {
|
||||
@Override
|
||||
public void onCarLocationChanged2( Location location ) {
|
||||
//位置变化时,通过围栏判断是否到达x点
|
||||
// TODO: 2022/3/31
|
||||
// mLongitude = location.getLongitude();
|
||||
// mLatitude = location.getLatitude();
|
||||
public void onLocationChanged(@Nullable MogoLocation location, int from, boolean isGps) {
|
||||
mLocation = location;
|
||||
for (IBusPassengerControllerStatusCallback callback :mControllerStatusCallbackMap.values()){
|
||||
callback.onCarLocationChanged(location);
|
||||
@@ -406,7 +391,7 @@ public class BusPassengerModel {
|
||||
|
||||
public void updateRoutePoints(List<MessagePad.Location> routePoints){
|
||||
mRoutePoints.clear();
|
||||
List<Location> latLngModels = CoordinateCalculateRouteUtil
|
||||
List<MogoLocation> latLngModels = CoordinateCalculateRouteUtil
|
||||
.coordinateConverterWgsToGcjLocations(mContext,routePoints);
|
||||
mRoutePoints.addAll(latLngModels);
|
||||
calculateTwoStationsRoute();
|
||||
@@ -454,14 +439,14 @@ public class BusPassengerModel {
|
||||
calculateTwoStationsRoute();
|
||||
}
|
||||
if (mTwoStationsRouts.size() > 0 && mLocation != null){
|
||||
Map<Integer,List<Location>> lastPointsMap = CoordinateCalculateRouteUtil
|
||||
Map<Integer,List<MogoLocation>> lastPointsMap = CoordinateCalculateRouteUtil
|
||||
.getRemainPointListByCompareNew(mPreRouteIndex,mTwoStationsRouts,mLocation);
|
||||
for (int index: lastPointsMap.keySet()) {
|
||||
mPreRouteIndex = index;
|
||||
break;
|
||||
}
|
||||
|
||||
for (List<Location> lastPoints: lastPointsMap.values()){
|
||||
for (List<MogoLocation> lastPoints: lastPointsMap.values()){
|
||||
float lastSumLength = 0;
|
||||
if (lastPoints.size() == 1){ //只是最后一个点,计算当前位置和最后一个点的距离
|
||||
lastSumLength = CoordinateUtils.calculateLineDistance(
|
||||
|
||||
@@ -9,6 +9,7 @@ import androidx.lifecycle.LifecycleOwner;
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
@@ -109,7 +110,7 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(Location location) {
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
if (location != null){
|
||||
runOnUIThread(() -> mView.onCarLocationChanged(location));
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.elegant.utils.UiThreadHandler;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
@@ -337,7 +338,7 @@ public class BusPassengerRouteFragment extends
|
||||
lastBearing = bearing;
|
||||
}
|
||||
|
||||
public void onCarLocationChanged(Location location) {
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
updateSpeedView(location.getSpeed());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.och.bus.callback;
|
||||
|
||||
import android.location.Location;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
|
||||
/**
|
||||
* Created on 2021/9/10
|
||||
@@ -11,7 +11,7 @@ public interface IBusControllerStatusCallback {
|
||||
// 是否vr map模式
|
||||
void onVRModeChanged(boolean isVRMode);
|
||||
// 自车定位
|
||||
void onCarLocationChanged(Location location);
|
||||
void onCarLocationChanged(MogoLocation location);
|
||||
//开始开启自动驾驶
|
||||
void startOpenAutopilot();
|
||||
}
|
||||
|
||||
@@ -7,11 +7,11 @@ import static com.mogo.och.bus.constant.BusConst.STATION_STATUS_ARRIVING;
|
||||
import static com.mogo.och.bus.constant.BusConst.STATION_STATUS_STOPPED;
|
||||
|
||||
import android.content.Context;
|
||||
import android.location.Location;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
@@ -19,25 +19,24 @@ import com.elegant.network.utils.GsonUtil;
|
||||
import com.mogo.aicloud.services.socket.IMogoOnMessageListener;
|
||||
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.eagle.core.data.BaseData;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.och.bus.R;
|
||||
import com.mogo.och.bus.bean.BusRoutePlanningUpdateReqBean;
|
||||
import com.mogo.och.bus.bean.BusRoutesResponse;
|
||||
@@ -149,29 +148,24 @@ public class BusOrderModel {
|
||||
public void init() {
|
||||
mContext = AbsMogoApplication.getApp();
|
||||
loginService = (LoginService) ARouter.getInstance().build(OchCommonConst.LOGINSERVICE).navigation();
|
||||
// 2021/10/20 衡阳小巴业务,使用LenovoPad时需要此app自己获取坐标并上传
|
||||
String productFlavor = DebugConfig.getProductFlavor();
|
||||
if (productFlavor != null && productFlavor.contains("fPadLenovoOchBus")) {
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getRegisterCenterApi()
|
||||
.registerCarLocationChangedListener(TAG, mCarLocationChangedListener2);
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
// 定位监听
|
||||
CallerMapLocationListenerManager.INSTANCE.addListener(TAG, mMapLocationListener, false);
|
||||
|
||||
//自动驾驶路线规划接口
|
||||
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
//开启自驾后 异常信息返回
|
||||
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(mAdasStartFailureListener);
|
||||
//自动驾驶路线规划接口
|
||||
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
|
||||
|
||||
OCHSocketMessageManager.INSTANCE.registerSocketMessageListener(//监听运营消息
|
||||
OCHSocketMessageManager.INSTANCE.getMsgMonitorType(),
|
||||
mMogoOnMessageListener);
|
||||
//开启自驾后 异常信息返回
|
||||
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(mAdasStartFailureListener);
|
||||
|
||||
OCHSocketMessageManager.INSTANCE.registerSocketMessageListener(//监听核销乘客
|
||||
OCHSocketMessageManager.INSTANCE.getMsgWriteOffPassengerType(),
|
||||
mWriteOffPassengeOnMessageListener);
|
||||
}
|
||||
OCHSocketMessageManager.INSTANCE.registerSocketMessageListener(//监听运营消息
|
||||
OCHSocketMessageManager.INSTANCE.getMsgMonitorType(),
|
||||
mMogoOnMessageListener);
|
||||
|
||||
OCHSocketMessageManager.INSTANCE.registerSocketMessageListener(//监听核销乘客
|
||||
OCHSocketMessageManager.INSTANCE.getMsgWriteOffPassengerType(),
|
||||
mWriteOffPassengeOnMessageListener);
|
||||
|
||||
//2022.1.28
|
||||
// 调用Disposable.dispose() 时候会出现InterruptedException 导致出现崩溃
|
||||
@@ -335,11 +329,8 @@ public class BusOrderModel {
|
||||
//startOrStopQueryPassengerWriteOff(false);
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
// 注销到达起始站围栏监听
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getRegisterCenterApi()
|
||||
.unregisterCarLocationChangedListener(TAG, mCarLocationChangedListener2);
|
||||
// 注销定位监听
|
||||
CallerMapLocationListenerManager.INSTANCE.removeListener(TAG,false);
|
||||
|
||||
//自动驾驶路线规划接口
|
||||
CallerAutopilotPlanningListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
|
||||
@@ -382,11 +373,9 @@ public class BusOrderModel {
|
||||
};
|
||||
|
||||
// 自车定位
|
||||
private final IMogoCarLocationChangedListener2 mCarLocationChangedListener2 = new IMogoCarLocationChangedListener2() {
|
||||
|
||||
private final IMoGoMapLocationListener mMapLocationListener = new IMoGoMapLocationListener() {
|
||||
@Override
|
||||
public void onCarLocationChanged2(Location location) {
|
||||
// CallerLogger.INSTANCE.d(M_BUS + TAG,"location = "+location.getLongitude()+","+location.getLatitude());
|
||||
public void onLocationChanged(@Nullable MogoLocation location, int from, boolean isGps) {
|
||||
mLongitude = location.getLongitude();
|
||||
mLatitude = location.getLatitude();
|
||||
if (mControllerStatusCallback != null) {
|
||||
@@ -401,7 +390,7 @@ public class BusOrderModel {
|
||||
};
|
||||
|
||||
//根据围栏判断,是否到达站点
|
||||
private void judgeArrivedStation(Location location) {
|
||||
private void judgeArrivedStation(MogoLocation location) {
|
||||
|
||||
if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) {
|
||||
CallerLogger.INSTANCE.e(M_BUS + TAG, "到站数组越界");
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
@@ -236,7 +237,7 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(Location location) {
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
if (null != location) {
|
||||
runOnUIThread(() -> mView.updateSpeedView(location.getSpeed()));
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.location.Location;
|
||||
import com.amap.api.maps.CoordinateConverter;
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -26,7 +27,20 @@ public class CoordinateCalculateRouteUtil {
|
||||
|
||||
float sumLength = 0;
|
||||
|
||||
if (points.get(1) instanceof Location){
|
||||
if (points.get(1) instanceof MogoLocation){
|
||||
//计算全路径总距离
|
||||
for (int i = 0;i + 1< points.size();i++){
|
||||
MogoLocation locationPre = (MogoLocation) points.get(i);
|
||||
MogoLocation location = (MogoLocation) points.get(i+1);
|
||||
double preLat = locationPre.getLatitude();
|
||||
double preLon = locationPre.getLongitude();
|
||||
double laLat = location.getLatitude();
|
||||
double laLon = location.getLongitude();
|
||||
|
||||
float length = CoordinateUtils.calculateLineDistance(laLon,laLat,preLon,preLat);
|
||||
sumLength += length;
|
||||
}
|
||||
}else if (points.get(1) instanceof Location){
|
||||
//计算全路径总距离
|
||||
for (int i = 0;i + 1< points.size();i++){
|
||||
Location locationPre = (Location) points.get(i);
|
||||
@@ -172,12 +186,12 @@ public class CoordinateCalculateRouteUtil {
|
||||
}
|
||||
|
||||
|
||||
public static List<Location> coordinateConverterWgsToGcjLocations(Context mContext, List<MessagePad.Location> models) {
|
||||
public static List<MogoLocation> coordinateConverterWgsToGcjLocations(Context mContext, List<MessagePad.Location> models) {
|
||||
//转成MogoLatLng集合
|
||||
List<Location> list = new ArrayList<>();
|
||||
List<MogoLocation> list = new ArrayList<>();
|
||||
for (MessagePad.Location m : models) {
|
||||
LatLng mogoLatLng = coordinateConverterWgsToGcj(mContext, m);
|
||||
Location location = new Location("gcj_provider");
|
||||
MogoLocation location = new MogoLocation();
|
||||
location.setBearing((float) m.getHeading());
|
||||
location.setLatitude(mogoLatLng.latitude);
|
||||
location.setLongitude(mogoLatLng.longitude);
|
||||
@@ -186,11 +200,11 @@ public class CoordinateCalculateRouteUtil {
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<Location> coordinateConverterLatlngToLocation(List<LatLng> models) {
|
||||
public static List<MogoLocation> coordinateConverterLatlngToLocation(List<LatLng> models) {
|
||||
//转成MogoLatLng集合
|
||||
List<Location> list = new ArrayList<>();
|
||||
List<MogoLocation> list = new ArrayList<>();
|
||||
for (LatLng m : models) {
|
||||
Location location = new Location("gcj_provider");
|
||||
MogoLocation location = new MogoLocation();
|
||||
location.setLatitude(m.latitude);
|
||||
location.setLongitude(m.longitude);
|
||||
list.add(location);
|
||||
@@ -198,10 +212,10 @@ public class CoordinateCalculateRouteUtil {
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<LatLng> coordinateConverterLocationToLatLng(Context mContext, List<Location> models) {
|
||||
public static List<LatLng> coordinateConverterLocationToLatLng(Context mContext, List<MogoLocation> models) {
|
||||
//转成MogoLatLng集合
|
||||
List<LatLng> list = new ArrayList<>();
|
||||
for (Location m : models) {
|
||||
for (MogoLocation m : models) {
|
||||
LatLng mogoLatLng = coordinateConverterWgsToGcj(mContext, m.getLongitude(),m.getLatitude());
|
||||
list.add(mogoLatLng);
|
||||
}
|
||||
@@ -215,21 +229,21 @@ public class CoordinateCalculateRouteUtil {
|
||||
* @param realLocation
|
||||
* @return
|
||||
*/
|
||||
public static Map<Integer,List<Location>> getRemainPointListByCompareNew(int preIndex,
|
||||
List<Location> mRoutePoints,
|
||||
Location realLocation) {
|
||||
Map<Integer,List<Location>> routePonits = new HashMap<>();
|
||||
List<Location> latePoints = new ArrayList<>(); // 剩余轨迹集合
|
||||
public static Map<Integer,List<MogoLocation>> getRemainPointListByCompareNew(int preIndex,
|
||||
List<MogoLocation> mRoutePoints,
|
||||
MogoLocation realLocation) {
|
||||
Map<Integer,List<MogoLocation>> routePonits = new HashMap<>();
|
||||
List<MogoLocation> latePoints = new ArrayList<>(); // 剩余轨迹集合
|
||||
int currentIndex = 0; //记录疑似点
|
||||
if (mRoutePoints.size() > preIndex){
|
||||
//基础点
|
||||
Location baseLatLng = mRoutePoints.get(preIndex);
|
||||
MogoLocation baseLatLng = mRoutePoints.get(preIndex);
|
||||
float baseDiffDis = CoordinateUtils.calculateLineDistance(realLocation.getLongitude(),
|
||||
realLocation.getLatitude()
|
||||
,baseLatLng.getLongitude(),baseLatLng.getLongitude());// lon,lat, prelon, prelat
|
||||
|
||||
for (int i= preIndex; i < mRoutePoints.size(); i++){
|
||||
Location latLng = mRoutePoints.get(i);
|
||||
MogoLocation latLng = mRoutePoints.get(i);
|
||||
//todo 先看index对应点的方向和realLocation方向是否一致, 方向角度不能过90度
|
||||
if (Math.abs(realLocation.getBearing() - latLng.getBearing()) <= 90){
|
||||
float diff = CoordinateUtils.calculateLineDistance(realLocation.getLongitude(),
|
||||
@@ -244,12 +258,12 @@ public class CoordinateCalculateRouteUtil {
|
||||
}
|
||||
Logger.d( "calculateRouteSumLength", "点:"+currentIndex+"-------是最近的点------ ");
|
||||
if (currentIndex == mRoutePoints.size()-1){
|
||||
Location location = mRoutePoints.get(currentIndex);
|
||||
MogoLocation location = mRoutePoints.get(currentIndex);
|
||||
// LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
|
||||
latePoints.add(location);
|
||||
}else {
|
||||
List<Location> locations = mRoutePoints.subList(currentIndex,mRoutePoints.size()-1);
|
||||
for (Location location: locations) {
|
||||
List<MogoLocation> locations = mRoutePoints.subList(currentIndex,mRoutePoints.size()-1);
|
||||
for (MogoLocation location: locations) {
|
||||
// LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
|
||||
latePoints.add(location);
|
||||
}
|
||||
@@ -260,16 +274,16 @@ public class CoordinateCalculateRouteUtil {
|
||||
return routePonits;
|
||||
}
|
||||
|
||||
public static int getArrivedPointIndexNew(int preIndex, List<Location> mRoutePoints,
|
||||
public static int getArrivedPointIndexNew(int preIndex, List<MogoLocation> mRoutePoints,
|
||||
double realLon,double realLat) {
|
||||
int currentIndex = preIndex; //记录疑似点 //基础点
|
||||
Location baseLatLng = mRoutePoints.get(0);
|
||||
MogoLocation baseLatLng = mRoutePoints.get(0);
|
||||
float baseDiffDis = CoordinateUtils.calculateLineDistance(realLon,
|
||||
realLat
|
||||
, baseLatLng.getLongitude(), baseLatLng.getLongitude());// lon,lat, prelon, prelat
|
||||
|
||||
for (int i = 0; i < mRoutePoints.size(); i++) {
|
||||
Location latLng = mRoutePoints.get(i);
|
||||
MogoLocation latLng = mRoutePoints.get(i);
|
||||
//todo 先看index对应点的方向和realLocation方向是否一致, 方向角度不能过90度
|
||||
// if (Math.abs(realLocation.getBearing() - latLng.getBearing()) <= 90) {
|
||||
float diff = CoordinateUtils.calculateLineDistance(realLon,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.och.sweeper.callback;
|
||||
|
||||
import android.location.Location;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
|
||||
/**
|
||||
* Created on 2021/9/10
|
||||
@@ -11,7 +11,7 @@ public interface ISweeperControllerStatusCallback {
|
||||
// 是否vr map模式
|
||||
void onVRModeChanged(boolean isVRMode);
|
||||
// 自车定位
|
||||
void onCarLocationChanged(Location location);
|
||||
void onCarLocationChanged(MogoLocation location);
|
||||
//开始开启自动驾驶
|
||||
void startOpenAutopilot();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.os.Handler;
|
||||
import android.os.Message;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.elegant.network.utils.GsonUtil;
|
||||
@@ -22,10 +23,13 @@ import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener;
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
@@ -127,18 +131,14 @@ public class SweeperOrderModel {
|
||||
|
||||
public void init() {
|
||||
mContext = AbsMogoApplication.getApp();
|
||||
// 2021/10/20 衡阳小巴业务,使用LenovoPad时需要此app自己获取坐标并上传
|
||||
String productFlavor = DebugConfig.getProductFlavor();
|
||||
if (productFlavor != null && productFlavor.contains("fPadLenovoOchBus")) {
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getRegisterCenterApi()
|
||||
.registerCarLocationChangedListener(TAG, mCarLocationChangedListener2);
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
// 定位监听
|
||||
CallerMapLocationListenerManager.INSTANCE.addListener(TAG,mMapLocationListener,false);
|
||||
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
//自动驾驶路线规划接口
|
||||
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
|
||||
|
||||
//自动驾驶路线规划接口
|
||||
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
|
||||
}
|
||||
|
||||
//2022.1.28
|
||||
// 调用Disposable.dispose() 时候会出现InterruptedException 导致出现崩溃
|
||||
@@ -261,11 +261,8 @@ public class SweeperOrderModel {
|
||||
public void release() {
|
||||
startOrStopOrderLoop(false);
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
// 注销到达起始站围栏监听
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getRegisterCenterApi()
|
||||
.unregisterCarLocationChangedListener(TAG, mCarLocationChangedListener2);
|
||||
// 注销定位监听
|
||||
CallerMapLocationListenerManager.INSTANCE.removeListener(TAG,false);
|
||||
|
||||
//自动驾驶路线规划接口
|
||||
CallerAutopilotPlanningListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
|
||||
@@ -289,11 +286,9 @@ public class SweeperOrderModel {
|
||||
};
|
||||
|
||||
// 自车定位
|
||||
private final IMogoCarLocationChangedListener2 mCarLocationChangedListener2 = new IMogoCarLocationChangedListener2() {
|
||||
|
||||
private final IMoGoMapLocationListener mMapLocationListener = new IMoGoMapLocationListener() {
|
||||
@Override
|
||||
public void onCarLocationChanged2(Location location) {
|
||||
// CallerLogger.INSTANCE.d(M_BUS + TAG,"location = "+location.getLongitude()+","+location.getLatitude());
|
||||
public void onLocationChanged(@Nullable MogoLocation location, int from, boolean isGps) {
|
||||
mLongitude = location.getLongitude();
|
||||
mLatitude = location.getLatitude();
|
||||
if (mControllerStatusCallback != null) {
|
||||
@@ -308,7 +303,7 @@ public class SweeperOrderModel {
|
||||
};
|
||||
|
||||
//根据围栏判断,是否到达起点
|
||||
private void judgeStartStation(Location location) {
|
||||
private void judgeStartStation(MogoLocation location) {
|
||||
|
||||
if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) {
|
||||
return;
|
||||
|
||||
@@ -12,6 +12,7 @@ import androidx.lifecycle.LifecycleOwner;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
@@ -238,7 +239,7 @@ public class SweeperPresenter extends Presenter<SweeperFragment>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(Location location) {
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
if (null != location) {
|
||||
runOnUIThread(() -> mView.updateSpeedView(location.getSpeed()));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.och.taxi.passenger.callback;
|
||||
|
||||
import android.location.Location;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
|
||||
/**
|
||||
* Created on 2021/9/10
|
||||
@@ -11,5 +11,5 @@ public interface IOCHTaxiPassengerControllerStatusCallback {
|
||||
// 是否vr map模式
|
||||
void onVRModeChanged(boolean isVRMode);
|
||||
// 自车定位
|
||||
void onCarLocationChanged(Location location);
|
||||
void onCarLocationChanged(MogoLocation location);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mogo.och.taxi.passenger.model;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.location.Location;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.os.Looper;
|
||||
|
||||
@@ -23,12 +22,15 @@ 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;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
|
||||
import com.mogo.eagle.core.function.api.v2x.LimitingVelocityListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
|
||||
import com.mogo.eagle.core.function.call.v2x.CallLimitingVelocityListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
@@ -36,8 +38,6 @@ import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.och.common.module.manager.OCHAdasAbilityManager;
|
||||
import com.mogo.och.common.module.map.AmapNaviToDestinationModel;
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
|
||||
@@ -61,7 +61,6 @@ import com.mogo.och.taxi.passenger.callback.ITaxiPassengerVeloctityCallback;
|
||||
import com.mogo.och.taxi.passenger.constant.TaxiPassengerConst;
|
||||
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 org.jetbrains.annotations.NotNull;
|
||||
@@ -123,7 +122,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
|
||||
private double mLongitude, mLatitude;
|
||||
|
||||
private List<Location> mLocationsModels = new ArrayList<>();
|
||||
private List<MogoLocation> mLocationsModels = new ArrayList<>();
|
||||
|
||||
private TaxiPassengerModel() {
|
||||
}
|
||||
@@ -233,11 +232,8 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
|
||||
IntentManager.getInstance().registerIntentListener( ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
// 达到起始站围栏监听
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getRegisterCenterApi()
|
||||
.registerCarLocationChangedListener( TAG, mCarLocationChangedListener2);
|
||||
// 定位监听
|
||||
CallerMapLocationListenerManager.INSTANCE.addListener(TAG,mMapLocationListener,false);
|
||||
|
||||
//2021.11.1 自动驾驶路线规划接口
|
||||
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG,moGoAutopilotPlanningListener);
|
||||
@@ -249,11 +245,8 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
private void releaseListeners() {
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
// 注销到达起始站围栏监听
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getRegisterCenterApi()
|
||||
.unregisterCarLocationChangedListener(TAG, mCarLocationChangedListener2);
|
||||
// 注销定位监听
|
||||
CallerMapLocationListenerManager.INSTANCE.removeListener(TAG,false);
|
||||
|
||||
MogoAiCloudSocketManager.getInstance(mContext)
|
||||
.unregisterLifecycleListener(10010);
|
||||
@@ -416,7 +409,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
}
|
||||
|
||||
// TODO: 2021/9/12
|
||||
public void calculateTravelDistance(Location carLocation){
|
||||
public void calculateTravelDistance(MogoLocation carLocation){
|
||||
if (checkCurrentOCHOrder() && mCurrentOCHOrder.endSiteGcjPoint.size()>0) {
|
||||
double endLon = mCurrentOCHOrder.endSiteGcjPoint.get(0);
|
||||
double endLat = mCurrentOCHOrder.endSiteGcjPoint.get(1);
|
||||
@@ -455,10 +448,9 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
};
|
||||
|
||||
// 自车定位
|
||||
private final IMogoCarLocationChangedListener2 mCarLocationChangedListener2 = new IMogoCarLocationChangedListener2() {
|
||||
|
||||
private final IMoGoMapLocationListener mMapLocationListener = new IMoGoMapLocationListener() {
|
||||
@Override
|
||||
public void onCarLocationChanged2( Location location ) {
|
||||
public void onLocationChanged(@Nullable MogoLocation location, int from, boolean isGps) {
|
||||
//位置变化时,通过围栏判断是否到达x点
|
||||
if (location != null && checkCurrentOCHOrder()) {
|
||||
if (getCurOrderStatus() == TaxiPassengerOrderStatusEnum.OnTheWayToEnd) {
|
||||
@@ -467,7 +459,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
}
|
||||
mLongitude = location.getLongitude();
|
||||
mLatitude = location.getLatitude();
|
||||
// CallerLogger.INSTANCE.e(M_TAXI_P + TAG,"mLongitude = "+mLongitude+", mLatitude = "+mLatitude);
|
||||
// CallerLogger.INSTANCE.e(M_TAXI_P + TAG,"mLongitude = "+mLongitude+", mLatitude = "+mLatitude);
|
||||
for (IOCHTaxiPassengerControllerStatusCallback callback :mControllerStatusCallbackMap.values()){
|
||||
callback.onCarLocationChanged(location);
|
||||
}
|
||||
@@ -583,7 +575,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
};
|
||||
|
||||
public void startToRouteAndWipe(List<MessagePad.Location> models) {
|
||||
List<Location> locationsModels = CoordinateCalculateRouteUtil
|
||||
List<MogoLocation> locationsModels = CoordinateCalculateRouteUtil
|
||||
.coordinateConverterWgsToGcjLocations(mContext,models);
|
||||
mLocationsModels.clear();
|
||||
mLocationsModels.addAll(locationsModels);
|
||||
@@ -724,7 +716,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
mAutopilotPlanningCallback.setLineMarker(data.data);
|
||||
}
|
||||
mLocationsModels.clear();
|
||||
List<Location> locationsModels = CoordinateCalculateRouteUtil.
|
||||
List<MogoLocation> locationsModels = CoordinateCalculateRouteUtil.
|
||||
coordinateConverterLatlngToLocation(data.data);
|
||||
mLocationsModels.addAll(locationsModels);
|
||||
startOrStopRouteAndWipe(true);
|
||||
|
||||
@@ -10,6 +10,7 @@ import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
@@ -119,7 +120,7 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(Location location) {
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
// 速度不用展示
|
||||
// LeftMenuOpen.INSTANCE.callCallBack(-1,-1,location.getSpeed());
|
||||
}
|
||||
@@ -197,6 +198,7 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
|
||||
mView.showOrHideServingOrderFragment(true,true);
|
||||
});
|
||||
TaxiPassengerModel.getInstance().startOrStopReadyToAutopilotLoop(false);
|
||||
CallerSmpManager.startQueryV2XEvents();//全览模式的V2X事件轮询开始
|
||||
}
|
||||
// 30 用户到达上车点 并通过了手机号后四位验证
|
||||
// 40 服务中
|
||||
|
||||
@@ -11,6 +11,7 @@ import androidx.lifecycle.LifecycleOwner;
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
@@ -140,7 +141,7 @@ public class TaxiPassengerServingOrderPresenter extends Presenter<TaxiPassengerS
|
||||
private static final long TIMEINTERVAL = 4000;
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(Location location) {
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
if (location != null){
|
||||
runOnUIThread(() -> mView.onCarLocationChanged(location));
|
||||
long currentTimeMillis = System.currentTimeMillis();
|
||||
|
||||
@@ -22,6 +22,7 @@ import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
@@ -351,7 +352,7 @@ public class TaxiPassengerServingOrderFragment extends
|
||||
|
||||
}
|
||||
|
||||
public void onCarLocationChanged(Location location) {
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
updateSpeedView(location.getSpeed());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.och.taxi.callback;
|
||||
|
||||
import android.location.Location;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
|
||||
/**
|
||||
* Created on 2021/9/10
|
||||
@@ -11,7 +11,7 @@ public interface ITaxiControllerStatusCallback {
|
||||
// 是否vr map模式
|
||||
void onVRModeChanged(boolean isVRMode);
|
||||
// 自车定位
|
||||
void onCarLocationChanged(Location location);
|
||||
void onCarLocationChanged(MogoLocation location);
|
||||
//开始开启自动驾驶
|
||||
void startOpenAutopilot();
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAX
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.location.Location;
|
||||
import android.net.ConnectivityManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -27,18 +26,19 @@ import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager;
|
||||
import com.mogo.och.common.module.biz.common.socketmessage.data.OCHOperationalMessage;
|
||||
import com.mogo.och.common.module.biz.constant.LoginStatusManager;
|
||||
@@ -128,11 +128,11 @@ public class TaxiModel {
|
||||
|
||||
private volatile boolean isRestartAutopilot = false;
|
||||
|
||||
private List<Location> mRoutePoints = new ArrayList<>();
|
||||
private List<MogoLocation> mRoutePoints = new ArrayList<>();
|
||||
private int mPreRouteIndex = 0;
|
||||
|
||||
private double mLongitude, mLatitude;
|
||||
private Location mLocation = null;
|
||||
private MogoLocation mLocation = null;
|
||||
|
||||
private LoginService loginService;
|
||||
|
||||
@@ -220,11 +220,9 @@ public class TaxiModel {
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
|
||||
IntentManager.getInstance().registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener);
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
// 达到起始站围栏监听
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getRegisterCenterApi()
|
||||
.registerCarLocationChangedListener(TAG, mCarLocationChangedListener2);
|
||||
|
||||
//定位监听, 传false是高德坐标系
|
||||
CallerMapLocationListenerManager.INSTANCE.addListener(TAG,mMapLocationLIstener,false);
|
||||
|
||||
//2021.11.1 自动驾驶路线规划接口
|
||||
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
|
||||
@@ -258,11 +256,8 @@ public class TaxiModel {
|
||||
private void releaseListeners() {
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
// 注销到达起始站围栏监听
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getRegisterCenterApi()
|
||||
.unregisterCarLocationChangedListener(TAG, mCarLocationChangedListener2);
|
||||
// 注销地图监听
|
||||
CallerMapLocationListenerManager.INSTANCE.removeListener(TAG,false);
|
||||
|
||||
OCHSocketMessageManager.INSTANCE.releaseSocketMessageListener(OCHSocketMessageManager.INSTANCE.getMsgMonitorType());
|
||||
|
||||
@@ -993,7 +988,7 @@ public class TaxiModel {
|
||||
}
|
||||
|
||||
//根据围栏判断,是否到达起点
|
||||
private void judgeStartStation(Location location) {
|
||||
private void judgeStartStation(MogoLocation location) {
|
||||
if (mCurrentOCHOrder == null || mCurrentOCHOrder.startSiteGcjPoint == null
|
||||
|| mCurrentOCHOrder.startSiteGcjPoint.size() < 2) {
|
||||
return;
|
||||
@@ -1050,10 +1045,9 @@ public class TaxiModel {
|
||||
};
|
||||
|
||||
// 自车定位
|
||||
private final IMogoCarLocationChangedListener2 mCarLocationChangedListener2 = new IMogoCarLocationChangedListener2() {
|
||||
|
||||
private final IMoGoMapLocationListener mMapLocationLIstener = new IMoGoMapLocationListener() {
|
||||
@Override
|
||||
public void onCarLocationChanged2(Location location) {
|
||||
public void onLocationChanged(@Nullable MogoLocation location, int from, boolean isGps) {
|
||||
//位置变化时,通过围栏判断是否到达x点
|
||||
if (location != null && checkCurrentOCHOrder()) {
|
||||
if (getCurOrderStatus() == TaxiOrderStatusEnum.OnTheWayToStart) {
|
||||
@@ -1074,7 +1068,7 @@ public class TaxiModel {
|
||||
}
|
||||
};
|
||||
|
||||
private void judgeEndStation(Location location) {
|
||||
private void judgeEndStation(MogoLocation location) {
|
||||
if (mCurrentOCHOrder == null || mCurrentOCHOrder.endSiteGcjPoint == null
|
||||
|| mCurrentOCHOrder.endSiteGcjPoint.size() < 2) {
|
||||
return;
|
||||
@@ -1376,14 +1370,14 @@ public class TaxiModel {
|
||||
return;
|
||||
}
|
||||
if (mRoutePoints.size() > 0 && mLocation != null){
|
||||
Map<Integer,List<Location>> lastPointsMap = CoordinateCalculateRouteUtil
|
||||
Map<Integer,List<MogoLocation>> lastPointsMap = CoordinateCalculateRouteUtil
|
||||
.getRemainPointListByCompareNew(mPreRouteIndex,mRoutePoints, mLocation);
|
||||
|
||||
for (int index: lastPointsMap.keySet()) {
|
||||
mPreRouteIndex = index;
|
||||
break;
|
||||
}
|
||||
for (List<Location> lastPoints: lastPointsMap.values()){
|
||||
for (List<MogoLocation> lastPoints: lastPointsMap.values()){
|
||||
float lastSumLength = 0;
|
||||
if (lastPoints.size() == 1) { //只是最后一个点,计算当前位置和最后一个点的距离
|
||||
lastSumLength = CoordinateUtils.calculateLineDistance(
|
||||
@@ -1437,7 +1431,7 @@ public class TaxiModel {
|
||||
public void onSuccess(QueryOrderRouteResp data) {
|
||||
if (data != null && data.data != null && mRoutePoints.size() == 0) {
|
||||
mRoutePoints.clear();
|
||||
List<Location> routePoints = CoordinateCalculateRouteUtil
|
||||
List<MogoLocation> routePoints = CoordinateCalculateRouteUtil
|
||||
.coordinateConverterLatlngToLocation(data.data);
|
||||
mRoutePoints.addAll(routePoints);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
@@ -313,7 +314,7 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(Location location) {
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
if (null != location){
|
||||
runOnUIThread(() -> {
|
||||
mView.updateSpeedView(location.getSpeed());
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.mogo.cloud.passport.IMoGoTokenCallback
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.constants.HostConst
|
||||
import com.mogo.commons.constants.SharedPrefsConstants
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.commons.device.Devices
|
||||
@@ -204,9 +205,9 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
|
||||
override fun onTokenGot(token: String, sn: String) {
|
||||
clientConfig.token = token
|
||||
// 由于存在token过期问题,在更新后会回调至此处,增加二次判定
|
||||
if(!gotToken){
|
||||
CallerLogger.d(SceneConstant.M_MAIN + TAG, "onTokenGot ")
|
||||
CallerCloudListenerManager.invokeCloudTokenGot(token)
|
||||
if (!gotToken) {
|
||||
CallerLogger.d(SceneConstant.M_MAIN + TAG, "onTokenGot token : $token , sn :$sn")
|
||||
CallerCloudListenerManager.invokeCloudTokenGot(token, sn)
|
||||
// 异步初始化NetConfig
|
||||
asyncInit()
|
||||
// HttpDns ttl回调 --- socketTTL
|
||||
@@ -272,7 +273,10 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
|
||||
HttpDnsConst.HTTP_DNS_ADDRESS_TYPE_HTTP
|
||||
) ?: return
|
||||
if (dnsCacheIp != cacheIp) {
|
||||
CallerLogger.d(SceneConstant.M_MAIN + TAG, "获取缓存Dns IP : $dnsCacheIp , 原缓存 IP : $cacheIp")
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_MAIN + TAG,
|
||||
"获取缓存Dns IP : $dnsCacheIp , 原缓存 IP : $cacheIp"
|
||||
)
|
||||
startSocketService()
|
||||
cacheIp = dnsCacheIp
|
||||
}
|
||||
@@ -354,7 +358,10 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
override fun onError(code: String, msg: String?) {
|
||||
CallerLogger.d(SceneConstant.M_MAIN + TAG, "socket-onError code : $code , msg : $msg")
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_MAIN + TAG,
|
||||
"socket-onError code : $code , msg : $msg"
|
||||
)
|
||||
}
|
||||
})
|
||||
// 开启Socket长链服务
|
||||
|
||||
@@ -204,7 +204,6 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
autopilotStatusInfo.camera = autopilotState.camera
|
||||
autopilotStatusInfo.rtk = autopilotState.rtk
|
||||
autopilotStatusInfo.radar = autopilotState.radar
|
||||
autopilotStatusInfo.speed = autopilotState.speed.toFloat()
|
||||
autopilotStatusInfo.version = AdasManager.getInstance().adasVersion
|
||||
if (autopilotStatusInfo.connectIP == null) {
|
||||
autopilotStatusInfo.connectIP = AdasManager.getInstance().ipcConnectedIp
|
||||
@@ -214,7 +213,6 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
}
|
||||
AdasManager.getInstance().carConfig?.let {
|
||||
autopilotStatusInfo.dockVersion = it.dockVersion
|
||||
AppConfigInfo.dockerVersion = it.dockVersion
|
||||
}
|
||||
CallerLogger.d("Upgrade", "origin = ${autopilotStatusInfo.connectStatus} -----now = ${AppConfigInfo.isConnectAutopilot} ")
|
||||
AppConfigInfo.isConnectAutopilot = autopilotStatusInfo.connectStatus
|
||||
@@ -318,10 +316,13 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
header: MessagePad.Header,
|
||||
carConfigResp: MessagePad.CarConfigResp?
|
||||
) {
|
||||
if (/*HdMapBuildConfig.isMapLoaded &&*/ carConfigResp != null) {
|
||||
if (carConfigResp != null) {
|
||||
//todo emArrow startUp时确认数据完整性
|
||||
AppConfigInfo.dockerVersion = carConfigResp.dockVersion
|
||||
AppConfigInfo.plateNumber = carConfigResp.plateNumber//车牌号
|
||||
AppConfigInfo.iPCMacAddress = carConfigResp.macAddress//工控机MAC地址
|
||||
AppConfigInfo.protocolVersionNumber = carConfigResp.protocolVersionValue//工控机协议版本
|
||||
AppConfigInfo.isConnectAutopilot = true
|
||||
invokeAutopilotCarConfigData(carConfigResp)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
package com.mogo.eagle.core.function.autopilot.adapter
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.debug.DebugConfig.*
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.cloud.IMoGoCloudListener
|
||||
import com.mogo.eagle.core.function.autopilot.network.AdasServiceModel
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
|
||||
@@ -22,9 +19,6 @@ import com.zhidao.support.adas.high.common.Constants
|
||||
import com.zhidao.support.adas.high.common.Constants.ENVIRONMENT.*
|
||||
import com.zhidao.support.adas.high.common.Constants.TERMINAL_ROLE.DRIVER
|
||||
import com.zhidao.support.adas.high.common.Constants.TERMINAL_ROLE.PASSENGER
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import java.util.*
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
|
||||
/**
|
||||
* ADAS-SDK与工控机连接状态回调
|
||||
@@ -33,18 +27,8 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
|
||||
IMoGoAutopilotStatusListener, IMoGoCloudListener {
|
||||
private val TAG = "ConnectStatus"
|
||||
|
||||
//自动驾驶状态
|
||||
private var mCurrentAutopilotStatus = -1
|
||||
|
||||
//自动驾驶车速度
|
||||
private var mCurrentAutopilotSpeed = 0f
|
||||
|
||||
private var connectStatus = false
|
||||
|
||||
private val hasUploadTaskLaunched by lazy { AtomicBoolean(false) }
|
||||
|
||||
private val timer = Timer()
|
||||
|
||||
init {
|
||||
CallerCloudListenerManager.registerCloudListener(TAG, this)
|
||||
}
|
||||
@@ -65,8 +49,6 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
|
||||
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectStatus = true
|
||||
// 同步SN给工控机
|
||||
syncBasicInfoToAutopilot()
|
||||
// 开启轮询上传自动驾驶状态
|
||||
updateDriveStatusTask()
|
||||
//每次工控机连接成功后,需同步当前设置的美化模式状态
|
||||
CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode)
|
||||
//当连接状态是关闭美化模式时,同步给工控机
|
||||
@@ -89,8 +71,6 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
|
||||
AdasManager.getInstance().ipcConnectedPort
|
||||
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectStatus = false
|
||||
//与工控机断开连接,需要重置自动驾驶状态(包括上传至云平台缓存信息),等待连接成功后同步状态信息
|
||||
mCurrentAutopilotStatus = 0
|
||||
mCurrentAutopilotSpeed = 0.0f
|
||||
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state = 0
|
||||
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().pilotmode = 0
|
||||
} else if (ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.CONNECTING) {
|
||||
@@ -117,21 +97,6 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
|
||||
syncBasicInfoToAutopilot()
|
||||
}
|
||||
|
||||
override fun onAutopilotArriveAtStation(arrivalNotification: MessagePad.ArrivalNotification?) {
|
||||
if (arrivalNotification != null && arrivalNotification.endLocation != null) {
|
||||
val lon = arrivalNotification.endLocation.longitude
|
||||
val lat = arrivalNotification.endLocation.latitude
|
||||
AdasServiceModel.getInstance().reportSite(lon, lat)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
|
||||
val state = autoPilotStatusInfo.state
|
||||
val speed = autoPilotStatusInfo.speed
|
||||
mCurrentAutopilotStatus = state
|
||||
mCurrentAutopilotSpeed = speed
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步SN信息给工控机
|
||||
*/
|
||||
@@ -174,24 +139,7 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传自动驾驶状态任务
|
||||
*/
|
||||
@SuppressLint("CheckResult")
|
||||
private fun updateDriveStatusTask() {
|
||||
if (hasUploadTaskLaunched.compareAndSet(false, true)) {
|
||||
timer.schedule(object : TimerTask() {
|
||||
override fun run() {
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "updateDriveStatusTask")
|
||||
AdasServiceModel.getInstance()
|
||||
.updateDriveStatus(mCurrentAutopilotStatus, mCurrentAutopilotSpeed)
|
||||
}
|
||||
}, 0, 5000)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun tokenGot(sn: String) {
|
||||
override fun tokenGot(token: String, sn: String) {
|
||||
syncBasicInfoToAutopilot(sn)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
package com.mogo.eagle.core.function.autopilot.entity;
|
||||
|
||||
/**
|
||||
* Created by SuYong on 2021/5/28 16:12
|
||||
*/
|
||||
public class AutonomousDriveStatusBean {
|
||||
|
||||
private String sn;
|
||||
private int status;
|
||||
private float vehicleSpeed;
|
||||
|
||||
public AutonomousDriveStatusBean(String sn, int status, float vehicleSpeed) {
|
||||
this.sn = sn;
|
||||
this.status = status;
|
||||
this.vehicleSpeed = vehicleSpeed;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public float getVehicleSpeed() {
|
||||
return vehicleSpeed;
|
||||
}
|
||||
|
||||
public void setVehicleSpeed(float vehicleSpeed) {
|
||||
this.vehicleSpeed = vehicleSpeed;
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.mogo.eagle.core.function.autopilot.entity;
|
||||
|
||||
/**
|
||||
* Created by SuYong on 2021/5/31 16:24
|
||||
*/
|
||||
public class ReportSiteBean {
|
||||
private String sn;
|
||||
private double lon;
|
||||
private double lat;
|
||||
|
||||
public ReportSiteBean(String sn, double lon, double lat) {
|
||||
this.sn = sn;
|
||||
this.lon = lon;
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
package com.mogo.eagle.core.function.autopilot.network;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.context.ContextHolderUtil;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.eagle.core.function.autopilot.entity.AutonomousDriveStatusBean;
|
||||
import com.mogo.eagle.core.function.autopilot.entity.ReportSiteBean;
|
||||
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.eagle.core.data.constants.HostConst;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
/**
|
||||
* 将自动驾驶状态及站点信息上传给云平台,云平台会根据此数据做路线的绘制
|
||||
*
|
||||
* @author dongghongyu
|
||||
*/
|
||||
public class AdasServiceModel {
|
||||
|
||||
private static final String TAG = "AdasServiceModel";
|
||||
private static volatile AdasServiceModel instance;
|
||||
private static final byte[] obj = new byte[0];
|
||||
|
||||
private final IAdasApiService mAdasApiService;
|
||||
|
||||
private AdasServiceModel() {
|
||||
this.mAdasApiService = MoGoRetrofitFactory.getInstance(HostConst.DATA_SERVICE_HOST).create(IAdasApiService.class);
|
||||
}
|
||||
|
||||
public static AdasServiceModel getInstance() {
|
||||
if (instance == null) {
|
||||
synchronized (obj) {
|
||||
if (instance == null) {
|
||||
instance = new AdasServiceModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void updateDriveStatus(int autoPilotStatus, float autoPilotSpeed) {
|
||||
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
AutonomousDriveStatusBean request = new AutonomousDriveStatusBean(sn, autoPilotStatus, autoPilotSpeed);
|
||||
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request));
|
||||
mAdasApiService.updateAutonomousDriveStatus(requestBody).
|
||||
subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new SubscribeImpl<BaseData>(RequestOptions.create(ContextHolderUtil.getContext())) {
|
||||
@Override
|
||||
public void onError(String message, int code) {
|
||||
super.onError(message, code);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
super.onError(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
super.onSuccess(o);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void reportSite(double lon, double lat) {
|
||||
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
ReportSiteBean reportSiteBean = new ReportSiteBean(sn, lon, lat);
|
||||
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(reportSiteBean));
|
||||
mAdasApiService.updateReportSite(requestBody).
|
||||
subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new SubscribeImpl<BaseData>(RequestOptions.create(ContextHolderUtil.getContext())) {
|
||||
@Override
|
||||
public void onError(String message, int code) {
|
||||
super.onError(message, code);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
super.onError(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
super.onSuccess(o);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.mogo.eagle.core.function.autopilot.network;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.RequestBody;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.Headers;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface IAdasApiService {
|
||||
|
||||
/**
|
||||
* 上传自动驾驶状态接口
|
||||
* @param requestBody
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-Type:application/json;charset=UTF-8"})
|
||||
@POST("/dataService/autonomousDrive/updateAutonomousDriveStatus")
|
||||
Observable<BaseData> updateAutonomousDriveStatus(@Body RequestBody requestBody);
|
||||
|
||||
/**
|
||||
* 站点上报 用于网约车业务 云平台绘制路线使用
|
||||
* @param requestBody
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-Type:application/json;charset=UTF-8"})
|
||||
@POST("/dataService/autonomousDrive/reportSite")
|
||||
Observable<BaseData> updateReportSite(@Body RequestBody requestBody);
|
||||
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.mogo.eagle.core.function
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
|
||||
/**
|
||||
* cmdb 域名
|
||||
*/
|
||||
class BindHostConst {
|
||||
|
||||
companion object {
|
||||
private const val UPGRADE_APP_HOST_DEV = "https://eagle-qa.zhidaozhixing.com/"
|
||||
private const val UPGRADE_APP_HOST = "http://eagle-mis.zhidaozhixing.com/"
|
||||
|
||||
@JvmStatic
|
||||
fun getBaseUrl(): String {
|
||||
return when (DebugConfig.getNetMode()) {
|
||||
DebugConfig.NET_MODE_DEV -> UPGRADE_APP_HOST_DEV
|
||||
DebugConfig.NET_MODE_QA -> UPGRADE_APP_HOST_DEV
|
||||
DebugConfig.NET_MODE_DEMO -> UPGRADE_APP_HOST
|
||||
DebugConfig.NET_MODE_RELEASE -> UPGRADE_APP_HOST
|
||||
else -> UPGRADE_APP_HOST
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,8 +5,8 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BIN
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.constants.HostConst;
|
||||
import com.mogo.eagle.core.data.bindingcar.UpgradeAppInfo;
|
||||
import com.mogo.eagle.core.function.BindHostConst;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
@@ -33,7 +33,7 @@ public class UpgradeAppNetWorkManager {
|
||||
|
||||
|
||||
private UpgradeAppNetWorkManager() {
|
||||
mUpgradeApiService = MoGoRetrofitFactory.getInstance(BindHostConst.getBaseUrl())
|
||||
mUpgradeApiService = MoGoRetrofitFactory.getInstance(HostConst.getHost())
|
||||
.create(UpgradeApiService.class);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@ package com.mogo.eagle.core.function.bindingcar.network;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.commons.constants.HostConst;
|
||||
import com.mogo.commons.constants.SharedPrefsConstants;
|
||||
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.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory;
|
||||
@@ -35,7 +35,7 @@ public class BindingcarNetWorkManager {
|
||||
private static final String TAG = "BindingcarNetManager";
|
||||
|
||||
private BindingcarNetWorkManager() {
|
||||
mBindingcarApiService = MoGoRetrofitFactory.getInstance(BindHostConst.getBaseUrl())
|
||||
mBindingcarApiService = MoGoRetrofitFactory.getInstance(HostConst.getHost())
|
||||
.create(BindingcarApiService.class);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.eagle.core.function.check.net;
|
||||
|
||||
import com.mogo.commons.constants.HostConst;
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory;
|
||||
import com.mogo.eagle.core.data.constants.HostConst;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
|
||||
@@ -51,41 +51,52 @@ class IPCReportManager : IMoGoAutopilotStatusListener {
|
||||
*/
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
|
||||
guardianInfo?.let{
|
||||
//Error 弹窗并有提示音
|
||||
if(it.resultList.contains(RESULT_AUTOPILOT_DISABLE)
|
||||
|| it.resultList.contains(RESULT_AUTOPILOT_SYSTEM_UNSTARTED)
|
||||
|| it.resultList.contains(RESULT_REMOTEPILOT_DISABLE)){
|
||||
if(ipcErrorReportList.size>19){
|
||||
ipcErrorReportList.removeLast()
|
||||
}
|
||||
|| it.resultList.contains(RESULT_REMOTEPILOT_DISABLE)
|
||||
|| it.resultList.contains(RESULT_AUTOPILOT_INFERIOR)
|
||||
|| it.resultList.contains(RESULT_SHOW_WARNING)
|
||||
|| it.resultList.contains(RESULT_REMOTEPILOT_INFERIOR)){
|
||||
val reportEntity = ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()),
|
||||
it.src,it.level,it.msg,it.code,it.resultList,it.actionsList)
|
||||
CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.REPORT, reportEntity))
|
||||
ipcErrorReportList.add(0, reportEntity)
|
||||
//当前不处于美化模式时,展示监控节点上报
|
||||
if(!FunctionBuildConfig.isDemoMode){
|
||||
if(FunctionBuildConfig.isReportWarning){
|
||||
CallerHmiManager.showIPCReportWindow(ipcErrorReportList,ipcWarningReportList,1)
|
||||
}
|
||||
}
|
||||
}
|
||||
//Warning 不弹窗也不会有提示音
|
||||
else if(it.resultList.contains(RESULT_AUTOPILOT_INFERIOR)
|
||||
|| it.resultList.contains(RESULT_SHOW_WARNING)
|
||||
|| it.resultList.contains(RESULT_REMOTEPILOT_INFERIOR)){
|
||||
if(ipcWarningReportList.size>19){
|
||||
ipcWarningReportList.removeLast()
|
||||
}
|
||||
ipcWarningReportList.add(0,
|
||||
ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()),
|
||||
it.src,it.level,it.msg,it.code,it.resultList,it.actionsList))
|
||||
//当前不处于美化模式时,展示监控节点上报
|
||||
if(!FunctionBuildConfig.isDemoMode){
|
||||
if(FunctionBuildConfig.isReportWarning){
|
||||
CallerHmiManager.showIPCReportWindow(ipcErrorReportList,ipcWarningReportList,2)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// //Error 弹窗并有提示音
|
||||
// if(it.resultList.contains(RESULT_AUTOPILOT_DISABLE)
|
||||
// || it.resultList.contains(RESULT_AUTOPILOT_SYSTEM_UNSTARTED)
|
||||
// || it.resultList.contains(RESULT_REMOTEPILOT_DISABLE)){
|
||||
// if(ipcErrorReportList.size>19){
|
||||
// ipcErrorReportList.removeLast()
|
||||
// }
|
||||
// val reportEntity = ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()),
|
||||
// it.src,it.level,it.msg,it.code,it.resultList,it.actionsList)
|
||||
//// CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.REPORT, reportEntity))
|
||||
// ipcErrorReportList.add(0, reportEntity)
|
||||
// //当前不处于美化模式时,展示监控节点上报
|
||||
// if(!FunctionBuildConfig.isDemoMode){
|
||||
// if(FunctionBuildConfig.isReportWarning){
|
||||
// CallerHmiManager.showIPCReportWindow(ipcErrorReportList,ipcWarningReportList,1)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// //Warning 不弹窗也不会有提示音
|
||||
// else if(it.resultList.contains(RESULT_AUTOPILOT_INFERIOR)
|
||||
// || it.resultList.contains(RESULT_SHOW_WARNING)
|
||||
// || it.resultList.contains(RESULT_REMOTEPILOT_INFERIOR)){
|
||||
// if(ipcWarningReportList.size>19){
|
||||
// ipcWarningReportList.removeLast()
|
||||
// }
|
||||
// ipcWarningReportList.add(0,
|
||||
// ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()),
|
||||
// it.src,it.level,it.msg,it.code,it.resultList,it.actionsList))
|
||||
// //当前不处于美化模式时,展示监控节点上报
|
||||
// if(!FunctionBuildConfig.isDemoMode){
|
||||
// if(FunctionBuildConfig.isReportWarning){
|
||||
// CallerHmiManager.showIPCReportWindow(ipcErrorReportList,ipcWarningReportList,2)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainLogParam
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneModule
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneTAG
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.function.api.devatools.IDevaToolsProvider
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseManager
|
||||
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigCenter.Companion.bizConfigCenter
|
||||
@@ -18,6 +19,8 @@ import com.zhjt.mogo_core_function_devatools.monitor.MonitorManager
|
||||
import com.zhjt.mogo_core_function_devatools.scene.SceneManager.Companion.sceneManager
|
||||
import com.zhjt.mogo_core_function_devatools.status.*
|
||||
import com.zhjt.mogo_core_function_devatools.trace.TraceManager.Companion.traceManager
|
||||
import com.zhjt.mogo_core_function_devatools.tts.TtsManager
|
||||
import com.zhjt.mogo_core_function_devatools.tts.TtsManager.Companion.ttsManager
|
||||
import com.zhjt.mogo_core_function_devatools.upgrade.UpgradeManager.Companion.upgradeManager
|
||||
import record_cache.RecordPanelOuterClass
|
||||
|
||||
@@ -35,6 +38,7 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
}
|
||||
|
||||
override fun initBiz() {
|
||||
ttsManager.initTts(mContext!!)
|
||||
traceManager.init(mContext!!)
|
||||
bizConfigCenter.init(mContext!!)
|
||||
FuncConfigImpl.init()
|
||||
@@ -94,8 +98,8 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
BadCaseManager.initAiCollect(view)
|
||||
}
|
||||
|
||||
override fun onReceiveBadCaseRecord(record: RecordPanelOuterClass.RecordPanel,activity: Activity) {
|
||||
BadCaseManager.onReceiveBadCaseRecord(record,activity)
|
||||
override fun onReceiveBadCaseRecord(msgBoxBean: MsgBoxBean,activity: Activity,countdown: Boolean) {
|
||||
BadCaseManager.onReceiveBadCaseRecord(msgBoxBean, activity,countdown)
|
||||
}
|
||||
|
||||
override fun showFeedbackWindow(ctx: Context) {
|
||||
|
||||
@@ -14,6 +14,8 @@ import androidx.lifecycle.LifecycleEventObserver
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.RecordBagMsg
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager
|
||||
import com.mogo.eagle.core.utilcode.kotlin.PX
|
||||
import com.mogo.eagle.core.utilcode.kotlin.lifecycleOwner
|
||||
@@ -23,10 +25,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
|
||||
import com.mogo.eagle.core.utilcode.reminder.Reminder
|
||||
import com.mogo.eagle.core.utilcode.reminder.api.IReminder
|
||||
import com.mogo.eagle.core.utilcode.reminder.api.IReminder.IGlobalStateChangeListener
|
||||
import com.mogo.eagle.core.utilcode.util.ClickUtils
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.biz.*
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.db.entity.AutoPilotRecord
|
||||
@@ -168,19 +167,29 @@ internal object BadCaseManager : LifecycleEventObserver {
|
||||
}
|
||||
}
|
||||
|
||||
fun onReceiveBadCaseRecord(record: RecordPanelOuterClass.RecordPanel,activity: Activity) {
|
||||
fun onReceiveBadCaseRecord(msgBoxBean: MsgBoxBean,activity: Activity,countdown: Boolean) {
|
||||
CallerLogger.d("$M_DEVA$TAG", "收到录包结果回调${record}")
|
||||
CallerLogger.d("$M_DEVA$TAG", "开始创建被动录包弹窗,window num=${BadCaseConfig.windowNum}")
|
||||
CallerLogger.d("$M_DEVA$TAG","key=${record.key};filename${record.filename}")
|
||||
ThreadUtils.runOnUiThread {
|
||||
val passiveBadCaseWindow = PassiveBadCaseWindow(activity)
|
||||
passiveBadCaseWindow.setRecord(record.key.toString(),record.filename)
|
||||
passiveBadCaseWindow.setRecord(msgBoxBean)
|
||||
passiveBadCaseWindow.setClickListener(object: PassiveBadCaseWindow.ClickListener{
|
||||
override fun closeWindow() {
|
||||
passiveBadCaseWindow.hideFloatWindow()
|
||||
}
|
||||
})
|
||||
passiveBadCaseWindow.showFloatWindow()
|
||||
if(countdown){
|
||||
val countDownTimer = object: CountDownTimer(10000,1000){
|
||||
override fun onTick(p0: Long) {
|
||||
}
|
||||
|
||||
override fun onFinish() {
|
||||
passiveBadCaseWindow.hideFloatWindow()
|
||||
}
|
||||
}
|
||||
countDownTimer.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,8 +16,11 @@ import android.widget.TextView
|
||||
import com.google.android.flexbox.FlexboxLayout
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.RecordBagMsg
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
@@ -59,6 +62,7 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
private var uploadReason: String = String() //上报原因,标签
|
||||
private var recordKey: String?=null //录制bag包key
|
||||
private var recordFileName: String?=null //录制文件包名
|
||||
private var boxBean: MsgBoxBean ?= null
|
||||
private var longitude: Double?=null
|
||||
private var latitude: Double?=null
|
||||
|
||||
@@ -132,11 +136,15 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
}else{
|
||||
uploadAudio()
|
||||
}
|
||||
//删除记录
|
||||
CallerMsgBoxManager.removeRecordInfo(mActivity, boxBean!!, recordKey!!)
|
||||
}
|
||||
|
||||
tvPassiveCancel.setOnClickListener {
|
||||
BadCaseConfig.windowNum--
|
||||
clickListener?.closeWindow()
|
||||
//删除记录
|
||||
CallerMsgBoxManager.removeRecordInfo(mActivity, boxBean!!, recordKey!!)
|
||||
}
|
||||
|
||||
mWindowParams = WindowManager.LayoutParams()
|
||||
@@ -307,7 +315,7 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
SizeUtils.dp2px(10f),
|
||||
SizeUtils.dp2px(10f),
|
||||
SizeUtils.dp2px(10f))
|
||||
checkBox.textSize = AutoSizeUtils.dp2px(mActivity,34f).toFloat()
|
||||
checkBox.textSize = AutoSizeUtils.dp2px(mActivity,18f).toFloat()
|
||||
checkBox.text = it.reason
|
||||
checkBox.isChecked = it.isChecked
|
||||
checkBox.setOnCheckedChangeListener(this@PassiveBadCaseWindow)
|
||||
@@ -343,9 +351,11 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
if (mFloatLayout.parent != null) mWindowManager!!.removeView(mFloatLayout)
|
||||
}
|
||||
|
||||
fun setRecord(key:String,fileName:String){
|
||||
recordKey = key
|
||||
recordFileName = fileName
|
||||
fun setRecord(msgBoxBean: MsgBoxBean){
|
||||
boxBean = msgBoxBean
|
||||
val recordBagMsg = (msgBoxBean.bean as RecordBagMsg)
|
||||
recordKey = recordBagMsg.key.toString()
|
||||
recordFileName = recordBagMsg.fileName
|
||||
}
|
||||
|
||||
fun setClickListener(clickListener: ClickListener) {
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.zhjt.mogo_core_function_devatools.funcconfig.network
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
|
||||
class FuncConfigHost {
|
||||
|
||||
companion object{
|
||||
private const val HOST_DEV = "https://eagle-qa.zhidaozhixing.com"
|
||||
private const val HOST_RELEASE = "https://eagle.zhidaozhixing.com"
|
||||
|
||||
fun get(): String{
|
||||
return when (DebugConfig.getNetMode()) {
|
||||
DebugConfig.NET_MODE_DEV -> HOST_DEV
|
||||
DebugConfig.NET_MODE_QA -> HOST_DEV
|
||||
DebugConfig.NET_MODE_DEMO -> HOST_RELEASE
|
||||
DebugConfig.NET_MODE_RELEASE -> HOST_RELEASE
|
||||
else -> HOST_RELEASE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.zhjt.mogo_core_function_devatools.funcconfig.network
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.constants.HostConst
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.eagle.core.network.apiCall
|
||||
@@ -11,7 +12,7 @@ import com.zhjt.service_biz.FuncConfig
|
||||
|
||||
class FuncConfigNetWorkModel {
|
||||
|
||||
private fun getNetWorkApi(baseUrl: String = FuncConfigHost.get()): FuncConfigApiService {
|
||||
private fun getNetWorkApi(baseUrl: String = HostConst.getHost()): FuncConfigApiService {
|
||||
return MoGoRetrofitFactory.getInstanceNoCallAdapter(baseUrl)
|
||||
.create(FuncConfigApiService::class.java)
|
||||
}
|
||||
@@ -34,7 +35,6 @@ class FuncConfigNetWorkModel {
|
||||
if (error == null) {
|
||||
error = onError
|
||||
}
|
||||
//todo test
|
||||
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
|
||||
map["mac"] = DeviceUtils.getMacAddress()
|
||||
map["channelVersion"] = FuncConfigConst.getChannelCode()
|
||||
|
||||
@@ -32,7 +32,7 @@ class TraceManager : IMoGoCloudListener {
|
||||
|
||||
@Synchronized
|
||||
fun init(context: Context) {
|
||||
if(init){
|
||||
if (init) {
|
||||
return
|
||||
}
|
||||
// 初始化Trace抓取服务
|
||||
@@ -101,7 +101,7 @@ class TraceManager : IMoGoCloudListener {
|
||||
init = true
|
||||
}
|
||||
|
||||
override fun tokenGot(sn: String) {
|
||||
override fun tokenGot(token: String, sn: String) {
|
||||
FileWriteManager.getInstance().updateDeviceId(sn)
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.zhjt.mogo_core_function_devatools.tts
|
||||
|
||||
import android.content.Context
|
||||
import com.elegant.utils.storage.SharedPrefsMgr
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.eagle.core.function.api.cloud.IMoGoCloudListener
|
||||
import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.zhjt.mogo_core_function_devatools.trace.TraceManager
|
||||
|
||||
class TtsManager : IMoGoCloudListener {
|
||||
|
||||
companion object {
|
||||
|
||||
const val TAG = "TtsManager"
|
||||
|
||||
val ttsManager by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
TtsManager()
|
||||
}
|
||||
}
|
||||
|
||||
fun initTts(context: Context) {
|
||||
val sn = SharedPrefsMgr.getInstance(context).getString("sn")
|
||||
if (sn.isNullOrEmpty()) {
|
||||
CallerCloudListenerManager.registerCloudListener(TraceManager.TAG, this)
|
||||
}
|
||||
AIAssist.getInstance(context)
|
||||
}
|
||||
|
||||
override fun tokenGot(token: String, sn: String) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
AIAssist.getInstance(AbsMogoApplication.getApp()).initTtsAgain(sn)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,10 @@ 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.eagle.core.data.constants.HostConst
|
||||
import com.zhjt.mogo_core_function_devatools.upgrade.network.HostConst.Companion.getBaseUrl
|
||||
|
||||
class UpgradeVersionNetWorkModel {
|
||||
|
||||
private fun getNetWorkApi(baseUrl: String = HostConst.CITY_HOST): UpgradeVersionApiService {
|
||||
private fun getNetWorkApi(baseUrl: String = HostConst.getBaseUrl()): UpgradeVersionApiService {
|
||||
return MoGoRetrofitFactory.getInstanceNoCallAdapter(baseUrl)
|
||||
.create(UpgradeVersionApiService::class.java)
|
||||
}
|
||||
@@ -22,7 +20,7 @@ class UpgradeVersionNetWorkModel {
|
||||
request<Response<Any?>> {
|
||||
loader {
|
||||
apiResponseCall {
|
||||
getNetWorkApi(getBaseUrl()).getUpgradeVersion(
|
||||
getNetWorkApi().getUpgradeVersion(
|
||||
versionName
|
||||
)
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.mogo_core_network
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
}else{
|
||||
|
||||
implementation project(":foudations:mogo-commons")
|
||||
implementation project(':modules:mogo-module-common')
|
||||
|
||||
implementation project(':core:mogo-core-data')
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.zhjt.dispatch.model;
|
||||
|
||||
import static com.mogo.commons.context.ContextHolderUtil.getContext;
|
||||
import static com.mogo.eagle.core.data.constants.HostConst.DATA_SERVICE_HOST;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.constants.HostConst;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatus;
|
||||
@@ -34,7 +34,7 @@ public class DispatchServiceModel {
|
||||
private final IDispatchAdasApiService mAdasApiService;
|
||||
|
||||
private DispatchServiceModel() {
|
||||
mAdasApiService = MoGoRetrofitFactory.getInstance(DATA_SERVICE_HOST).create(IDispatchAdasApiService.class);
|
||||
mAdasApiService = MoGoRetrofitFactory.getInstance(HostConst.DATA_SERVICE_HOST).create(IDispatchAdasApiService.class);
|
||||
}
|
||||
|
||||
public static DispatchServiceModel getInstance() {
|
||||
|
||||
@@ -9,10 +9,12 @@ import android.view.WindowManager;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.PermissionUtils;
|
||||
|
||||
/**
|
||||
* 浮在各种wm上面的dialog基类,调用了window.setType
|
||||
@@ -34,12 +36,16 @@ public class BaseFloatDialog extends Dialog {
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||
private void addFlag() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
|
||||
} else {
|
||||
getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
|
||||
if(PermissionUtils.isGrantedDrawOverlays()){
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
|
||||
} else {
|
||||
getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
|
||||
}
|
||||
}
|
||||
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
|
||||
| WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION
|
||||
| WindowManager.LayoutParams.FLAG_LOCAL_FOCUS_MODE);
|
||||
|
||||
@@ -83,6 +83,7 @@ class V2XWarningBroadcastReceiver : BroadcastReceiver() {
|
||||
V2XMsg(v2xType.toString(), alertContent, ttsContent)
|
||||
)
|
||||
)
|
||||
//预留调试入口
|
||||
CallerHmiManager.warningV2X(v2xType.toString(), alertContent, ttsContent,
|
||||
tag, null, true, 5000L)
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@ import com.mogo.eagle.core.function.hmi.ui.bindingcar.ToBindingCarDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.bindingcar.UpgradeAppDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.camera.CameraListView
|
||||
import com.mogo.eagle.core.function.hmi.ui.camera.RoadVideoDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxBubbleView
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeCheckDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeTrafficDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.DebugSettingView
|
||||
@@ -171,6 +172,8 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
private var reportListFloatWindow: ReportListFloatWindow? = null
|
||||
private var ipcReportWindow: IPCReportWindow? = null
|
||||
|
||||
private var passengerMsgBoxBubbleView: PassengerMsgBoxBubbleView ?= null
|
||||
|
||||
private var adUpgradeDialog: AdUpgradeDialog? = null
|
||||
|
||||
private var lastSpeakJob: Job? = null
|
||||
@@ -296,6 +299,36 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cbMsgBoxDriver.setOnCheckedChangeListener { _, isChecked ->
|
||||
if(isChecked){
|
||||
viewDriverMsgBoxList.visibility = View.VISIBLE
|
||||
viewDriverMsgBoxBubble.visibility = View.GONE
|
||||
}else{
|
||||
viewDriverMsgBoxList.visibility = View.GONE
|
||||
viewDriverMsgBoxBubble.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
cbMsgBoxPassenger.setOnCheckedChangeListener { _, isChecked ->
|
||||
if(isChecked){
|
||||
viewPassengerMsgBoxList.visibility = View.VISIBLE
|
||||
viewPassengerMsgBoxBubble.visibility = View.GONE
|
||||
}else{
|
||||
viewPassengerMsgBoxList.visibility = View.GONE
|
||||
viewPassengerMsgBoxBubble.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
cbMsgBoxDriver.visibility = View.VISIBLE
|
||||
viewDriverMsgBoxBubble.visibility = View.VISIBLE
|
||||
}
|
||||
if(AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
|
||||
cbMsgBoxPassenger.visibility = View.VISIBLE
|
||||
viewPassengerMsgBoxBubble.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
@@ -323,14 +356,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
|
||||
override fun onAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) {
|
||||
CallerLogger.d("$M_HMI$TAG", "recordKey=${recordPanel.key},stat=${recordPanel.stat}")
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.RECORD, RecordBagMsg(
|
||||
recordPanel.key, recordPanel.stat, recordPanel.id,
|
||||
recordPanel.type, recordPanel.filename, recordPanel.note
|
||||
)
|
||||
)
|
||||
)
|
||||
if (BadCaseConfig.recordKeyList.contains(recordPanel.key)) {
|
||||
if (recordPanel.stat == 100 || recordPanel.stat == 101) {
|
||||
//成功结束录制
|
||||
@@ -369,7 +394,14 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
if (!FunctionBuildConfig.isDemoMode && (recordPanel.stat == 100 || recordPanel.stat == 101) && recordPanel.type != 2) {
|
||||
//只在司机屏生效,乘客屏不生效
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
activity?.let { CallerDevaToolsManager.onReceiveBadCaseRecord(recordPanel, it) }
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.RECORD, RecordBagMsg(
|
||||
recordPanel.key, recordPanel.stat, recordPanel.id,
|
||||
recordPanel.type, recordPanel.filename, recordPanel.note
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
if (!FunctionBuildConfig.isDemoMode && recordPanel.type == 2 && (
|
||||
@@ -940,7 +972,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
SharedPrefsMgr.getInstance(it)
|
||||
.putLong("roadwork", System.currentTimeMillis() / 1000)
|
||||
}
|
||||
CallerAutoPilotManager.sendTripInfo(5, "", "", "", false);
|
||||
CallerAutoPilotManager.sendTripInfo(5, "", "", "", false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1554,7 +1586,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
EXIT_AUTOPILOT_FOR_LOCATION,
|
||||
EXIT_AUTOPILOT_FOR_CHASSIS,
|
||||
EXIT_AUTOPILOT_FOR_DISTANCE -> {
|
||||
showWarningV2X(
|
||||
warningV2X(
|
||||
EventTypeEnum.TAKE_OVER_EVENT.poiType,
|
||||
EventTypeEnum.TAKE_OVER_EVENT.content,
|
||||
EventTypeEnum.TAKE_OVER_EVENT.tts,
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.msgbox
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.LinearLayout
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.view.marginTop
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.MsgCategory
|
||||
import com.mogo.eagle.core.data.msgbox.OperationMsg
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.adapter.DriverMsgBoxBubbleAdapter
|
||||
import kotlinx.android.synthetic.main.layout_driver_msg_box_bubble.view.*
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 司机端消息盒子气泡视图
|
||||
* @since: 2022/11/25
|
||||
*/
|
||||
class DriverMsgBoxBubbleView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener {
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.layout_driver_msg_box_bubble, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
var driverMsgBoxBubbleAdapter: DriverMsgBoxBubbleAdapter ?=null
|
||||
|
||||
private val TAG = "DriverMsgBoxBubbleView"
|
||||
private val dataList :ArrayList<MsgBoxBean> = ArrayList()
|
||||
|
||||
private fun initView() {
|
||||
val linearLayoutManager = LinearLayoutManager(context)
|
||||
linearLayoutManager.orientation = LinearLayoutManager.VERTICAL
|
||||
linearLayoutManager.stackFromEnd = true
|
||||
linearLayoutManager.reverseLayout = true
|
||||
driverMsgBoxBubbleAdapter = DriverMsgBoxBubbleAdapter(context as Activity)
|
||||
rvBubbleList.adapter = driverMsgBoxBubbleAdapter
|
||||
rvBubbleList.layoutManager = linearLayoutManager
|
||||
}
|
||||
|
||||
|
||||
override fun onDataChanged(category: MsgCategory, msgBoxBean: MsgBoxBean) {
|
||||
if(category == MsgCategory.RECORD_BAG){
|
||||
//弹出被动录包弹窗
|
||||
CallerDevaToolsManager.onReceiveBadCaseRecord(msgBoxBean,context as Activity,true)
|
||||
}else{
|
||||
dataList.add(msgBoxBean)
|
||||
driverMsgBoxBubbleAdapter?.setData(dataList)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerMsgBoxListenerManager.addListener(TAG,this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerMsgBoxListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
// var i = 0
|
||||
//
|
||||
// fun setData(){
|
||||
// val one = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"测试"+i++))
|
||||
// dataList.add(one)
|
||||
// driverMsgBoxBubbleAdapter?.setData(dataList)
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.msgbox
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.OperationMsg
|
||||
import com.mogo.eagle.core.data.msgbox.RecordBagMsg
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.adapter.DriverMsgBoxListAdapter
|
||||
import kotlinx.android.synthetic.main.layout_driver_msg_box_list.view.*
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 司机端消息盒子打开列表视图
|
||||
* @since: 2022/11/25
|
||||
*/
|
||||
class DriverMsgBoxListView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr){
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.layout_driver_msg_box_list, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
val driverMsgBoxListAdapter= DriverMsgBoxListAdapter(context as Activity)
|
||||
rvMsgBoxList.adapter = driverMsgBoxListAdapter
|
||||
rvMsgBoxList.layoutManager = LinearLayoutManager(context)
|
||||
//获取通知消息列表
|
||||
val noticeList: List<MsgBoxBean>? = CallerMsgBoxManager.getCachedNotifyData()
|
||||
if(noticeList==null){
|
||||
rvMsgBoxList.visibility = View.GONE
|
||||
}else{
|
||||
driverMsgBoxListAdapter.setData(noticeList)
|
||||
rvMsgBoxList.visibility = View.VISIBLE
|
||||
rvMsgBoxList.scrollToPosition(0)
|
||||
}
|
||||
|
||||
|
||||
//通知
|
||||
tvMsgNotice.setOnClickListener {
|
||||
tvMsgNotice.setTextColor(resources.getColor(R.color.msg_box_title_color))
|
||||
tvMsgIpcReport.setTextColor(resources.getColor(R.color.color_FFFFFF))
|
||||
tvMsgBadCase.setTextColor(resources.getColor(R.color.color_FFFFFF))
|
||||
viewNoticeDivider.visibility = View.VISIBLE
|
||||
viewIpcReportDivider.visibility = View.GONE
|
||||
viewBadCaseDivider.visibility = View.GONE
|
||||
//获取通知消息列表
|
||||
val noticeList: List<MsgBoxBean>? = CallerMsgBoxManager.getCachedNotifyData()
|
||||
if(noticeList==null){
|
||||
rvMsgBoxList.visibility = View.GONE
|
||||
}else{
|
||||
driverMsgBoxListAdapter.setData(noticeList.reversed())
|
||||
rvMsgBoxList.visibility = View.VISIBLE
|
||||
rvMsgBoxList.scrollToPosition(0)
|
||||
}
|
||||
|
||||
// val nList: ArrayList<MsgBoxBean> = ArrayList()
|
||||
// val one = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"通知1",2))
|
||||
// val two = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"通知2",2))
|
||||
// val three = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"通知3",2))
|
||||
// val four = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"通知4",2))
|
||||
// val five = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"通知5",2))
|
||||
// val normalData = NoticeNormalData()
|
||||
// normalData.content = "测试数据"
|
||||
// val six = MsgBoxBean(MsgBoxType.NOTICE, normalData)
|
||||
//
|
||||
// nList.add(one)
|
||||
// nList.add(two)
|
||||
// nList.add(three)
|
||||
// nList.add(four)
|
||||
// nList.add(five)
|
||||
// nList.add(six)
|
||||
// driverMsgBoxListAdapter.setData(nList)
|
||||
}
|
||||
//车辆系统信息
|
||||
tvMsgIpcReport.setOnClickListener {
|
||||
tvMsgNotice.setTextColor(resources.getColor(R.color.color_FFFFFF))
|
||||
tvMsgIpcReport.setTextColor(resources.getColor(R.color.msg_box_title_color))
|
||||
tvMsgBadCase.setTextColor(resources.getColor(R.color.color_FFFFFF))
|
||||
viewNoticeDivider.visibility = View.GONE
|
||||
viewIpcReportDivider.visibility = View.VISIBLE
|
||||
viewBadCaseDivider.visibility = View.GONE
|
||||
|
||||
//获取车辆系统信息列表
|
||||
val ipcReportList: List<MsgBoxBean>? = CallerMsgBoxManager.getCachedSysInfoData()
|
||||
if(ipcReportList == null){
|
||||
rvMsgBoxList.visibility = View.GONE
|
||||
}else{
|
||||
driverMsgBoxListAdapter.setData(ipcReportList.reversed())
|
||||
rvMsgBoxList.visibility = View.VISIBLE
|
||||
rvMsgBoxList.scrollToPosition(0)
|
||||
}
|
||||
|
||||
// val ipcList: ArrayList<MsgBoxBean> = ArrayList()
|
||||
// val resultList:ArrayList<String> = ArrayList()
|
||||
// resultList.add("RESULT_AUTOPILOT_DISABLE")
|
||||
// val result:ArrayList<String> = ArrayList()
|
||||
// result.add("RESULT_AUTOPILOT_INFERIOR")
|
||||
// val one = ReportEntity(System.currentTimeMillis().toString(),"","","自动驾驶失败1","code",
|
||||
// resultList,resultList)
|
||||
// val beanOne = MsgBoxBean(MsgBoxType.REPORT,one)
|
||||
// beanOne.timestamp = System.currentTimeMillis()
|
||||
// val two = ReportEntity(System.currentTimeMillis().toString(),"","","自动驾驶失败2","code",
|
||||
// resultList,resultList)
|
||||
// val beanTwo = MsgBoxBean(MsgBoxType.REPORT,two)
|
||||
// beanTwo.timestamp = System.currentTimeMillis()
|
||||
// val three = ReportEntity(System.currentTimeMillis().toString(),"","","自动驾驶失败3","code",
|
||||
// resultList,resultList)
|
||||
// val beanThree = MsgBoxBean(MsgBoxType.REPORT,three)
|
||||
// beanThree.timestamp = System.currentTimeMillis()
|
||||
// val four = ReportEntity(System.currentTimeMillis().toString(),"","","自动驾驶失败4","code",
|
||||
// resultList,resultList)
|
||||
// val beanFour = MsgBoxBean(MsgBoxType.REPORT,four)
|
||||
// beanFour.timestamp = System.currentTimeMillis()
|
||||
// val five = ReportEntity(System.currentTimeMillis().toString(),"","","自动驾驶失败5","code",
|
||||
// result,result)
|
||||
// val beanFive = MsgBoxBean(MsgBoxType.REPORT,five)
|
||||
// beanFive.timestamp = System.currentTimeMillis()
|
||||
// ipcList.add(beanOne)
|
||||
// ipcList.add(beanTwo)
|
||||
// ipcList.add(beanThree)
|
||||
// ipcList.add(beanFour)
|
||||
// ipcList.add(beanFive)
|
||||
// driverMsgBoxListAdapter.setData(ipcList)
|
||||
}
|
||||
//录包
|
||||
tvMsgBadCase.setOnClickListener {
|
||||
tvMsgNotice.setTextColor(resources.getColor(R.color.color_FFFFFF))
|
||||
tvMsgIpcReport.setTextColor(resources.getColor(R.color.color_FFFFFF))
|
||||
tvMsgBadCase.setTextColor(resources.getColor(R.color.msg_box_title_color))
|
||||
viewNoticeDivider.visibility = View.GONE
|
||||
viewIpcReportDivider.visibility = View.GONE
|
||||
viewBadCaseDivider.visibility = View.VISIBLE
|
||||
|
||||
//获取录包信息列表
|
||||
val badCaseList: List<MsgBoxBean>? = CallerMsgBoxManager.getCachedRecordBagData()
|
||||
if(badCaseList == null){
|
||||
rvMsgBoxList.visibility = View.GONE
|
||||
}else{
|
||||
driverMsgBoxListAdapter.setData(badCaseList.reversed())
|
||||
rvMsgBoxList.visibility = View.VISIBLE
|
||||
rvMsgBoxList.scrollToPosition(0)
|
||||
}
|
||||
|
||||
// val list : ArrayList<MsgBoxBean> = ArrayList()
|
||||
// val one = MsgBoxBean(MsgBoxType.RECORD, RecordBagMsg(3457774,1,235,2,"",""))
|
||||
// one.timestamp = System.currentTimeMillis()
|
||||
// val two = MsgBoxBean(MsgBoxType.RECORD, RecordBagMsg(3457774,1,235,2,"",""))
|
||||
// two.timestamp = System.currentTimeMillis()
|
||||
// val three = MsgBoxBean(MsgBoxType.RECORD, RecordBagMsg(3457774,1,235,2,"",""))
|
||||
// three.timestamp = System.currentTimeMillis()
|
||||
// val four = MsgBoxBean(MsgBoxType.RECORD, RecordBagMsg(3457774,1,235,2,"",""))
|
||||
// four.timestamp = System.currentTimeMillis()
|
||||
// val five = MsgBoxBean(MsgBoxType.RECORD, RecordBagMsg(3457774,1,235,2,"",""))
|
||||
// five.timestamp = System.currentTimeMillis()
|
||||
//
|
||||
// list.add(one)
|
||||
// list.add(two)
|
||||
// list.add(three)
|
||||
// list.add(four)
|
||||
// list.add(five)
|
||||
// driverMsgBoxListAdapter.setData(list)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.msgbox
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.graphics.PixelFormat
|
||||
import android.util.AttributeSet
|
||||
import android.util.DisplayMetrics
|
||||
import android.view.*
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.MsgCategory
|
||||
import com.mogo.eagle.core.data.msgbox.OperationMsg
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.adapter.PassengerMsgBoxBubbleAdapter
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import kotlinx.android.synthetic.main.layout_passenger_msg_box_bubble.view.*
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 乘客端消息盒子气泡列表视图
|
||||
* @since: 2022/11/29
|
||||
*/
|
||||
class PassengerMsgBoxBubbleView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener {
|
||||
|
||||
private val TAG = "PassengerMsgBoxBubbleView"
|
||||
private val dataList :ArrayList<MsgBoxBean> = ArrayList()
|
||||
var passengerMsgBoxBubbleAdapter: PassengerMsgBoxBubbleAdapter ?= null
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.layout_passenger_msg_box_bubble, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView(){
|
||||
val linearLayoutManager = LinearLayoutManager(context)
|
||||
linearLayoutManager.orientation = LinearLayoutManager.VERTICAL
|
||||
linearLayoutManager.stackFromEnd = true
|
||||
linearLayoutManager.reverseLayout = true
|
||||
passengerMsgBoxBubbleAdapter = PassengerMsgBoxBubbleAdapter(context as Activity)
|
||||
rvPassengerBubbleList.adapter = passengerMsgBoxBubbleAdapter
|
||||
rvPassengerBubbleList.layoutManager = linearLayoutManager
|
||||
|
||||
// setData()
|
||||
}
|
||||
|
||||
override fun onDataChanged(category: MsgCategory, msgBoxList: MsgBoxBean) {
|
||||
if(category == MsgCategory.NOTICE){
|
||||
if(msgBoxList.type == MsgBoxType.NOTICE || msgBoxList.type == MsgBoxType.V2X
|
||||
|| msgBoxList.type == MsgBoxType.OBU){
|
||||
dataList.add(msgBoxList)
|
||||
passengerMsgBoxBubbleAdapter?.setData(dataList)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// fun setData(){
|
||||
// val list :ArrayList<MsgBoxBean> = ArrayList()
|
||||
// val one = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"测试"))
|
||||
// val two = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"测试"))
|
||||
// val three = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"测试"))
|
||||
// list.add(one)
|
||||
// list.add(two)
|
||||
// list.add(three)
|
||||
// passengerMsgBoxBubbleAdapter?.setData(list)
|
||||
// }
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerMsgBoxListenerManager.addListener(TAG,this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerMsgBoxListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.msgbox
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.adapter.PassengerMsgBoxListAdapter
|
||||
import com.mogo.eagle.core.utilcode.util.ResourceUtils.getDrawable
|
||||
import kotlinx.android.synthetic.main.layout_passenger_msg_box_list.view.*
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 乘客端消息盒子列表视图
|
||||
* @since: 2022/11/29
|
||||
*/
|
||||
class PassengerMsgBoxListView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr){
|
||||
|
||||
var passengerMsgBoxListAdapter: PassengerMsgBoxListAdapter ?= null
|
||||
|
||||
init{
|
||||
LayoutInflater.from(context).inflate(R.layout.layout_passenger_msg_box_list, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView(){
|
||||
val linearLayoutManager = LinearLayoutManager(context)
|
||||
linearLayoutManager.orientation = LinearLayoutManager.VERTICAL
|
||||
val divider = DividerItemDecoration(context, linearLayoutManager.orientation)
|
||||
getDrawable(R.drawable.rv_divider_line)?.let { divider.setDrawable(it) }
|
||||
passengerMsgBoxListAdapter = PassengerMsgBoxListAdapter(context as Activity)
|
||||
rvPassengerList.adapter = passengerMsgBoxListAdapter
|
||||
rvPassengerList.layoutManager = linearLayoutManager
|
||||
rvPassengerList.addItemDecoration(divider)
|
||||
//获取通知消息列表
|
||||
val noticeList: List<MsgBoxBean>? = CallerMsgBoxManager.getCachedNotifyData()
|
||||
noticeList?.let {
|
||||
passengerMsgBoxListAdapter?.setData(it.reversed())
|
||||
}
|
||||
|
||||
// setData()
|
||||
}
|
||||
|
||||
fun setData(){
|
||||
val list :ArrayList<MsgBoxBean> = ArrayList()
|
||||
val one = MsgBoxBean(MsgBoxType.V2X, V2XMsg("","ceshiyixa"))
|
||||
val two = MsgBoxBean(MsgBoxType.OPERATION, V2XMsg("","ceshiyixa1"))
|
||||
val three = MsgBoxBean(MsgBoxType.OPERATION, V2XMsg("","ceshiyixa2"))
|
||||
list.add(one)
|
||||
list.add(two)
|
||||
list.add(three)
|
||||
passengerMsgBoxListAdapter?.setData(list)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.msgbox.adapter
|
||||
|
||||
import android.app.Activity
|
||||
import android.os.CountDownTimer
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.OperationMsg
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
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.util.TimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 司机端消息盒子气泡视图RecyclerView适配器
|
||||
* @since: 2022/11/25
|
||||
*/
|
||||
class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.Adapter<RecyclerView.ViewHolder>(){
|
||||
|
||||
private var data: ArrayList<MsgBoxBean> ?= null
|
||||
|
||||
private val operation: Int = 1
|
||||
private val notice: Int = 2
|
||||
private val v2x: Int = 3
|
||||
private val report: Int = 4
|
||||
|
||||
var countDownTimer: CountDownTimer?=null
|
||||
|
||||
fun setData(data: ArrayList<MsgBoxBean>){
|
||||
this.data = data
|
||||
if(data.size>4){
|
||||
data.removeAt(0)
|
||||
}
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
|
||||
if(viewType == operation){
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_operation,parent,false)
|
||||
return BubbleOperationHolder(view)
|
||||
}else if(viewType == report){
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_report,parent,false)
|
||||
return BubbleReportHolder(view)
|
||||
}else if(viewType == notice){
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_notice,parent,false)
|
||||
return BubbleNoticeHolder(view)
|
||||
}else{
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_v2x,parent,false)
|
||||
return BubbleV2XHolder(view)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
if(holder is BubbleOperationHolder){
|
||||
data?.let {
|
||||
val operationMsg = it[position].bean as OperationMsg
|
||||
holder.tvBubbleOperationTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvBubbleOperationContent.text = operationMsg.content
|
||||
}
|
||||
}else if(holder is BubbleReportHolder){
|
||||
data?.let {
|
||||
val reportEntity = it[position].bean as ReportEntity
|
||||
holder.tvBubbleReportTime.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
|
||||
holder.tvBubbleReceiveTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
var resultStr = "类型:"
|
||||
for (result in reportEntity.resultList){
|
||||
resultStr = "${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}"
|
||||
}
|
||||
holder.tvBubbleReportType.text = resultStr
|
||||
}
|
||||
}else if(holder is BubbleNoticeHolder){
|
||||
data?.let {
|
||||
val noticeNormalData = it[position].bean as NoticeNormalData
|
||||
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvNoticeContent.text = noticeNormalData.content
|
||||
GlideApp.with(activity).load(noticeNormalData.imageUrl).optionalTransform(
|
||||
GlideRoundedCornersTransform(
|
||||
20f,
|
||||
GlideRoundedCornersTransform.CornerType.ALL
|
||||
)
|
||||
).into(holder.ivNoticeImage)
|
||||
holder.tvNoticeCheck.setOnClickListener {
|
||||
//云公告
|
||||
CallerHmiManager.showNoticeNormalData(noticeNormalData)
|
||||
}
|
||||
}
|
||||
}else if(holder is BubbleV2XHolder){
|
||||
data?.let {
|
||||
val v2XMsg = it[position].bean as V2XMsg
|
||||
holder.tvV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvV2XContent.text = v2XMsg.content
|
||||
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(EventTypeEnum.getUpdateIconRes(v2XMsg.type)))
|
||||
}
|
||||
}
|
||||
|
||||
val msgBoxBean: MsgBoxBean = data!![position]
|
||||
countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){
|
||||
override fun onTick(p0: Long) {
|
||||
|
||||
}
|
||||
|
||||
override fun onFinish() {
|
||||
data?.remove(msgBoxBean)
|
||||
notifyDataSetChanged()
|
||||
// notifyItemRemoved(index)
|
||||
// notifyItemRangeChanged(index,recordTypeEntity.size-index)
|
||||
}
|
||||
|
||||
}
|
||||
countDownTimer?.start()
|
||||
|
||||
}
|
||||
|
||||
override fun getItemCount() = data?.size ?: 0
|
||||
|
||||
override fun getItemViewType(position: Int): Int {
|
||||
if(data!![position].type == MsgBoxType.OPERATION){
|
||||
return operation
|
||||
}else if(data!![position].type == MsgBoxType.REPORT){
|
||||
return report
|
||||
}else if(data!![position].type == MsgBoxType.NOTICE){
|
||||
return notice
|
||||
}else{
|
||||
return v2x
|
||||
}
|
||||
}
|
||||
|
||||
//车辆系统信息
|
||||
class BubbleReportHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var tvBubbleReportTime: TextView = itemView.findViewById(R.id.tvBubbleReportTime)
|
||||
var tvBubbleReportType: TextView = itemView.findViewById(R.id.tvBubbleReportType)
|
||||
var tvBubbleReceiveTime: TextView = itemView.findViewById(R.id.tvBubbleReceiveTime)
|
||||
}
|
||||
|
||||
//运营平台
|
||||
class BubbleOperationHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var tvBubbleOperationTime: TextView = itemView.findViewById(R.id.tvBubbleOperationTime)
|
||||
var tvBubbleOperationContent: TextView = itemView.findViewById(R.id.tvBubbleOperationContent)
|
||||
}
|
||||
|
||||
//Notice
|
||||
class BubbleNoticeHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var ivNoticeImage: ImageView = itemView.findViewById(R.id.ivNoticeImage)
|
||||
var tvNoticeTitle: TextView = itemView.findViewById(R.id.tvNoticeTitle)
|
||||
var tvNoticeTime: TextView = itemView.findViewById(R.id.tvNoticeTime)
|
||||
var tvNoticeCheck: TextView = itemView.findViewById(R.id.tvNoticeCheck)
|
||||
var tvNoticeContent: TextView = itemView.findViewById(R.id.tvNoticeContent)
|
||||
}
|
||||
|
||||
//V2X
|
||||
class BubbleV2XHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var ivV2XImage: ImageView = itemView.findViewById(R.id.ivV2XImage)
|
||||
var tvV2XTime: TextView = itemView.findViewById(R.id.tvV2XTime)
|
||||
var tvV2XContent: TextView = itemView.findViewById(R.id.tvV2XContent)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,264 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.msgbox.adapter
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Activity
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.msgbox.*
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.hmi.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.util.ResourceUtils.getDrawable
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat
|
||||
import com.mogo.eagle.core.widget.RoundConstraintLayout
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 司机端消息盒子列表视图RecyclerView适配器
|
||||
* @since: 2022/11/25
|
||||
*/
|
||||
class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Adapter<RecyclerView.ViewHolder>(){
|
||||
|
||||
private var data: List<MsgBoxBean> ?= null
|
||||
|
||||
private val operation: Int = 1
|
||||
private val notice: Int = 2
|
||||
private val v2x: Int = 3
|
||||
private val obu: Int = 4
|
||||
private val report: Int = 5
|
||||
private val record: Int = 6
|
||||
private val traffic: Int = 7
|
||||
|
||||
//Error
|
||||
val RESULT_AUTOPILOT_DISABLE = "RESULT_AUTOPILOT_DISABLE"
|
||||
val RESULT_AUTOPILOT_SYSTEM_UNSTARTED = "RESULT_AUTOPILOT_SYSTEM_UNSTARTED"
|
||||
val RESULT_REMOTEPILOT_DISABLE = "RESULT_REMOTEPILOT_DISABLE"
|
||||
|
||||
fun setData(data: List<MsgBoxBean>){
|
||||
this.data = data
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
|
||||
if(viewType == record){
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_bad_case,parent,false)
|
||||
return BadCaseHolder(view)
|
||||
}else if(viewType == report){
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_ipc_report,parent,false)
|
||||
return MsgBoxIpcReportHolder(view)
|
||||
}else if(viewType == operation){
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_operation,parent,false)
|
||||
return MsgBoxOperation(view)
|
||||
}else if(viewType == notice){
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_notice,parent,false)
|
||||
return MsgBoxNotice(view)
|
||||
}else{
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_v2x,parent,false)
|
||||
return MsgBoxV2X(view)
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
if(holder is BadCaseHolder){
|
||||
data?.let {
|
||||
holder.tvBagReceiveTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvBagRecordTime.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
|
||||
val msgBoxBean = it[position]
|
||||
// val recordBagMsg = (it[position].bean as RecordBagMsg)
|
||||
holder.tvRecordCheck.setOnClickListener {
|
||||
//打开被动录包弹窗
|
||||
CallerDevaToolsManager.onReceiveBadCaseRecord(msgBoxBean,activity,false)
|
||||
}
|
||||
}
|
||||
}else if(holder is MsgBoxIpcReportHolder){
|
||||
data?.let { it ->
|
||||
holder.tvReportTimeNormal.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
|
||||
holder.tvReportTimeOpen.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
|
||||
val reportEntity = (it[position].bean as ReportEntity)
|
||||
if(reportEntity.resultList.contains(RESULT_AUTOPILOT_DISABLE)
|
||||
|| reportEntity.resultList.contains(RESULT_AUTOPILOT_SYSTEM_UNSTARTED)
|
||||
|| reportEntity.resultList.contains(RESULT_REMOTEPILOT_DISABLE)){
|
||||
//Error
|
||||
holder.ivReportImageNormal.setImageDrawable(getDrawable(R.drawable.icon_report_error_normal))
|
||||
holder.ivReportImageOpen.setImageDrawable(getDrawable(R.drawable.icon_report_error_open))
|
||||
holder.tvReportLevelNormal.text = "Error"
|
||||
holder.tvReportLevelOpen.text = "Error"
|
||||
}else{
|
||||
//Warning
|
||||
holder.ivReportImageNormal.setImageDrawable(getDrawable(R.drawable.icon_report_warning_normal))
|
||||
holder.ivReportImageOpen.setImageDrawable(getDrawable(R.drawable.icon_report_warning_open))
|
||||
holder.tvReportLevelNormal.text = "Warning"
|
||||
holder.tvReportLevelOpen.text = "Warning"
|
||||
}
|
||||
holder.tvReportTimeNormal.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
|
||||
holder.tvReportTimeOpen.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
|
||||
var resultStr = "类型:"
|
||||
for (result in reportEntity.resultList){
|
||||
resultStr = "${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}"
|
||||
}
|
||||
holder.tvReportTypeNormal.text = resultStr
|
||||
holder.tvReportTypeOpen.text = resultStr
|
||||
holder.tvReportReasonOpen.text = "原因:${reportEntity.msg}"
|
||||
holder.tvStatusSelect.setOnClickListener {
|
||||
if(holder.tvReportLevelNormal.isVisible){
|
||||
holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds(getDrawable(R.drawable.icon_msg_close),null,null,null)
|
||||
holder.ivReportImageNormal.visibility = View.GONE
|
||||
holder.tvReportLevelNormal.visibility = View.GONE
|
||||
holder.tvReportTimeNormal.visibility = View.GONE
|
||||
holder.tvReportTypeNormal.visibility = View.GONE
|
||||
|
||||
holder.ivReportImageOpen.visibility = View.VISIBLE
|
||||
holder.tvReportLevelOpen.visibility = View.VISIBLE
|
||||
holder.tvReportTimeOpen.visibility = View.VISIBLE
|
||||
holder.tvReportTypeOpen.visibility = View.VISIBLE
|
||||
holder.tvReportReasonOpen.visibility = View.VISIBLE
|
||||
}else{
|
||||
holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds(getDrawable(R.drawable.icon_msg_open),null,null,null)
|
||||
holder.ivReportImageNormal.visibility = View.VISIBLE
|
||||
holder.tvReportLevelNormal.visibility = View.VISIBLE
|
||||
holder.tvReportTimeNormal.visibility = View.VISIBLE
|
||||
holder.tvReportTypeNormal.visibility = View.VISIBLE
|
||||
|
||||
holder.ivReportImageOpen.visibility = View.GONE
|
||||
holder.tvReportLevelOpen.visibility = View.GONE
|
||||
holder.tvReportTimeOpen.visibility = View.GONE
|
||||
holder.tvReportTypeOpen.visibility = View.GONE
|
||||
holder.tvReportReasonOpen.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
}else if(holder is MsgBoxOperation){
|
||||
data?.let {
|
||||
val operationMsg = it[position].bean as OperationMsg
|
||||
holder.tvOperationContentNormal.text = operationMsg.content
|
||||
holder.tvOperationContentOpen.text = operationMsg.content
|
||||
holder.tvOperationTime.text = TimeUtils.millis2String(operationMsg.timestamp,getHourMinFormat())
|
||||
holder.tvOperationStatusSelect.setOnClickListener {
|
||||
if(holder.ivOperationImageNormal.isVisible){
|
||||
holder.tvOperationStatusSelect.setCompoundDrawablesWithIntrinsicBounds(getDrawable(R.drawable.icon_msg_close),null,null,null)
|
||||
holder.ivOperationImageNormal.visibility = View.GONE
|
||||
holder.tvOperationTitleNormal.visibility = View.GONE
|
||||
holder.tvOperationContentNormal.visibility = View.GONE
|
||||
|
||||
holder.ivOperationImageOpen.visibility = View.VISIBLE
|
||||
holder.tvOperationTitleOpen.visibility = View.VISIBLE
|
||||
holder.tvOperationContentOpen.visibility = View.VISIBLE
|
||||
}else{
|
||||
holder.tvOperationStatusSelect.setCompoundDrawablesWithIntrinsicBounds(getDrawable(R.drawable.icon_msg_open),null,null,null)
|
||||
holder.ivOperationImageNormal.visibility = View.VISIBLE
|
||||
holder.tvOperationTitleNormal.visibility = View.VISIBLE
|
||||
holder.tvOperationContentNormal.visibility = View.VISIBLE
|
||||
|
||||
holder.ivOperationImageOpen.visibility = View.GONE
|
||||
holder.tvOperationTitleOpen.visibility = View.GONE
|
||||
holder.tvOperationContentOpen.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
}else if(holder is MsgBoxNotice){
|
||||
data?.let {
|
||||
val noticeNormalData = it[position].bean as NoticeNormalData
|
||||
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvNoticeContent.text = noticeNormalData.content
|
||||
GlideApp.with(activity).load(noticeNormalData.imageUrl).optionalTransform(
|
||||
GlideRoundedCornersTransform(
|
||||
20f,
|
||||
GlideRoundedCornersTransform.CornerType.ALL
|
||||
)
|
||||
).into(holder.ivNoticeImage)
|
||||
holder.tvNoticeCheck.setOnClickListener {
|
||||
//云公告
|
||||
CallerHmiManager.showNoticeNormalData(noticeNormalData)
|
||||
}
|
||||
}
|
||||
}else if(holder is MsgBoxV2X){
|
||||
data?.let {
|
||||
val v2XMsg = it[position].bean as V2XMsg
|
||||
holder.tvV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvV2XContent.text = v2XMsg.content
|
||||
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(EventTypeEnum.getUpdateIconRes(v2XMsg.type)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount() = data?.size ?: 0
|
||||
|
||||
|
||||
override fun getItemViewType(position: Int): Int {
|
||||
return when(data!![position].type){
|
||||
MsgBoxType.OPERATION -> operation
|
||||
MsgBoxType.NOTICE -> notice
|
||||
MsgBoxType.V2X -> v2x
|
||||
MsgBoxType.OBU -> obu
|
||||
MsgBoxType.REPORT -> report
|
||||
MsgBoxType.RECORD -> record
|
||||
MsgBoxType.TRAFFIC -> traffic
|
||||
}
|
||||
}
|
||||
|
||||
//录包实体
|
||||
class BadCaseHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var tvBagRecordTime: TextView= itemView.findViewById(R.id.tvBagRecordTime)
|
||||
var tvBagReceiveTime: TextView = itemView.findViewById(R.id.tvBagReceiveTime)
|
||||
var tvRecordCheck: TextView = itemView.findViewById(R.id.tvRecordCheck)
|
||||
}
|
||||
|
||||
//车辆系统信息
|
||||
class MsgBoxIpcReportHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var ivReportImageNormal: ImageView = itemView.findViewById(R.id.ivReportImageNormal)
|
||||
var tvReportLevelNormal: TextView = itemView.findViewById(R.id.tvReportLevelNormal)
|
||||
var tvReportTimeNormal: TextView = itemView.findViewById(R.id.tvReportTimeNormal)
|
||||
var tvReportTypeNormal: TextView = itemView.findViewById(R.id.tvReportTypeNormal)
|
||||
var tvStatusSelect: TextView = itemView.findViewById(R.id.tvStatusSelect)
|
||||
var ivReportImageOpen: ImageView = itemView.findViewById(R.id.ivReportImageOpen)
|
||||
var tvReportLevelOpen: TextView = itemView.findViewById(R.id.tvReportLevelOpen)
|
||||
var tvReportTimeOpen: TextView = itemView.findViewById(R.id.tvReportTimeOpen)
|
||||
var tvReportTypeOpen: TextView = itemView.findViewById(R.id.tvReportTypeOpen)
|
||||
var tvReportReasonOpen: TextView = itemView.findViewById(R.id.tvReportReasonOpen)
|
||||
}
|
||||
|
||||
//运营平台
|
||||
class MsgBoxOperation(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var ivOperationImageNormal: ImageView = itemView.findViewById(R.id.ivOperationImageNormal)
|
||||
var tvOperationTitleNormal: TextView = itemView.findViewById(R.id.tvOperationTitleNormal)
|
||||
var tvOperationContentNormal: TextView = itemView.findViewById(R.id.tvOperationContentNormal)
|
||||
var tvOperationStatusSelect: TextView = itemView.findViewById(R.id.tvOperationStatusSelect)
|
||||
var tvOperationTime: TextView = itemView.findViewById(R.id.tvOperationTime)
|
||||
var ivOperationImageOpen: ImageView = itemView.findViewById(R.id.ivOperationImageOpen)
|
||||
var tvOperationTitleOpen: TextView = itemView.findViewById(R.id.tvOperationTitleOpen)
|
||||
var tvOperationContentOpen: TextView = itemView.findViewById(R.id.tvOperationContentOpen)
|
||||
}
|
||||
|
||||
//Notice
|
||||
class MsgBoxNotice(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var ivNoticeImage: ImageView = itemView.findViewById(R.id.ivNoticeImage)
|
||||
var tvNoticeTitle: TextView = itemView.findViewById(R.id.tvNoticeTitle)
|
||||
var tvNoticeTime: TextView = itemView.findViewById(R.id.tvNoticeTime)
|
||||
var tvNoticeCheck: TextView = itemView.findViewById(R.id.tvNoticeCheck)
|
||||
var tvNoticeContent: TextView = itemView.findViewById(R.id.tvNoticeContent)
|
||||
}
|
||||
|
||||
//V2X,OBU
|
||||
class MsgBoxV2X(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var ivV2XImage: ImageView = itemView.findViewById(R.id.ivV2XImage)
|
||||
var tvV2XTime: TextView = itemView.findViewById(R.id.tvV2XTime)
|
||||
var tvV2XContent: TextView = itemView.findViewById(R.id.tvV2XContent)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.msgbox.adapter
|
||||
|
||||
import android.app.Activity
|
||||
import android.os.CountDownTimer
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 乘客端消息盒子气泡视图RecyclerView适配器
|
||||
* @since: 2022/11/25
|
||||
*/
|
||||
class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
|
||||
private var data: ArrayList<MsgBoxBean> ?= null
|
||||
|
||||
private val notice: Int = 1
|
||||
private val v2x: Int = 2
|
||||
|
||||
var countDownTimer: CountDownTimer?=null
|
||||
|
||||
fun setData(data: ArrayList<MsgBoxBean>){
|
||||
this.data = data
|
||||
if(data.size>3){
|
||||
data.removeAt(0)
|
||||
}
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
|
||||
if(viewType == notice){
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_box_notice,parent,false)
|
||||
return BubbleNoticeHolder(view)
|
||||
}else{
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_box_v2x,parent,false)
|
||||
return BubbleV2XHolder(view)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
if(holder is BubbleNoticeHolder){
|
||||
data?.let {
|
||||
val noticeNormalData = it[position].bean as NoticeNormalData
|
||||
holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvPassengerNoticeContent.text = noticeNormalData.content
|
||||
GlideApp.with(activity).load(noticeNormalData.imageUrl).optionalTransform(
|
||||
GlideRoundedCornersTransform(
|
||||
20f,
|
||||
GlideRoundedCornersTransform.CornerType.ALL
|
||||
)
|
||||
).into(holder.ivPassengerNoticeImage)
|
||||
holder.tvPassengerNoticeCheck.setOnClickListener {
|
||||
//云公告
|
||||
CallerHmiManager.showNoticeNormalData(noticeNormalData)
|
||||
}
|
||||
}
|
||||
}else if(holder is BubbleV2XHolder){
|
||||
data?.let {
|
||||
val v2XMsg = it[position].bean as V2XMsg
|
||||
holder.tvPassengerV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvPassengerV2XContent.text = v2XMsg.content
|
||||
holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable(
|
||||
EventTypeEnum.getUpdateIconRes(v2XMsg.type)))
|
||||
}
|
||||
}
|
||||
val msgBoxBean: MsgBoxBean = data!![position]
|
||||
countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){
|
||||
override fun onTick(p0: Long) {
|
||||
|
||||
}
|
||||
|
||||
override fun onFinish() {
|
||||
data?.remove(msgBoxBean)
|
||||
notifyDataSetChanged()
|
||||
// notifyItemRemoved(index)
|
||||
// notifyItemRangeChanged(index,recordTypeEntity.size-index)
|
||||
}
|
||||
|
||||
}
|
||||
countDownTimer?.start()
|
||||
}
|
||||
|
||||
override fun getItemCount() = data?.size ?: 0
|
||||
|
||||
override fun getItemViewType(position: Int): Int {
|
||||
if(data!![position].type == MsgBoxType.NOTICE){
|
||||
return notice
|
||||
}else{
|
||||
return v2x
|
||||
}
|
||||
}
|
||||
|
||||
//Notice
|
||||
class BubbleNoticeHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var ivPassengerNoticeImage: ImageView = itemView.findViewById(R.id.ivPassengerNoticeImage)
|
||||
var tvPassengerNoticeTitle: TextView = itemView.findViewById(R.id.tvPassengerNoticeTitle)
|
||||
var tvPassengerNoticeContent: TextView = itemView.findViewById(R.id.tvPassengerNoticeContent)
|
||||
var tvPassengerNoticeCheck: TextView = itemView.findViewById(R.id.tvPassengerNoticeCheck)
|
||||
var tvPassengerNoticeTime: TextView = itemView.findViewById(R.id.tvPassengerNoticeTime)
|
||||
}
|
||||
|
||||
//OBU、V2X
|
||||
class BubbleV2XHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var ivPassengerV2XImage: ImageView = itemView.findViewById(R.id.ivPassengerV2XImage)
|
||||
var tvPassengerV2XTime: TextView = itemView.findViewById(R.id.tvPassengerV2XTime)
|
||||
var tvPassengerV2XContent: TextView = itemView.findViewById(R.id.tvPassengerV2XContent)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.msgbox.adapter
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
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.util.TimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 乘客端消息盒子列表视图RecyclerView适配器
|
||||
* @since: 2022/11/29
|
||||
*/
|
||||
class PassengerMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<RecyclerView.ViewHolder>(){
|
||||
|
||||
private var data: List<MsgBoxBean> ?= null
|
||||
|
||||
private val notice: Int = 1
|
||||
private val v2x: Int = 2
|
||||
|
||||
fun setData(data: List<MsgBoxBean>){
|
||||
this.data = data
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
|
||||
return if(viewType == notice){
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_list_notice,parent,false)
|
||||
ListNoticeHolder(view)
|
||||
}else{
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_list_v2x,parent,false)
|
||||
ListV2XHolder(view)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
if(holder is ListNoticeHolder){
|
||||
data?.let {
|
||||
val noticeNormalData = it[position].bean as NoticeNormalData
|
||||
holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvPassengerNoticeContent.text = noticeNormalData.content
|
||||
GlideApp.with(activity).load(noticeNormalData.imageUrl).optionalTransform(
|
||||
GlideRoundedCornersTransform(
|
||||
20f,
|
||||
GlideRoundedCornersTransform.CornerType.ALL
|
||||
)
|
||||
).into(holder.ivPassengerNoticeImage)
|
||||
holder.tvPassengerNoticeCheck.setOnClickListener {
|
||||
//云公告
|
||||
CallerHmiManager.showNoticeNormalData(noticeNormalData)
|
||||
}
|
||||
}
|
||||
}else if(holder is ListV2XHolder){
|
||||
data?.let {
|
||||
val v2XMsg = it[position].bean as V2XMsg
|
||||
holder.tvPassengerV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvPassengerV2XContent.text = v2XMsg.content
|
||||
holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable(
|
||||
EventTypeEnum.getUpdateIconRes(v2XMsg.type)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount() = data?.size ?: 0
|
||||
|
||||
override fun getItemViewType(position: Int): Int {
|
||||
if(data!![position].type == MsgBoxType.NOTICE){
|
||||
return notice
|
||||
}else{
|
||||
return v2x
|
||||
}
|
||||
}
|
||||
|
||||
//Notice
|
||||
class ListNoticeHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var ivPassengerNoticeImage: ImageView = itemView.findViewById(R.id.ivPassengerNoticeImage)
|
||||
var tvPassengerNoticeTitle: TextView = itemView.findViewById(R.id.tvPassengerNoticeTitle)
|
||||
var tvPassengerNoticeContent: TextView = itemView.findViewById(R.id.tvPassengerNoticeContent)
|
||||
var tvPassengerNoticeCheck: TextView = itemView.findViewById(R.id.tvPassengerNoticeCheck)
|
||||
var tvPassengerNoticeTime: TextView = itemView.findViewById(R.id.tvPassengerNoticeTime)
|
||||
}
|
||||
|
||||
//OBU、V2X
|
||||
class ListV2XHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var ivPassengerV2XImage: ImageView = itemView.findViewById(R.id.ivPassengerV2XImage)
|
||||
var tvPassengerV2XTime: TextView = itemView.findViewById(R.id.tvPassengerV2XTime)
|
||||
var tvPassengerV2XContent: TextView = itemView.findViewById(R.id.tvPassengerV2XContent)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -77,6 +77,7 @@ import com.mogo.map.MogoMapUIController
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.*
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.*
|
||||
import com.mogo.eagle.core.function.v2x.vip.VipCarManager
|
||||
import com.zhidao.easysocket.utils.L
|
||||
import com.zhidao.support.adas.high.other.permission.BackgrounderPermission
|
||||
import com.zhjt.mogo_core_function_devatools.env.*
|
||||
@@ -598,6 +599,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
tbIsDemoMode.visibility = View.GONE
|
||||
}
|
||||
|
||||
|
||||
// 雨天模式,上一次勾选的数据
|
||||
tbIsRainMode.isChecked = FunctionBuildConfig.isRainMode
|
||||
//雨天模式
|
||||
|
||||
@@ -69,7 +69,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
initCrashConfig();
|
||||
initLogConfig();
|
||||
initTipToast();
|
||||
AIAssist.getInstance(this);
|
||||
initModules();
|
||||
if (DebugConfig.isDebug()) {
|
||||
initKoom();
|
||||
|
||||
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 269 B |
|
After Width: | Height: | Size: 269 B |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#30B8FF"/>
|
||||
<corners android:radius="4dp"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#29D8D8D8"/>
|
||||
<corners android:radius="22px"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#5074B3"/>
|
||||
<size android:height="1dp" />
|
||||
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/icon_msg_box_close" android:state_checked="false" />
|
||||
<item android:drawable="@drawable/icon_msg_box_open" android:state_checked="true" />
|
||||
</selector>
|
||||
@@ -102,6 +102,8 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
|
||||
|
||||
<View
|
||||
android:id="@+id/viewDemoModeSwitch"
|
||||
android:layout_width="120dp"
|
||||
@@ -167,7 +169,6 @@
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
|
||||
android:background="@drawable/bg_waring_limiting_velocity"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
@@ -181,6 +182,83 @@
|
||||
app:layout_goneMarginTop="40dp"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<!--消息盒子选择入口-->
|
||||
<CheckBox
|
||||
android:id="@+id/cbMsgBoxDriver"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
app:layout_constraintTop_toTopOf="@id/viewLimitingVelocity"
|
||||
app:layout_constraintBottom_toBottomOf="@id/viewLimitingVelocity"
|
||||
app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"
|
||||
android:button="@null"
|
||||
android:background="@drawable/selector_msg_box"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbMsgBoxPassenger"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginStart="300dp"
|
||||
android:layout_marginBottom="30px"
|
||||
android:button="@null"
|
||||
android:background="@drawable/selector_msg_box"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/MsgBoxTipView"
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="8dp"
|
||||
android:background="@drawable/version_upgrade_tips_background"
|
||||
android:translationZ="30dp"
|
||||
app:layout_constraintCircle="@id/cbMsgBoxDriver"
|
||||
app:layout_constraintCircleAngle="40"
|
||||
app:layout_constraintCircleRadius="32dp"
|
||||
tools:ignore="MissingConstraints"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView
|
||||
android:id="@+id/viewDriverMsgBoxList"
|
||||
android:layout_width="864px"
|
||||
android:layout_height="746px"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver"
|
||||
app:layout_constraintRight_toRightOf="@id/viewLimitingVelocity"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView
|
||||
android:id="@+id/viewDriverMsgBoxBubble"
|
||||
android:layout_width="864px"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver"
|
||||
app:layout_constraintRight_toRightOf="@id/viewLimitingVelocity"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxBubbleView
|
||||
android:id="@+id/viewPassengerMsgBoxBubble"
|
||||
android:layout_width="864px"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toTopOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintRight_toRightOf="@id/cbMsgBoxPassenger"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxListView
|
||||
android:id="@+id/viewPassengerMsgBoxList"
|
||||
android:layout_width="650px"
|
||||
android:layout_height="750px"
|
||||
app:layout_constraintBottom_toTopOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintRight_toRightOf="@id/cbMsgBoxPassenger"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<!--左右转向灯-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.turnlight.TurnLightViewStatus
|
||||
android:id="@+id/turnLightView"
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/layoutBadCase"
|
||||
android:layout_width="804px"
|
||||
android:layout_height="160px"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#1B2966"
|
||||
app:roundLayoutRadius="24px"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="30px"
|
||||
android:layout_marginEnd="30px"
|
||||
android:layout_marginTop="5px"
|
||||
android:layout_marginBottom="5px"
|
||||
android:clickable="true"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivBadCaseImage"
|
||||
android:layout_width="110px"
|
||||
android:layout_height="110px"
|
||||
android:src="@drawable/icon_bad_case"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginStart="25px"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvRecordTip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/ivBadCaseImage"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivBadCaseImage"
|
||||
android:text="录包提醒"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="32px"
|
||||
android:layout_marginStart="25px"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBagRecordTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivBadCaseImage"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivBadCaseImage"
|
||||
android:layout_marginStart="25px"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="30px"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBagReceiveTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/tvRecordTip"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="24px"
|
||||
android:layout_marginEnd="15px"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvRecordCheck"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/tvBagRecordTime"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvBagRecordTime"
|
||||
android:layout_marginEnd="15px"
|
||||
android:text="查看"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="30px"
|
||||
/>
|
||||
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -0,0 +1,151 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="804px"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#1B2966"
|
||||
app:roundLayoutRadius="24px"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="30px"
|
||||
android:layout_marginEnd="30px"
|
||||
android:layout_marginTop="5px"
|
||||
android:layout_marginBottom="5px"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivReportImageNormal"
|
||||
android:layout_width="110px"
|
||||
android:layout_height="110px"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginTop="25px"
|
||||
android:layout_marginBottom="25px"
|
||||
android:layout_marginStart="25px"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportLevelNormal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivReportImageNormal"
|
||||
android:layout_marginTop="20px"
|
||||
android:layout_marginStart="25px"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="32px"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportTimeNormal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvReportLevelNormal"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvReportLevelNormal"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="28px"
|
||||
android:layout_marginTop="10px"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportTypeNormal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvReportTimeNormal"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvReportTimeNormal"
|
||||
app:layout_constraintRight_toRightOf="@id/tvStatusSelect"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginTop="10px"
|
||||
android:layout_marginBottom="10px"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:gravity="start"
|
||||
android:textSize="28px"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvStatusSelect"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="折叠"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="24px"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginTop="25px"
|
||||
android:layout_marginEnd="25px"
|
||||
android:background="@drawable/bg_msg_status_select"
|
||||
android:drawableStart="@drawable/icon_msg_open"
|
||||
android:drawablePadding="10px"
|
||||
android:paddingStart="15px"
|
||||
android:paddingEnd="15px"
|
||||
android:paddingTop="5px"
|
||||
android:paddingBottom="5px"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivReportImageOpen"
|
||||
android:layout_width="44px"
|
||||
android:layout_height="44px"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginTop="20px"
|
||||
android:layout_marginStart="20px"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportLevelOpen"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/ivReportImageOpen"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivReportImageOpen"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivReportImageOpen"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="32px"
|
||||
android:layout_marginStart="20px"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportTimeOpen"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/ivReportImageOpen"
|
||||
app:layout_constraintLeft_toLeftOf="@id/ivReportImageOpen"
|
||||
android:layout_marginTop="10px"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="28px"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportTypeOpen"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvReportTimeOpen"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvReportTimeOpen"
|
||||
android:layout_marginTop="10px"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="28px"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportReasonOpen"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvReportTypeOpen"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvReportTypeOpen"
|
||||
app:layout_constraintRight_toRightOf="@id/tvStatusSelect"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:gravity="start"
|
||||
android:layout_marginTop="10px"
|
||||
android:layout_marginBottom="10px"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="28px"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="804px"
|
||||
android:layout_height="160px"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#1B2966"
|
||||
app:roundLayoutRadius="24px"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="30px"
|
||||
android:layout_marginEnd="30px"
|
||||
android:layout_marginTop="5px"
|
||||
android:layout_marginBottom="5px"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivNoticeImage"
|
||||
android:layout_width="140px"
|
||||
android:layout_height="130px"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginStart="15px"
|
||||
android:src="@drawable/icon_notice_default"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvNoticeTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="官方公告"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="32px"
|
||||
app:layout_constraintTop_toTopOf="@id/ivNoticeImage"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivNoticeImage"
|
||||
android:layout_marginStart="15px"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvNoticeTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/tvNoticeTitle"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvNoticeTitle"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="25px"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="24px"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvNoticeCheck"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginEnd="25px"
|
||||
android:layout_marginBottom="20px"
|
||||
android:text="查看"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="30px"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvNoticeContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvNoticeTitle"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvNoticeCheck"
|
||||
app:layout_constraintTop_toTopOf="@id/tvNoticeCheck"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvNoticeCheck"
|
||||
android:gravity="start"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="28px"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -0,0 +1,128 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="804px"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#1B2966"
|
||||
app:roundLayoutRadius="24px"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="30px"
|
||||
android:layout_marginEnd="30px"
|
||||
android:layout_marginTop="5px"
|
||||
android:layout_marginBottom="5px"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivOperationImageNormal"
|
||||
android:layout_width="110px"
|
||||
android:layout_height="110px"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginTop="25px"
|
||||
android:layout_marginBottom="25px"
|
||||
android:layout_marginStart="25px"
|
||||
android:src="@drawable/icon_msg_box_operation"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvOperationTitleNormal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/ivOperationImageNormal"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivOperationImageNormal"
|
||||
android:text="运营平台"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="32px"
|
||||
android:layout_marginStart="25px"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvOperationContentNormal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvOperationTitleNormal"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvOperationTitleNormal"
|
||||
app:layout_constraintRight_toRightOf="@id/tvOperationStatusSelect"
|
||||
android:layout_marginEnd="25px"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:gravity="start"
|
||||
android:textSize="28px"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvOperationStatusSelect"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="折叠"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="24px"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginTop="25px"
|
||||
android:layout_marginEnd="25px"
|
||||
android:background="@drawable/bg_msg_status_select"
|
||||
android:drawableStart="@drawable/icon_msg_open"
|
||||
android:drawablePadding="10px"
|
||||
android:paddingStart="15px"
|
||||
android:paddingEnd="15px"
|
||||
android:paddingTop="5px"
|
||||
android:paddingBottom="5px"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvOperationTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/tvOperationStatusSelect"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvOperationStatusSelect"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvOperationStatusSelect"
|
||||
android:layout_marginEnd="20px"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="24px"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivOperationImageOpen"
|
||||
android:layout_width="44px"
|
||||
android:layout_height="44px"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginTop="25px"
|
||||
android:layout_marginStart="25px"
|
||||
android:src="@drawable/icon_msg_box_operation"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvOperationTitleOpen"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/ivOperationImageOpen"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivOperationImageOpen"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivOperationImageOpen"
|
||||
android:text="运营平台"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="32px"
|
||||
android:layout_marginStart="20px"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvOperationContentOpen"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/ivOperationImageOpen"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="@id/ivOperationImageOpen"
|
||||
app:layout_constraintRight_toRightOf="@id/tvOperationStatusSelect"
|
||||
android:gravity="start"
|
||||
android:layout_margin="20px"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="28px"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="804px"
|
||||
android:layout_height="160px"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#1B2966"
|
||||
app:roundLayoutRadius="24px"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="30px"
|
||||
android:layout_marginEnd="30px"
|
||||
android:layout_marginTop="5px"
|
||||
android:layout_marginBottom="5px">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivV2XImage"
|
||||
android:layout_width="110px"
|
||||
android:layout_height="110px"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_margin="25px"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvV2XTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/ivV2XImage"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="25px"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="24px"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvV2XContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivV2XImage"
|
||||
app:layout_constraintRight_toRightOf="@id/tvV2XTime"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvV2XTime"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginStart="25px"
|
||||
android:layout_marginBottom="25px"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="32px"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="804px"
|
||||
android:layout_height="160px"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#1B2966"
|
||||
app:roundLayoutRadius="24px"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="30px"
|
||||
android:layout_marginEnd="30px"
|
||||
android:layout_marginTop="5px"
|
||||
android:layout_marginBottom="5px">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivBubbleOperationImage"
|
||||
android:layout_width="110px"
|
||||
android:layout_height="110px"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginStart="25px"
|
||||
android:src="@drawable/icon_msg_box_operation"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBubbleOperationTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivBubbleOperationImage"
|
||||
android:layout_marginTop="20px"
|
||||
android:layout_marginStart="25px"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="32px"
|
||||
android:text="运营平台"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBubbleOperationTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/tvBubbleOperationTitle"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvBubbleOperationTitle"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="20px"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="24px"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBubbleOperationContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvBubbleOperationTitle"
|
||||
app:layout_constraintRight_toRightOf="@id/tvBubbleOperationTime"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvBubbleOperationTitle"
|
||||
android:layout_marginTop="20px"
|
||||
android:gravity="start"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="28px"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="804px"
|
||||
android:layout_height="160px"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#1B2966"
|
||||
app:roundLayoutRadius="24px"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="30px"
|
||||
android:layout_marginEnd="30px"
|
||||
android:layout_marginTop="5px"
|
||||
android:layout_marginBottom="5px"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivBubbleReportImage"
|
||||
android:layout_width="110px"
|
||||
android:layout_height="110px"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginStart="25px"
|
||||
android:src="@drawable/icon_report_error_normal"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBubbleReportTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivBubbleReportImage"
|
||||
android:layout_marginTop="20px"
|
||||
android:layout_marginStart="25px"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="32px"
|
||||
android:text="Error"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBubbleReportTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvBubbleReportTitle"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvBubbleReportTitle"
|
||||
android:layout_marginTop="20px"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="28px"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBubbleReportType"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvBubbleReportTime"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvBubbleReportTime"
|
||||
android:layout_marginTop="15px"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="28px"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBubbleReceiveTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/tvBubbleReportTitle"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvBubbleReportTitle"
|
||||
android:layout_marginEnd="25px"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="24px"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="650px"
|
||||
android:layout_height="160px"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#465878"
|
||||
app:roundLayoutRadius="24px"
|
||||
android:layout_marginTop="10px"
|
||||
android:layout_marginBottom="10px"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivPassengerNoticeImage"
|
||||
android:layout_width="160px"
|
||||
android:layout_height="160px"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:src="@drawable/icon_passenger_operation"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPassengerNoticeTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="官方公告"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="36px"
|
||||
android:layout_marginStart="20px"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivPassengerNoticeImage"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/tvPassengerNoticeContent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPassengerNoticeContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="28px"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvPassengerNoticeTitle"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvPassengerNoticeTitle"
|
||||
app:layout_constraintRight_toRightOf="@id/tvPassengerNoticeTime"
|
||||
android:gravity="start"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPassengerNoticeCheck"
|
||||
android:layout_width="140px"
|
||||
android:layout_height="160px"
|
||||
android:text="查 看"
|
||||
android:textColor="#FF84D4FF"
|
||||
android:textSize="28px"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:layout_width="1px"
|
||||
android:layout_height="80px"
|
||||
android:background="#5E70A6"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvPassengerNoticeCheck"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPassengerNoticeTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="26px"
|
||||
app:layout_constraintTop_toTopOf="@id/tvPassengerNoticeTitle"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvPassengerNoticeTitle"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvPassengerNoticeCheck"
|
||||
android:layout_marginEnd="20px"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="650px"
|
||||
android:layout_height="160px"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#465878"
|
||||
app:roundLayoutRadius="24px">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivPassengerV2XImage"
|
||||
android:layout_width="120px"
|
||||
android:layout_height="120px"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginStart="20px"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPassengerV2XTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="26px"
|
||||
android:layout_marginEnd="20px"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPassengerV2XContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivPassengerV2XImage"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvPassengerV2XTime"
|
||||
android:gravity="start"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="36px"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -0,0 +1,79 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="150px"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivPassengerNoticeImage"
|
||||
android:layout_width="96px"
|
||||
android:layout_height="96px"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:src="@drawable/icon_passenger_operation"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPassengerNoticeTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="官方公告"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="36px"
|
||||
android:layout_marginStart="20px"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivPassengerNoticeImage"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/tvPassengerNoticeContent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPassengerNoticeContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="28px"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvPassengerNoticeTitle"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvPassengerNoticeTitle"
|
||||
app:layout_constraintRight_toRightOf="@id/tvPassengerNoticeTime"
|
||||
android:gravity="start"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPassengerNoticeCheck"
|
||||
android:layout_width="140px"
|
||||
android:layout_height="150px"
|
||||
android:text="查 看"
|
||||
android:textColor="#FF84D4FF"
|
||||
android:textSize="28px"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:layout_width="1px"
|
||||
android:layout_height="80px"
|
||||
android:background="#5E70A6"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvPassengerNoticeCheck"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPassengerNoticeTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="26px"
|
||||
app:layout_constraintTop_toTopOf="@id/tvPassengerNoticeTitle"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvPassengerNoticeTitle"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvPassengerNoticeCheck"
|
||||
android:layout_marginEnd="20px"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="150px"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivPassengerV2XImage"
|
||||
android:layout_width="96px"
|
||||
android:layout_height="96px"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPassengerV2XTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="26px"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPassengerV2XContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivPassengerV2XImage"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvPassengerV2XTime"
|
||||
android:gravity="start"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="36px"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="864px"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#3C4783"
|
||||
app:roundLayoutRadius="40px">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvBubbleList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="864px"
|
||||
android:layout_height="746px"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#3C4783"
|
||||
app:roundLayoutRadius="40px">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMsgNotice"
|
||||
android:layout_width="288px"
|
||||
android:layout_height="90px"
|
||||
android:text="通知"
|
||||
android:textColor="@color/msg_box_title_color"
|
||||
android:textSize="38px"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewNoticeDivider"
|
||||
android:layout_width="62.7px"
|
||||
android:layout_height="5px"
|
||||
android:background="@drawable/bg_msg_box_divider"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvMsgNotice"
|
||||
app:layout_constraintRight_toRightOf="@id/tvMsgNotice"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvMsgNotice"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMsgIpcReport"
|
||||
android:layout_width="288px"
|
||||
android:layout_height="90px"
|
||||
android:text="车辆系统信息"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="38px"
|
||||
android:gravity="center"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvMsgNotice"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvMsgBadCase"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewIpcReportDivider"
|
||||
android:layout_width="62.7px"
|
||||
android:layout_height="5px"
|
||||
android:background="@drawable/bg_msg_box_divider"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvMsgIpcReport"
|
||||
app:layout_constraintRight_toRightOf="@id/tvMsgIpcReport"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvMsgIpcReport"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMsgBadCase"
|
||||
android:layout_width="288px"
|
||||
android:layout_height="90px"
|
||||
android:text="录包"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="38px"
|
||||
android:gravity="center"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewBadCaseDivider"
|
||||
android:layout_width="62.7px"
|
||||
android:layout_height="5px"
|
||||
android:background="@drawable/bg_msg_box_divider"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvMsgBadCase"
|
||||
app:layout_constraintRight_toRightOf="@id/tvMsgBadCase"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvMsgBadCase"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvMsgBoxList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvMsgIpcReport"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginTop="20px"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/rvPassengerBubbleList"
|
||||
android:layout_width="650px"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="650px"
|
||||
android:layout_height="750px"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#31486E"
|
||||
app:roundLayoutRadius="40px">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvPassengerList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginStart="20px"
|
||||
android:layout_marginEnd="20px"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -123,8 +123,8 @@
|
||||
android:padding="@dimen/dp_20"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="关闭OBU"
|
||||
android:textOn="开启OBU"
|
||||
android:textOff="开启OBU"
|
||||
android:textOn="关闭OBU"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbRainMode"
|
||||
/>
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
<color name="notice_dialog_back">#3B4577</color>
|
||||
<color name="notice_video_progressbar_loading_color">#256BFF</color>
|
||||
|
||||
<color name="msg_box_title_color">#FF1BB7FF</color>
|
||||
|
||||
<color name="colorPrimary">#6200EE</color>
|
||||
<color name="colorPrimaryDark">#3700B3</color>
|
||||
<color name="colorAccent">#03DAC5</color>
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.mogo.eagle.core.function.overview
|
||||
|
||||
class OverViewConst {
|
||||
companion object {
|
||||
const val CLOUD_HOST = "https://eagle-qa.zhidaozhixing.com"
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.mogo.eagle.core.function.overview.vm
|
||||
|
||||
import androidx.lifecycle.*
|
||||
import com.mogo.commons.constants.HostConst
|
||||
import com.mogo.eagle.core.data.map.Infrastructure
|
||||
import com.mogo.eagle.core.function.overview.OverViewConst
|
||||
import com.mogo.eagle.core.function.overview.OverviewDao
|
||||
import com.mogo.eagle.core.function.overview.remote.OverViewServiceApi
|
||||
import com.mogo.eagle.core.function.overview.remote.V2XEvent
|
||||
@@ -10,7 +10,6 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import io.reactivex.functions.Consumer
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import kotlinx.coroutines.launch
|
||||
import java.util.concurrent.TimeUnit
|
||||
@@ -76,10 +75,13 @@ class OverViewModel(
|
||||
}
|
||||
|
||||
fun getAllV2XEventsByLineId(lineId: String, sn: String) {
|
||||
if (disposable != null && !disposable!!.isDisposed) {
|
||||
disposable!!.dispose()
|
||||
}
|
||||
// 1分钟查询一次
|
||||
disposable = Observable.interval(0, 60000, TimeUnit.SECONDS)
|
||||
.flatMap {
|
||||
MoGoRetrofitFactory.getInstance(OverViewConst.CLOUD_HOST)
|
||||
MoGoRetrofitFactory.getInstance(HostConst.getHost())
|
||||
.create(OverViewServiceApi::class.java)
|
||||
.queryAllV2XEventsByLineId(lineId, sn)
|
||||
.map {
|
||||
|
||||
@@ -33,7 +33,7 @@ import java.util.List;
|
||||
@Route(path = MoGoFragmentPaths.PATH_FRAGMENT_OVERVIEW)
|
||||
public class OverviewMapFragment extends BaseFragment
|
||||
implements IMogoSmallMapProvider {
|
||||
private final String TAG = "SmallMapFragment";
|
||||
private final String TAG = "OverviewMapFragment";
|
||||
protected AMapCustomView mAMapCustomView;
|
||||
private OverViewModel mViewModel;
|
||||
|
||||
@@ -79,15 +79,25 @@ public class OverviewMapFragment extends BaseFragment
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearV2XMarkers() {
|
||||
if (Thread.currentThread() != Looper.getMainLooper().getThread()) {
|
||||
UiThreadHandler.post(() -> {
|
||||
mAMapCustomView.clearV2XMarkers();
|
||||
});
|
||||
} else {
|
||||
mAMapCustomView.clearV2XMarkers();
|
||||
public void startQueryV2XEvents() {
|
||||
if (isAdded()) {
|
||||
long lineId = getLineId();
|
||||
if (lineId > 0 && mViewModel != null) {
|
||||
mViewModel.getAllV2XEventsByLineId("" + lineId, MoGoAiCloudClientConfig.getInstance().getSn());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearV2XMarkers() {
|
||||
if (isAdded()) {
|
||||
if (mAMapCustomView != null) {
|
||||
mAMapCustomView.clearV2XMarkers();
|
||||
}
|
||||
if (mViewModel != null) {
|
||||
mViewModel.stopQueryV2XEvents();
|
||||
}
|
||||
}
|
||||
mViewModel.stopQueryV2XEvents();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -128,7 +138,6 @@ public class OverviewMapFragment extends BaseFragment
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return Taxi的下发的轨迹id
|
||||
*/
|
||||
private long getLineId() {
|
||||
|
||||
@@ -65,6 +65,7 @@ dependencies {
|
||||
implementation project(':core:mogo-core-function-api')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
implementation project(':modules:mogo-module-common')
|
||||
implementation project(":foudations:mogo-commons")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.Message
|
||||
import com.mogo.commons.constants.HostConst
|
||||
import com.mogo.eagle.core.data.camera.CameraEntity
|
||||
import com.mogo.eagle.core.data.camera.ReqLiveCarBean
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
@@ -12,7 +13,6 @@ 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.eagle.core.data.constants.HostConst
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
@@ -122,6 +122,9 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
* HV车辆基础信息 CvxHvCarIndInfo CvxHvInfoIndInfo
|
||||
*/
|
||||
override fun onMogoObuHvBasics(p0: MogoObuHvBasicsData?) {
|
||||
mObuStatusInfo.obuHvStatus = true
|
||||
CallerObuListenerManager.invokeListener(mObuStatusInfo)
|
||||
|
||||
if (p0 != null && p0.vehBasicsMsg != null) {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
@@ -169,6 +172,9 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
*/
|
||||
override fun onMogoObuRvWarning(data: MogoObuRvWarningData) {
|
||||
super.onMogoObuRvWarning(data)
|
||||
mObuStatusInfo.obuRvStatus = true
|
||||
CallerObuListenerManager.invokeListener(mObuStatusInfo)
|
||||
|
||||
if (!data.warningMsg.warningData.isNullOrEmpty()) {
|
||||
// 更新数据,远车数据,之前要匹配uuid
|
||||
TrafficDataConvertUtilsNew.cvxRvInfoIndInfo2TrafficData(data)?.let {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.eagle.core.function.v2x.events.network;
|
||||
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory;
|
||||
import com.mogo.eagle.core.data.constants.HostConst;
|
||||
import com.mogo.commons.constants.HostConst;
|
||||
|
||||
/**
|
||||
* 应对不同接口对应不同服务域名的工厂累
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.eagle.core.network.apiCall
|
||||
import com.mogo.eagle.core.network.cancel
|
||||
import com.mogo.eagle.core.network.request
|
||||
import com.mogo.eagle.core.data.constants.HostConst.CITY_HOST
|
||||
import com.mogo.commons.constants.HostConst.CITY_HOST
|
||||
|
||||
class TrafficLightNetWorkModel {
|
||||
|
||||
|
||||
@@ -9,14 +9,19 @@ import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_VIP
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2N
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.data.trafficlight.currentRoadTrafficLight
|
||||
import com.mogo.eagle.core.data.trafficlight.isGreen
|
||||
import com.mogo.eagle.core.data.trafficlight.isRed
|
||||
import com.mogo.eagle.core.data.v2x.VipMessage
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.MogoTrafficLightManager
|
||||
@@ -25,11 +30,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.zhjt.service_biz.BizConfig
|
||||
|
||||
class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListener,
|
||||
@@ -195,7 +195,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
}
|
||||
}
|
||||
|
||||
private fun turnLight(controlTime: Int) {
|
||||
fun turnLight(controlTime: Int) {
|
||||
if (result == null || mContext == null) return
|
||||
val locationClient = CallerMapUIServiceManager.getSingletonLocationClient(mContext!!)
|
||||
if (locationClient != null) {
|
||||
@@ -204,7 +204,9 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
CallerLogger.d("$M_V2X$TAG", "-- turnLight -- ")
|
||||
MogoTrafficLightManager.INSTANCE.turnLightToGreen(
|
||||
result!!.lightId, result!!.crossId, bearing, controlTime,
|
||||
// 100445, "10037", 90.0, controlTime, //衡阳25号路口测试数据
|
||||
{
|
||||
// 请求变灯成功,直接提示
|
||||
if (it.sn == MoGoAiCloudClientConfig.getInstance().sn && it.code == 0) {
|
||||
CallerLogger.d("$M_V2X$TAG", "变灯请求成功")
|
||||
showWarning(
|
||||
@@ -213,7 +215,22 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION.tts,
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION.poiType
|
||||
)
|
||||
} else {
|
||||
return@turnLightToGreen
|
||||
}
|
||||
|
||||
// 请求变灯失败,根据灯态来提示。 此处灯态未获取到
|
||||
if (this.result == null || this.result?.currentRoadTrafficLight() == null) {
|
||||
showWarning(
|
||||
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType,
|
||||
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.content + "稍后重试",
|
||||
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.tts,
|
||||
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType
|
||||
)
|
||||
return@turnLightToGreen
|
||||
}
|
||||
|
||||
// 如果当前为红灯,则提示
|
||||
if (this.result!!.currentRoadTrafficLight()!!.isRed()) {
|
||||
val time = if (it.countDown / 60 >= 1) {
|
||||
"${it.countDown / 60}分${it.countDown % 60}秒后重试"
|
||||
} else {
|
||||
@@ -230,6 +247,11 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.tts,
|
||||
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType
|
||||
)
|
||||
} else {
|
||||
CallerLogger.d(
|
||||
"$M_V2X$TAG",
|
||||
"变灯请求失败,当前为非红灯不做展示 , light : ${result.toString()} , trafficLightControl : $it"
|
||||
)
|
||||
}
|
||||
},
|
||||
{ errorMsg ->
|
||||
@@ -246,21 +268,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
tag: String
|
||||
) {
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.V2X,
|
||||
V2XMsg(v2xType,
|
||||
alertContent.toString(),
|
||||
ttsContent)
|
||||
)
|
||||
)
|
||||
CallerHmiManager.warningV2X(
|
||||
v2xType, alertContent, ttsContent, tag,
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {}
|
||||
override fun onDismiss() {}
|
||||
},
|
||||
true,
|
||||
5000L
|
||||
MsgBoxBean(MsgBoxType.V2X, V2XMsg(v2xType, alertContent.toString(), ttsContent))
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.mogo.eagle.core.data.v2x.VipRequest
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.eagle.core.network.apiCall
|
||||
import com.mogo.eagle.core.network.request
|
||||
import com.mogo.eagle.core.data.constants.HostConst.DATA_SERVICE_HOST
|
||||
import com.mogo.commons.constants.HostConst.DATA_SERVICE_HOST
|
||||
|
||||
|
||||
class VipNetWorkModel {
|
||||
|
||||
@@ -46,11 +46,6 @@ open class AutopilotStatusInfo : Serializable, Cloneable {
|
||||
@Volatile
|
||||
var satelliteTime = 0.0
|
||||
|
||||
/**
|
||||
* 车速 m/s
|
||||
*/
|
||||
var speed = 0f
|
||||
|
||||
/**
|
||||
* 自动驾驶状态 0是不可用 1是ready 2是自动驾驶start
|
||||
*/
|
||||
@@ -94,7 +89,7 @@ open class AutopilotStatusInfo : Serializable, Cloneable {
|
||||
return "connectIP=$connectIP, connectPort=$connectPort, " +
|
||||
"connectStatus=$connectStatus, connectDescribe=$connectStatusDescribe, version=$version, dockVersion=$dockVersion," +
|
||||
" locationStatus=$locationStatus), locationLat=$locationLat, locationLon=$locationLon," +
|
||||
" satelliteTime=$satelliteTime, speed=$speed, state=$state, reason=$reason, camera=$camera," +
|
||||
" satelliteTime=$satelliteTime, state=$state, reason=$reason, camera=$camera," +
|
||||
" radar=$radar, rtk=$rtk, pilotmode=$pilotmode, ipcConnStatus=$ipcConnStatus, autopilotControlParameters=$autopilotControlParameters"
|
||||
}
|
||||
|
||||
|
||||
@@ -707,7 +707,9 @@ enum class EventTypeEnum(
|
||||
ALERT_CAR_TROUBLE_WARNING.poiType -> {
|
||||
R.drawable.icon_car_red
|
||||
}
|
||||
else -> 0
|
||||
else -> {
|
||||
R.drawable.icon_default
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||