Merge branch 'dev_robotaxi-d_230912_6.1.0' into dev_minibus-d_230919_6.1.0
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,3 +8,4 @@
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
.gitlab-ci.yml
|
||||
@@ -10,7 +10,6 @@ import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.och.bus.fragment;
|
||||
import static com.mogo.och.bus.constant.BusConst.TIMER_START_AUTOPILOT_INTERVAL;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -27,7 +28,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView;
|
||||
@@ -49,8 +49,6 @@ import com.mogo.och.common.module.utils.SoundPoolHelper;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import bag_manager.BagManagerOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import record_cache.RecordPanelOuterClass;
|
||||
@@ -137,21 +135,22 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
mSwitchMapModeLayout.setOnClickListener(new OnPreventFastClickListener() {
|
||||
@Override
|
||||
public void onClickImpl(View v) {
|
||||
|
||||
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
||||
if (controller != null) {
|
||||
//切换地图的远近视图
|
||||
if (controller.getCurrentMapVisualAngle().isLongSight()) {
|
||||
//Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true);
|
||||
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
|
||||
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
|
||||
//Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
|
||||
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
|
||||
} else {
|
||||
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
|
||||
if(mapBizView != null){
|
||||
IMogoMapUIController uiController = mapBizView.getUI();
|
||||
if(uiController != null){
|
||||
//切换地图的远近视图
|
||||
if (uiController.getCurrentMapVisualAngle().isLongSight()) {
|
||||
uiController.setLockMode(true);
|
||||
uiController.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
|
||||
} else if (uiController.getCurrentMapVisualAngle().isMediumSight()) {
|
||||
uiController.setLockMode(false);
|
||||
uiController.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
|
||||
} else {
|
||||
uiController.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -199,7 +198,6 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
|
||||
mSettingBtn = findViewById(R.id.module_mogo_och_setting_layout);
|
||||
mSettingBtn.setOnClickListener(v -> {
|
||||
// TODO: 2021/12/9
|
||||
CallerHmiManager.INSTANCE.showToolsView();
|
||||
});
|
||||
|
||||
@@ -256,14 +254,16 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
protected abstract void onArriveStation();
|
||||
|
||||
private void updateSwitchMapIcon() {
|
||||
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
||||
if (controller != null) {
|
||||
if (controller.getCurrentMapVisualAngle().isLongSight()) {
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
|
||||
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
|
||||
} else {
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
|
||||
if(mapBizView != null){
|
||||
IMogoMapUIController uiController = mapBizView.getUI();
|
||||
if(uiController != null){
|
||||
if (uiController.getCurrentMapVisualAngle().isLongSight()) {
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
|
||||
} else if (uiController.getCurrentMapVisualAngle().isMediumSight()) {
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
|
||||
} else {
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -330,7 +330,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
slidePanelView.setText(text);
|
||||
slidePanelView.setVisibility(View.VISIBLE);
|
||||
});
|
||||
setArrivedClikable(false);
|
||||
setArrivedClickable(false);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -338,7 +338,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
*
|
||||
* @param isClickable
|
||||
*/
|
||||
public void setArrivedClikable(boolean isClickable) {
|
||||
public void setArrivedClickable(boolean isClickable) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
tvArrived.setEnabled(isClickable);
|
||||
if (isClickable) {
|
||||
@@ -397,7 +397,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
ctvAutopilotStatus.setBackground(getContext().getDrawable(R.drawable.bus_autopilot_2_status_bg));
|
||||
// ctvAutopilotStatus.setSelected(true);
|
||||
} else if (IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING
|
||||
== autopilotStatus){
|
||||
== autopilotStatus) {
|
||||
ctvAutopilotStatusTv.setText(R.string.bus_pingxing_driver);
|
||||
ctvAutopilotStatus.setClickable(false);
|
||||
ctvAutopilotStatus.setBackground(getContext().getDrawable(R.drawable.pingxingjiashi));
|
||||
@@ -421,12 +421,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
ctvAutopilotStatus.setClickable(false);
|
||||
// ctvAutopilotStatus.setSelected(false);
|
||||
}
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
setAutopilotBtnStatus(autopilotStatus);
|
||||
}
|
||||
}, 1000);
|
||||
UiThreadHandler.postDelayed(() -> setAutopilotBtnStatus(autopilotStatus), 1000);
|
||||
}
|
||||
|
||||
private void changeAutopilotBtnView(int autopilotStatus, boolean isAnimateRunning) {
|
||||
@@ -514,13 +509,10 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
|
||||
private void startingAutoApilotCountDown() {
|
||||
//10s 若自动驾驶没有开启,则结束动画
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() { //未启动成功做处理
|
||||
if (isAnimateRunning) {// 只判断动画是否在进行,根据自动驾驶当前状态去设置自动驾驶状态
|
||||
stopAutopilotAnimation();
|
||||
updateAutopilotStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState());
|
||||
}
|
||||
UiThreadHandler.postDelayed(() -> { //未启动成功做处理
|
||||
if (isAnimateRunning) {// 只判断动画是否在进行,根据自动驾驶当前状态去设置自动驾驶状态
|
||||
stopAutopilotAnimation();
|
||||
updateAutopilotStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState());
|
||||
}
|
||||
}, TIMER_START_AUTOPILOT_INTERVAL);
|
||||
|
||||
@@ -540,8 +532,6 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
|
||||
/**
|
||||
* 迈速表实时更新
|
||||
*
|
||||
* @param newSpeed
|
||||
*/
|
||||
public void updateSpeedView(float newSpeed) {
|
||||
int speed = (int) (Math.abs(newSpeed) * 3.6F); // 倒车时工控机反馈定位信息中speed为负值
|
||||
@@ -553,7 +543,9 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
smallMapView.onDestroy();
|
||||
if(smallMapView != null){
|
||||
smallMapView.onDestroy();
|
||||
}
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().unregisterHostMapListener(TAG);
|
||||
}
|
||||
|
||||
@@ -592,6 +584,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
private TextView trajMd5DPQPTV;
|
||||
private TextView stopMd5DPQPTV;
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
public void showHideTestBar() {
|
||||
if (busTestBar == null) {
|
||||
busTestBar = findViewById(R.id.module_mogo_och_bus_test_bar);
|
||||
@@ -617,6 +610,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
public void updateBusTestBarInfo() {
|
||||
if (busTestBar != null && busTestBar.getVisibility() == View.VISIBLE) {
|
||||
BusRoutesResult routesResult = OrderModel.getInstance().getBusRoutesResult();
|
||||
@@ -628,7 +622,5 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
stopMd5DPQPTV.setText("SMd5DPQP:" + (routesResult == null ? "" : routesResult.txtFileMd5DPQP));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* END
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
package com.mogo.och.bus.fragment;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
|
||||
import static com.mogo.map.MogoMap.DEFAULT;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.data.temp.EventLogout;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
@@ -25,7 +28,6 @@ import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.map.overlay.IMoGoOverlayManager;
|
||||
import com.mogo.map.overlay.core.Level;
|
||||
import com.mogo.map.overlay.point.Point;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.och.bus.R;
|
||||
import com.mogo.och.bus.bean.BusStationBean;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
@@ -42,8 +44,10 @@ import com.mogo.och.common.module.utils.QRUtilsKt;
|
||||
import com.mogo.och.common.module.wigets.BindQRCodeDialog;
|
||||
import com.mogo.och.common.module.wigets.MarqueeTextView;
|
||||
import com.mogo.och.common.module.wigets.OCHCommitDialog;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils;
|
||||
@@ -81,10 +85,11 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
loginService = (LoginService) ARouter.getInstance().build(OchCommonConst.LOGINSERVICE).navigation();
|
||||
if(loginService!=null){
|
||||
loginService.registerFragment(this, getPresenter(),new LoginBusImpl());
|
||||
if (loginService != null) {
|
||||
loginService.registerFragment(this, getPresenter(), new LoginBusImpl());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
@@ -113,12 +118,9 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
|
||||
mSwitchLine.setOnClickListener(this);
|
||||
|
||||
mLineName.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
showHideTestBar();
|
||||
return false;
|
||||
}
|
||||
mLineName.setOnLongClickListener(v -> {
|
||||
showHideTestBar();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -178,7 +180,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
}
|
||||
|
||||
public void updateLineEmptyUI(){
|
||||
setArrivedClikable(false);
|
||||
setArrivedClickable(false);
|
||||
showOrHideSwitchLineBtn(true);
|
||||
hideStationsPanel();
|
||||
hideSlidePanel();
|
||||
@@ -486,30 +488,19 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
.anchor(0.5f, 0.5f)
|
||||
.set3DMode(true)
|
||||
.isUseGps(true)
|
||||
.controlAngle(true)
|
||||
.controlAngle(false)
|
||||
.icon3DRes(resourceId)
|
||||
.latitude(lat)
|
||||
.longitude(longi);
|
||||
IMogoMapUIController mapUIController = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
||||
if (mapUIController != null) {
|
||||
CenterLine centerLine = mapUIController.getCenterLineInfo(
|
||||
longi,lat,-1);
|
||||
if (null != centerLine) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致 地图未初始化会返回空
|
||||
Double angle = centerLine.getAngle();
|
||||
if (angle != null) {
|
||||
builder.rotate(angle.floatValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
IMoGoOverlayManager overlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
|
||||
if (overlayManager != null) {
|
||||
overlayManager.showOrUpdatePoint(builder.build());
|
||||
overlayManager.showOrUpdatePoint(builder.build(), DEFAULT);
|
||||
}
|
||||
};
|
||||
|
||||
OCHThreadPoolManager.getsInstance().execute(setMapMarkerRunnable);
|
||||
|
||||
}else {
|
||||
} else {
|
||||
Runnable removeMapMarkerRunnable = () -> {
|
||||
CallerLogger.d(M_BUS + "RemoveMapMaker="+Thread.currentThread().getName(),
|
||||
uuid+"=latitude="+lat+",longitude="+longi);
|
||||
|
||||
@@ -144,7 +144,7 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
public void hideSlidePanel() {
|
||||
if (mView != null) {
|
||||
mView.hideSlidePanel();
|
||||
mView.setArrivedClikable(true);
|
||||
mView.setArrivedClickable(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
app:isWeatherEnable="false"
|
||||
app:locationIcon3DRes="@raw/xiaoba"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.net.ConnectivityManager
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import com.amap.api.maps.model.LatLng
|
||||
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.commons.module.intent.IMogoIntentListener
|
||||
import com.mogo.commons.module.intent.IntentManager
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener
|
||||
@@ -31,7 +31,6 @@ import com.mogo.eagle.core.network.utils.GsonUtil
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isPassenger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
@@ -42,11 +41,7 @@ import com.mogo.och.bus.passenger.bean.BusPassengerOperationStatusResponse
|
||||
import com.mogo.och.bus.passenger.bean.BusPassengerRoutesResponse
|
||||
import com.mogo.och.bus.passenger.bean.BusPassengerRoutesResult
|
||||
import com.mogo.och.bus.passenger.bean.BusPassengerStation
|
||||
import com.mogo.och.bus.passenger.callback.IBusPassegerDriverStatusCallback
|
||||
import com.mogo.och.bus.passenger.callback.IBusPassengerADASStatusCallback
|
||||
import com.mogo.och.bus.passenger.callback.IBusPassengerAutopilotPlanningCallback
|
||||
import com.mogo.och.bus.passenger.callback.IBusPassengerControllerStatusCallback
|
||||
import com.mogo.och.bus.passenger.callback.IBusPassengerRouteLineInfoCallback
|
||||
import com.mogo.och.bus.passenger.callback.*
|
||||
import com.mogo.och.bus.passenger.constant.BusPassengerConst
|
||||
import com.mogo.och.bus.passenger.network.BusPassengerModelLoopManager
|
||||
import com.mogo.och.bus.passenger.network.BusPassengerServiceManager
|
||||
@@ -82,7 +77,7 @@ import java.util.concurrent.ConcurrentHashMap
|
||||
* Created on 2022/3/31
|
||||
*/
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
object BusPassengerModel{
|
||||
object BusPassengerModel {
|
||||
|
||||
private val TAG = BusPassengerModel::class.java.simpleName
|
||||
private const val MSG_QUERY_BUS_P_STATION = 1001
|
||||
@@ -105,7 +100,7 @@ object BusPassengerModel{
|
||||
var mStations: MutableList<BusPassengerStation> = ArrayList()
|
||||
private var mNextStationIndex = 0 // 要到达站的index
|
||||
private val mTwoStationsRouts: MutableList<MogoLocation> = ArrayList()
|
||||
private val handler = Handler(Handler.Callback { msg ->
|
||||
private val handler = Handler(Looper.getMainLooper(), Handler.Callback { msg ->
|
||||
if (msg.what == MSG_QUERY_BUS_P_STATION) {
|
||||
queryDriverOperationStatus()
|
||||
return@Callback true
|
||||
@@ -119,7 +114,6 @@ object BusPassengerModel{
|
||||
fun init(context: Context) {
|
||||
mContext = context.applicationContext
|
||||
initListeners()
|
||||
// TODO: 2022/3/31
|
||||
queryDriverOperationStatus()
|
||||
startOrStopOrderLoop(true)
|
||||
}
|
||||
@@ -150,8 +144,8 @@ object BusPassengerModel{
|
||||
"queryDriverOperationStatus = %s",
|
||||
data.data.plateNumber
|
||||
)
|
||||
mDriverStatusCallback!!.changeOperationStatus(data.data.driverStatus == 1)
|
||||
mDriverStatusCallback!!.updatePlateNumber(data.data.plateNumber)
|
||||
mDriverStatusCallback?.changeOperationStatus(data.data.driverStatus == 1)
|
||||
mDriverStatusCallback?.updatePlateNumber(data.data.plateNumber)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,9 +176,7 @@ object BusPassengerModel{
|
||||
mNextStationIndex = 0
|
||||
}
|
||||
cleanStation("queryDriverSiteByCoordinate")
|
||||
if (mRouteLineInfoCallback != null) {
|
||||
mRouteLineInfoCallback!!.showNoTaskView()
|
||||
}
|
||||
mRouteLineInfoCallback?.showNoTaskView()
|
||||
mRoutePoints.clear()
|
||||
return
|
||||
}
|
||||
@@ -219,9 +211,12 @@ object BusPassengerModel{
|
||||
|
||||
private fun updatePassengerRouteInfo(result: BusPassengerRoutesResult) {
|
||||
if (mRouteLineInfoCallback != null) {
|
||||
Logger.d(M_BUS_P + TAG, "order = BusPassengerRoutesResult= " +GsonUtil.jsonFromObject(result))
|
||||
mRouteLineInfoCallback!!.updateLineInfo(result.name, result.runningDur)
|
||||
mRouteLineInfoCallback!!.hideNoTaskView()
|
||||
d(
|
||||
M_BUS_P + TAG,
|
||||
"order = BusPassengerRoutesResult= " + GsonUtil.jsonFromObject(result)
|
||||
)
|
||||
mRouteLineInfoCallback?.updateLineInfo(result.name, result.runningDur)
|
||||
mRouteLineInfoCallback?.hideNoTaskView()
|
||||
if (result.sites != null) {
|
||||
val stations = result.sites
|
||||
mStations.clear()
|
||||
@@ -229,9 +224,9 @@ object BusPassengerModel{
|
||||
for (i in stations.indices) {
|
||||
val station = stations[i]
|
||||
if (station.drivingStatus == BusPassengerConst.STATION_STATUS_STOPPED && station.isLeaving && i + 1 < stations.size) { //离站
|
||||
Logger.d(M_BUS_P + TAG, "order = station= leave")
|
||||
d(M_BUS_P + TAG, "order = station= leave")
|
||||
isGoingToNextStation = true
|
||||
mRouteLineInfoCallback!!.updateStationsInfo(stations, i + 1, false)
|
||||
mRouteLineInfoCallback?.updateStationsInfo(stations, i + 1, false)
|
||||
if (mNextStationIndex != i + 1) {
|
||||
mTwoStationsRouts.clear()
|
||||
}
|
||||
@@ -250,9 +245,9 @@ object BusPassengerModel{
|
||||
|
||||
suspendCalculate()
|
||||
|
||||
Logger.d(M_BUS_P + TAG, "order = station= arrive")
|
||||
d(M_BUS_P + TAG, "order = station= arrive")
|
||||
|
||||
mRouteLineInfoCallback!!.updateStationsInfo(stations, i, true)
|
||||
mRouteLineInfoCallback?.updateStationsInfo(stations, i, true)
|
||||
clearAutopilotControlParameters()
|
||||
return
|
||||
}
|
||||
@@ -386,17 +381,17 @@ object BusPassengerModel{
|
||||
override fun distanceCallback(distance: Float) {
|
||||
val lastTime: Double = distance / BusPassengerConst.BUS_AVERAGE_SPEED * 3.6 //秒
|
||||
d(M_BUS_P + TAG, "轨迹排查==lastSumLength = $distance")
|
||||
for (site in routesResult!!.sites) {
|
||||
if (site.drivingStatus == BusPassengerConst.STATION_STATUS_STOPPED && !site.isLeaving) {
|
||||
return
|
||||
routesResult?.let {
|
||||
for (site in it.sites) {
|
||||
if (site.drivingStatus == BusPassengerConst.STATION_STATUS_STOPPED && !site.isLeaving) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mAutopilotPlanningCallback != null) {
|
||||
mAutopilotPlanningCallback!!.routePlanningToNextStationChanged(
|
||||
distance.toLong(),
|
||||
lastTime.toLong()
|
||||
)
|
||||
}
|
||||
mAutopilotPlanningCallback?.routePlanningToNextStationChanged(
|
||||
distance.toLong(),
|
||||
lastTime.toLong()
|
||||
)
|
||||
}
|
||||
}
|
||||
private val trajectoryListener: ITrajectoryListener =
|
||||
@@ -407,19 +402,19 @@ object BusPassengerModel{
|
||||
location: MogoLocation
|
||||
) {
|
||||
if (mAutopilotPlanningCallback != null) {
|
||||
val routeArriviedTemp: MutableList<LatLng> = ArrayList()
|
||||
val routeArrivedTemp: MutableList<LatLng> = ArrayList()
|
||||
val routeArrivingTemp: MutableList<LatLng> = ArrayList()
|
||||
var temp: LatLng
|
||||
for (mogoLocation in routeArrivied) {
|
||||
temp = LatLng(mogoLocation.latitude, mogoLocation.longitude)
|
||||
routeArriviedTemp.add(temp)
|
||||
routeArrivedTemp.add(temp)
|
||||
}
|
||||
for (mogoLocation in routeArriving) {
|
||||
temp = LatLng(mogoLocation.latitude, mogoLocation.longitude)
|
||||
routeArrivingTemp.add(temp)
|
||||
}
|
||||
mAutopilotPlanningCallback!!.routeResult(
|
||||
routeArriviedTemp,
|
||||
mAutopilotPlanningCallback?.routeResult(
|
||||
routeArrivedTemp,
|
||||
routeArrivingTemp,
|
||||
location
|
||||
)
|
||||
@@ -428,16 +423,14 @@ object BusPassengerModel{
|
||||
}
|
||||
private val mReceivedMsgListener: IReceivedMsgListener = object : IReceivedMsgListener {
|
||||
override fun onReceivedServerSn(sn: String?) {
|
||||
Logger.d(M_BUS_P + TAG, "onReceivedServerSn = $sn")
|
||||
if (mDriverStatusCallback != null) {
|
||||
mDriverStatusCallback!!.updateDriverSn(sn)
|
||||
}
|
||||
d(M_BUS_P + TAG, "onReceivedServerSn = $sn")
|
||||
mDriverStatusCallback?.updateDriverSn(sn)
|
||||
}
|
||||
|
||||
override fun onReceivedMsg(type: Int, byteArray: ByteArray) {
|
||||
if (OchCommonConst.BUSINESS_STRING == type) {
|
||||
val baseMsg = GsonUtils.fromJson(String(byteArray), BaseDPMsg::class.java)
|
||||
Logger.d(
|
||||
d(
|
||||
M_BUS_P + TAG,
|
||||
"onReceivedMsg = " + GsonUtils.toJson(baseMsg)
|
||||
)
|
||||
@@ -493,27 +486,29 @@ object BusPassengerModel{
|
||||
private var arriveAtEnd = false //乘客app专用字段
|
||||
override fun onAutopilotStatusResponse(state: Int) {
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
if (mADASStatusCallback != null) mADASStatusCallback!!.onAutopilotRunning()
|
||||
mADASStatusCallback?.onAutopilotRunning()
|
||||
} else {
|
||||
if (FunctionBuildConfig.isDemoMode &&
|
||||
mNextStationIndex>= 0 && mNextStationIndex <= mStations.size - 1
|
||||
&& isGoingToNextStation){
|
||||
mNextStationIndex >= 0 && mNextStationIndex <= mStations.size - 1
|
||||
&& isGoingToNextStation
|
||||
) {
|
||||
d(M_BUS_P + TAG, "FunctionBuildConfig.isDemoMode is true")
|
||||
return
|
||||
}
|
||||
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) {
|
||||
mTwoStationsRouts.clear()
|
||||
if (mADASStatusCallback != null) mADASStatusCallback!!.onAutopilotEnable()
|
||||
mADASStatusCallback?.onAutopilotEnable()
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) {
|
||||
mTwoStationsRouts.clear()
|
||||
if (mADASStatusCallback != null) mADASStatusCallback!!.onAutopilotDisable()
|
||||
mADASStatusCallback?.onAutopilotDisable()
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING) {
|
||||
mTwoStationsRouts.clear()
|
||||
if (mADASStatusCallback != null) mADASStatusCallback!!.onAutopilotRunning()
|
||||
mADASStatusCallback?.onAutopilotRunning()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotArriveAtStation(arrivalNotification: ArrivalNotification?) {
|
||||
if (FunctionBuildConfig.isDemoMode
|
||||
&& isPassenger(FunctionBuildConfig.appIdentityMode)
|
||||
@@ -521,13 +516,10 @@ object BusPassengerModel{
|
||||
arriveAtEnd = true
|
||||
}
|
||||
|
||||
// TODO: 2022/3/31
|
||||
if (DebugConfig.isDebug()) {
|
||||
// ToastUtils.showShort("到达目的地");
|
||||
}
|
||||
if (mADASStatusCallback != null) {
|
||||
mADASStatusCallback!!.onAutopilotArriveEnd()
|
||||
}
|
||||
// if (DebugConfig.isDebug()) {
|
||||
// ToastUtils.showShort("到达目的地");
|
||||
// }
|
||||
mADASStatusCallback?.onAutopilotArriveEnd()
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusRespByQuery(status: SystemStatusInfo.StatusInfo) {}
|
||||
@@ -548,7 +540,8 @@ object BusPassengerModel{
|
||||
|
||||
fun updateRoutePoints(routePoints: List<MessagePad.Location>) {
|
||||
mRoutePoints.clear()
|
||||
val latLngModels: List<MogoLocation> = coordinateConverterWgsToGcjLocations(mContext, routePoints)
|
||||
val latLngModels: List<MogoLocation> =
|
||||
coordinateConverterWgsToGcjLocations(mContext, routePoints)
|
||||
mRoutePoints.addAll(latLngModels)
|
||||
calculateTwoStationsRoute()
|
||||
}
|
||||
@@ -589,9 +582,7 @@ object BusPassengerModel{
|
||||
val sumLength = calculateRouteSumLength(mTwoStationsRouts)
|
||||
SharedPrefsMgr.getInstance(mContext!!)
|
||||
.putInt(BusPassengerConst.BUS_SP_KEY_ORDER_SUM_DIS, sumLength.toInt())
|
||||
if (mAutopilotPlanningCallback != null) {
|
||||
mAutopilotPlanningCallback!!.updateTotalDistance()
|
||||
}
|
||||
mAutopilotPlanningCallback?.updateTotalDistance()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -619,7 +610,7 @@ object BusPassengerModel{
|
||||
setStationPoint(startStation, endStation, lineId.toLong())
|
||||
}
|
||||
|
||||
fun cleanStation(type:String) {
|
||||
fun cleanStation(type: String) {
|
||||
d(M_BUS_P + TAG, "清理站点 $type")
|
||||
setStationPoint(null, null, -1L)
|
||||
}
|
||||
|
||||
@@ -152,8 +152,8 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void routeResult(List<LatLng> routeArrivied,List<LatLng> routeArriving,MogoLocation location) {
|
||||
runOnUIThread(() ->mView.routeResult(routeArrivied,routeArriving,location));
|
||||
public void routeResult(List<LatLng> routeArrived,List<LatLng> routeArriving,MogoLocation location) {
|
||||
runOnUIThread(() ->mView.routeResult(routeArrived,routeArriving,location));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,7 +12,6 @@ import kotlinx.android.synthetic.jinlvvan.p_bus_view_blue_tooth.view.*
|
||||
/**
|
||||
* 魔戒蓝牙控件
|
||||
* 放置于StatusBar右侧位置
|
||||
* todo arrow
|
||||
*/
|
||||
class BusPBlueToothView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.widget.RelativeLayout
|
||||
import com.amap.api.maps.AMap
|
||||
@@ -56,7 +55,7 @@ class BusPassengerMapDirectionView @JvmOverloads constructor(
|
||||
private var mArrivedRes: BitmapDescriptor? = null
|
||||
private var mUnArrivedRes: BitmapDescriptor? = null
|
||||
|
||||
private val routeArrivied: MutableList<LatLng> = ArrayList()
|
||||
private val routeArrived: MutableList<LatLng> = ArrayList()
|
||||
private val routeArriving: MutableList<LatLng> = ArrayList()
|
||||
private var location: MogoLocation? = null
|
||||
|
||||
@@ -165,7 +164,7 @@ class BusPassengerMapDirectionView @JvmOverloads constructor(
|
||||
try {
|
||||
//圈定地图显示范围
|
||||
val boundsBuilder = LatLngBounds.Builder()
|
||||
routeArrivied.forEach {
|
||||
routeArrived.forEach {
|
||||
boundsBuilder.include(it)
|
||||
}
|
||||
routeArriving.forEach {
|
||||
@@ -190,26 +189,28 @@ class BusPassengerMapDirectionView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun drawablePolyline() {
|
||||
if (routeArrivied.isEmpty() && routeArriving.isEmpty()) {
|
||||
if (routeArrived.isEmpty() && routeArriving.isEmpty()) {
|
||||
d(SceneConstant.M_TAXI + TAG, "没有点")
|
||||
return
|
||||
}
|
||||
texIndexList.clear()
|
||||
val allPoints = ArrayList(routeArrivied)
|
||||
for (i in routeArrivied.indices) {
|
||||
if (routeArrivied.size > 1 && i < routeArrivied.size - 1) {
|
||||
val allPoints = ArrayList(routeArrived)
|
||||
for (i in routeArrived.indices) {
|
||||
if (routeArrived.size > 1 && i < routeArrived.size - 1) {
|
||||
texIndexList.add(0)
|
||||
}
|
||||
}
|
||||
texIndexList.add(0)
|
||||
allPoints.add(LatLng(location!!.latitude, location!!.longitude))
|
||||
location?.let {
|
||||
allPoints.add(LatLng(it.latitude, it.longitude))
|
||||
}
|
||||
allPoints.addAll(routeArriving)
|
||||
for (ignored in routeArrivied) {
|
||||
for (ignored in routeArrived) {
|
||||
texIndexList.add(1)
|
||||
}
|
||||
if (mPolyline != null) {
|
||||
mPolyline!!.points = allPoints
|
||||
mPolyline!!.options.customTextureIndex = texIndexList
|
||||
mPolyline?.let {
|
||||
it.points = allPoints
|
||||
it.options.customTextureIndex = texIndexList
|
||||
return
|
||||
}
|
||||
if(textureList.isEmpty()) {
|
||||
@@ -231,10 +232,8 @@ class BusPassengerMapDirectionView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun clearPolyline() {
|
||||
if (mPolyline != null) {
|
||||
mPolyline!!.remove()
|
||||
mPolyline = null
|
||||
}
|
||||
mPolyline?.remove()
|
||||
mPolyline = null
|
||||
}
|
||||
|
||||
override fun setLineMarker() {}
|
||||
@@ -242,7 +241,7 @@ class BusPassengerMapDirectionView @JvmOverloads constructor(
|
||||
fun clearCoordinatesLatLng() {
|
||||
textureList.clear()
|
||||
texIndexList.clear()
|
||||
routeArrivied.clear()
|
||||
routeArrived.clear()
|
||||
routeArriving.clear()
|
||||
mLineStationLatLng.clear()
|
||||
d(M_BUS_P + TAG, " mCoordinatesLatLng.clear ")
|
||||
@@ -265,14 +264,14 @@ class BusPassengerMapDirectionView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
fun setCoordinatesLatLng(
|
||||
routeArrivied: List<LatLng>?,
|
||||
routeArriving: List<LatLng>?,
|
||||
routeArrived: List<LatLng>,
|
||||
routeArriving: List<LatLng>,
|
||||
location: MogoLocation?
|
||||
) {
|
||||
this.routeArrivied.clear()
|
||||
this.routeArrivied.addAll(routeArrivied!!)
|
||||
this.routeArrived.clear()
|
||||
this.routeArrived.addAll(routeArrived)
|
||||
this.routeArriving.clear()
|
||||
this.routeArriving.addAll(routeArriving!!)
|
||||
this.routeArriving.addAll(routeArriving)
|
||||
this.location = location
|
||||
}
|
||||
|
||||
|
||||
@@ -240,9 +240,9 @@ public class BusPassengerRouteFragment extends
|
||||
}
|
||||
}
|
||||
|
||||
public void routeResult(List<LatLng> routeArrivied,List<LatLng> routeArriving,MogoLocation location) {
|
||||
if (routeArrivied.size() > 0||routeArriving.size()>0) {
|
||||
drawablePolyline(routeArrivied,routeArriving,location);
|
||||
public void routeResult(List<LatLng> routeArrived,List<LatLng> routeArriving,MogoLocation location) {
|
||||
if (routeArrived.size() > 0||routeArriving.size()>0) {
|
||||
drawablePolyline(routeArrived,routeArriving,location);
|
||||
} else {
|
||||
clearMapView();
|
||||
}
|
||||
@@ -250,12 +250,10 @@ public class BusPassengerRouteFragment extends
|
||||
|
||||
/**
|
||||
* 绘制
|
||||
*
|
||||
* @param coordinates
|
||||
*/
|
||||
private void drawablePolyline(List<LatLng> routeArrivied,List<LatLng> routeArriving,MogoLocation location) {
|
||||
private void drawablePolyline(List<LatLng> routeArrived,List<LatLng> routeArriving,MogoLocation location) {
|
||||
if (mMapDirectionView != null) {
|
||||
mMapDirectionView.setCoordinatesLatLng(routeArrivied,routeArriving,location);
|
||||
mMapDirectionView.setCoordinatesLatLng(routeArrived,routeArriving,location);
|
||||
UiThreadHandler.post(() -> mMapDirectionView.drawablePolyline());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,13 @@
|
||||
package com.mogo.och.bus.passenger.ui
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.RelativeLayout
|
||||
import androidx.viewpager.widget.PagerAdapter
|
||||
import androidx.viewpager.widget.ViewPager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.och.bus.passenger.ui.MapAndLiveVideoView.Companion.TAG
|
||||
import java.lang.Exception
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
@@ -33,7 +27,7 @@ class MapAndLiveVideoView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
init {
|
||||
initView()
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
@@ -46,53 +40,54 @@ class MapAndLiveVideoView @JvmOverloads constructor(
|
||||
viewPager?.addOnPageChangeListener(this)
|
||||
}
|
||||
|
||||
fun setData(list: MutableList<View>){
|
||||
fun setData(list: MutableList<View>) {
|
||||
pagerAdapter?.setData(list)
|
||||
pagerAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
fun setItemChangeListener(listener : ChangeItemListener?){
|
||||
fun setItemChangeListener(listener: ChangeItemListener?) {
|
||||
changeItemListener = listener
|
||||
}
|
||||
|
||||
fun changeToSecondView(){
|
||||
if (viewPager?.currentItem == 0){
|
||||
fun changeToSecondView() {
|
||||
if (viewPager?.currentItem == 0) {
|
||||
startPosition = 0
|
||||
}
|
||||
viewPager?.currentItem = 1
|
||||
}
|
||||
|
||||
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
|
||||
Logger.d(TAG, "onPageScrolled--position = $position")
|
||||
CallerLogger.d(TAG, "onPageScrolled--position = $position")
|
||||
}
|
||||
|
||||
override fun onPageSelected(position: Int) {
|
||||
Logger.d(TAG, "onPageSelected--position = $position")
|
||||
CallerLogger.d(TAG, "onPageSelected--position = $position")
|
||||
}
|
||||
|
||||
var startPosition = 1
|
||||
override fun onPageScrollStateChanged(state: Int) {
|
||||
Logger.d(TAG, "onPageScrollStateChanged--state = $state")
|
||||
CallerLogger.d(TAG, "onPageScrollStateChanged--state = $state")
|
||||
viewPager?.let {
|
||||
val position = it.currentItem
|
||||
if (state == 0) { //静止
|
||||
if (startPosition == position){
|
||||
if (position==0){
|
||||
if (startPosition == position) {
|
||||
if (position == 0) {
|
||||
it.currentItem = 1
|
||||
}else{
|
||||
} else {
|
||||
it.currentItem = 0
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
changeItemListener?.changeToItem(it.currentItem)
|
||||
}
|
||||
}else if (state == 1){ // 开始滑动
|
||||
} else if (state == 1) { // 开始滑动
|
||||
startPosition = it.currentItem
|
||||
}else{
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface ChangeItemListener{
|
||||
interface ChangeItemListener {
|
||||
fun changeToItem(position: Int)
|
||||
}
|
||||
}
|
||||
@@ -101,25 +96,25 @@ class AdvancePagerAdapter : PagerAdapter(),
|
||||
ViewPager.OnPageChangeListener {
|
||||
private var views: List<View>? = null
|
||||
|
||||
fun setData(views: List<View>?){
|
||||
fun setData(views: List<View>?) {
|
||||
this.views = views
|
||||
}
|
||||
|
||||
override fun instantiateItem(container: View, position: Int): Any {
|
||||
Logger.d(TAG, "instantiateItem--position = $position")
|
||||
CallerLogger.d(TAG, "instantiateItem--position = $position")
|
||||
return try {
|
||||
val currentItem = position % views!!.size
|
||||
(container as ViewPager).addView(views!![currentItem])
|
||||
views!![currentItem]
|
||||
}catch (e: Exception){
|
||||
} catch (e: Exception) {
|
||||
container
|
||||
}
|
||||
}
|
||||
|
||||
override fun getCount(): Int {
|
||||
return if (views == null){
|
||||
return if (views == null) {
|
||||
0
|
||||
}else{
|
||||
} else {
|
||||
views!!.size
|
||||
}
|
||||
}
|
||||
@@ -129,14 +124,14 @@ class AdvancePagerAdapter : PagerAdapter(),
|
||||
}
|
||||
|
||||
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
|
||||
// Logger.d(TAG, "onPageScrolled--position = $position")
|
||||
// CallerLogger.d(TAG, "onPageScrolled--position = $position")
|
||||
}
|
||||
|
||||
override fun onPageSelected(position: Int) {
|
||||
// Logger.d(TAG, "onPageSelected--position = $position")
|
||||
// CallerLogger.d(TAG, "onPageSelected--position = $position")
|
||||
}
|
||||
|
||||
override fun onPageScrollStateChanged(state: Int) {
|
||||
// Logger.d(TAG, "onPageScrollStateChanged--state = $state")
|
||||
// CallerLogger.d(TAG, "onPageScrollStateChanged--state = $state")
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,9 @@
|
||||
android:id="@+id/mapBizView"
|
||||
android:layout_width="1810dp"
|
||||
android:layout_height="match_parent"
|
||||
app:styleMode="MAP_STYLE_DAY_VR"
|
||||
app:isWeatherEnable="false"
|
||||
app:locationIcon3DRes="@raw/xiaoba"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -22,7 +22,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager.initAiCollect
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager.initBadCase
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showToolsView
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView.ClickListener
|
||||
@@ -40,7 +39,7 @@ import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import com.mogo.och.common.module.utils.SoundPoolHelper
|
||||
import kotlinx.android.synthetic.main.charter_base_fragment.*
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import java.util.*
|
||||
import kotlin.math.abs
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
@@ -104,23 +103,20 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
|
||||
updateSwitchMapIcon()
|
||||
mSwitchMapModeLayout!!.setOnClickListener(object : OnPreventFastClickListener() {
|
||||
override fun onClickImpl(v: View) {
|
||||
|
||||
val controller = getMapUIController()
|
||||
if (controller != null) {
|
||||
//切换地图的远近视图
|
||||
if (controller.currentMapVisualAngle.isLongSight) {
|
||||
//Objects.requireNonNull(getMapUIController())
|
||||
// ?.setLockMode(true)
|
||||
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
|
||||
mSwitchMapModeImage!!.setImageResource(R.drawable.bus_switch_map_medium)
|
||||
} else if (controller.currentMapVisualAngle.isMediumSight) {
|
||||
//Objects.requireNonNull(getMapUIController())
|
||||
// ?.setLockMode(false)
|
||||
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null)
|
||||
mSwitchMapModeImage!!.setImageResource(R.drawable.bus_switch_map_long)
|
||||
} else {
|
||||
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
|
||||
mSwitchMapModeImage!!.setImageResource(R.drawable.bus_switch_map_medium)
|
||||
mapBizView?.let {
|
||||
it.getUI()?.let { ui ->
|
||||
if (ui.currentMapVisualAngle.isLongSight) {
|
||||
ui.setLockMode(true)
|
||||
ui.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
|
||||
mSwitchMapModeImage!!.setImageResource(R.drawable.bus_switch_map_medium)
|
||||
} else if (ui.currentMapVisualAngle.isMediumSight) {
|
||||
ui.setLockMode(false)
|
||||
ui.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null)
|
||||
mSwitchMapModeImage!!.setImageResource(R.drawable.bus_switch_map_long)
|
||||
} else {
|
||||
ui.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
|
||||
mSwitchMapModeImage!!.setImageResource(R.drawable.bus_switch_map_medium)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -166,7 +162,6 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
|
||||
|
||||
mSettingBtn = findViewById(R.id.module_mogo_och_setting_layout)
|
||||
mSettingBtn!!.setOnClickListener { v: View? ->
|
||||
// TODO: 2021/12/9
|
||||
showToolsView()
|
||||
}
|
||||
|
||||
@@ -268,14 +263,15 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
|
||||
}
|
||||
|
||||
private fun updateSwitchMapIcon() {
|
||||
val controller = getMapUIController()
|
||||
if (controller != null) {
|
||||
if (controller.currentMapVisualAngle.isLongSight) {
|
||||
mSwitchMapModeImage!!.setImageResource(R.drawable.bus_switch_map_long)
|
||||
} else if (controller.currentMapVisualAngle.isMediumSight) {
|
||||
mSwitchMapModeImage!!.setImageResource(R.drawable.bus_switch_map_medium)
|
||||
} else {
|
||||
mSwitchMapModeImage!!.setImageResource(R.drawable.bus_switch_map_medium)
|
||||
mapBizView?.let {
|
||||
it.getUI()?.let { ui ->
|
||||
if (ui.currentMapVisualAngle.isLongSight) {
|
||||
mSwitchMapModeImage!!.setImageResource(R.drawable.bus_switch_map_long)
|
||||
} else if (ui.currentMapVisualAngle.isMediumSight) {
|
||||
mSwitchMapModeImage!!.setImageResource(R.drawable.bus_switch_map_medium)
|
||||
} else {
|
||||
mSwitchMapModeImage!!.setImageResource(R.drawable.bus_switch_map_medium)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -476,7 +472,7 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
|
||||
* @param newSpeed
|
||||
*/
|
||||
open fun updateSpeedView(newSpeed: Float) {
|
||||
val speed = (Math.abs(newSpeed) * 3.6f).toInt() // 倒车时工控机反馈定位信息中speed为负值
|
||||
val speed = (abs(newSpeed) * 3.6f).toInt() // 倒车时工控机反馈定位信息中speed为负值
|
||||
if (mTrafficDataView != null) {
|
||||
mTrafficDataView!!.updateSpeedWithValue(speed)
|
||||
}
|
||||
@@ -484,7 +480,7 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
smallMapView!!.onDestroy()
|
||||
smallMapView?.onDestroy()
|
||||
mogoMapListenerHandler.unregisterHostMapListener(TAG)
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
app:isWeatherEnable="false"
|
||||
app:locationIcon3DRes="@raw/m1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@ import androidx.fragment.app.FragmentActivity
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager.stepInDayMode
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.och.charter.passenger.constant.CharterPassengerConst
|
||||
|
||||
@@ -80,19 +80,19 @@ class BusPassengerPresenter(view: MainFragment?) :
|
||||
override fun setCarChangeListener(productType: Int?) {
|
||||
when (productType) {
|
||||
OrderInfoResponse.M1_LOVE -> {
|
||||
mView?.setCarModle(R.raw.aiqinghao)
|
||||
mView?.setCarModel(R.raw.aiqinghao)
|
||||
}
|
||||
|
||||
OrderInfoResponse.M1_FAMILY -> {
|
||||
mView?.setCarModle(R.raw.jiatinghao)
|
||||
mView?.setCarModel(R.raw.jiatinghao)
|
||||
}
|
||||
|
||||
OrderInfoResponse.M1_FRIENDLY -> {
|
||||
mView?.setCarModle(R.raw.pengyouhao)
|
||||
mView?.setCarModel(R.raw.pengyouhao)
|
||||
}
|
||||
|
||||
else -> {
|
||||
mView?.setCarModle(R.raw.m1)
|
||||
mView?.setCarModel(R.raw.m1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ class SoftControlViewModel : ViewModel(), LightAirconditionDoorCallback {
|
||||
*/
|
||||
fun openAndSetAircondition(modeCmd: Int, windSpeedCmd: Int, temperatureCmd: Int) {
|
||||
CallerLogger.d(
|
||||
M_BUS_P + TAG, "" + "打开空调,模式$modeCmd--档位${windSpeedCmd}--温度:$temperatureCmd"
|
||||
M_BUS_P + TAG, "打开空调,模式$modeCmd--档位${windSpeedCmd}--温度:$temperatureCmd"
|
||||
)
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1AirConditionerCmd(
|
||||
1, modeCmd, windSpeedCmd, temperatureCmd
|
||||
|
||||
@@ -7,12 +7,14 @@
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
android:layout_width="0dp"
|
||||
app:layout_constraintWidth_percent="0.662"
|
||||
app:styleMode="MAP_STYLE_DAY_VR"
|
||||
app:isWeatherEnable="false"
|
||||
app:locationIcon3DRes="@raw/m1"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_percent="0.662" />
|
||||
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
<com.mogo.eagle.core.function.view.OverMapView
|
||||
android:id="@+id/omvOverMap"
|
||||
android:layout_width="0dp"
|
||||
|
||||
@@ -62,13 +62,11 @@ dependencies {
|
||||
api project(":OCH:mogo-och-data")
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
api rootProject.ext.dependencies.mogoutils
|
||||
api rootProject.ext.dependencies.mogocommons
|
||||
api rootProject.ext.dependencies.mogo_core_function_call
|
||||
api rootProject.ext.dependencies.mogo_core_function_hmi
|
||||
api rootProject.ext.dependencies.mogo_core_function_map
|
||||
}else {
|
||||
api project(":core:mogo-core-utils")
|
||||
api project(":foudations:mogo-commons")
|
||||
api project(':core:mogo-core-function-call')
|
||||
api project(':core:function-impl:mogo-core-function-hmi')
|
||||
|
||||
@@ -35,11 +35,7 @@ public class DateTimeUtil {
|
||||
public static boolean compareDateIsCurrentDay(Calendar targetCalendar){
|
||||
Calendar currentCale = DateTimeUtils.getCurrentDateTime();
|
||||
String currentDay = formatCalendarToString(currentCale, yyyy_MM_dd);
|
||||
if (currentDay.equals(formatCalendarToString(targetCalendar, yyyy_MM_dd))){
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
return currentDay.equals(formatCalendarToString(targetCalendar, yyyy_MM_dd));
|
||||
}
|
||||
|
||||
public static Calendar formatLongToCalendar(long time){
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/clHmiContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugViewTrigger
|
||||
android:layout_width="@dimen/dp_400"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
@@ -19,23 +13,6 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!--刹车、转向-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.SteeringBrakeView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--V2X预警红色边框-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@@ -81,169 +58,6 @@
|
||||
app:layout_constraintLeft_toLeftOf="@+id/viewSpeedChart"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewSpeedChart" />
|
||||
|
||||
<!--超视距-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.CameraView
|
||||
android:id="@+id/ivCameraIcon"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginTop="45dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
app:layout_constraintRight_toLeftOf="@id/viewTrafficLightVr"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!--限速牌子-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
|
||||
android:id="@+id/viewLimitingVelocity"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
android:text="60"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="60dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!--红绿灯-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
|
||||
android:id="@+id/viewTrafficLightVr"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/hmi_traffic_light_layout_margin_top"
|
||||
android:layout_marginEnd="@dimen/hmi_traffic_light_layout_margin_right"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--地图视角切换-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.PerspectiveSwitchView
|
||||
android:id="@+id/viewPerspectiveSwitch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="50dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:elevation="@dimen/dp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!--工具箱-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.tools.ToolsImageView
|
||||
android:id="@+id/ivToolsView"
|
||||
android:layout_width="@dimen/module_hmi_check_size"
|
||||
android:layout_height="@dimen/module_hmi_check_size"
|
||||
android:layout_marginStart="25dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:contentDescription="工具箱"
|
||||
android:elevation="@dimen/dp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/viewPerspectiveSwitch"
|
||||
app:layout_goneMarginStart="50dp" />
|
||||
|
||||
<!--问题反馈-->
|
||||
<ImageView
|
||||
android:id="@+id/ivBadCaseTools"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginStart="50dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:contentDescription="BadCase"
|
||||
android:src="@drawable/bad_case_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/ivToolsView" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivAiCollectTools"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginStart="50dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:contentDescription="数据采集"
|
||||
android:src="@drawable/ai_collect_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/ivBadCaseTools" />
|
||||
|
||||
<View
|
||||
android:id="@+id/viewUpgradeTips"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:background="@drawable/version_upgrade_tips_background"
|
||||
android:translationZ="30dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintCircle="@id/ivToolsView"
|
||||
app:layout_constraintCircleAngle="45"
|
||||
app:layout_constraintCircleRadius="60dp"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<!--消息盒子司机端选择入口-->
|
||||
<CheckBox
|
||||
android:id="@+id/cbMsgBoxDriver"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:background="@drawable/selector_msg_box"
|
||||
android:button="@null"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon" />
|
||||
|
||||
<!--司机端消息提示-->
|
||||
<View
|
||||
android:id="@+id/MsgBoxTipView"
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="8dp"
|
||||
android:background="@drawable/version_upgrade_tips_background"
|
||||
android:translationZ="30dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintCircle="@id/cbMsgBoxDriver"
|
||||
app:layout_constraintCircleAngle="40"
|
||||
app:layout_constraintCircleRadius="32dp"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView
|
||||
android:id="@+id/viewDriverMsgBoxList"
|
||||
android:layout_width="864px"
|
||||
android:layout_height="746px"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView
|
||||
android:id="@+id/viewDriverMsgBoxBubble"
|
||||
android:layout_width="864px"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<!--左右转向灯-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.TurnLightViewStatus
|
||||
android:id="@+id/turnLightView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="42dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--刹车ui-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.BrakeViewStatus
|
||||
android:id="@+id/brakeView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="42dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -10,7 +10,6 @@ import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
|
||||
@@ -28,8 +28,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView;
|
||||
@@ -140,21 +138,21 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
mSwitchMapModeLayout.setOnClickListener(new OnPreventFastClickListener() {
|
||||
@Override
|
||||
public void onClickImpl(View v) {
|
||||
|
||||
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
||||
if (controller != null) {
|
||||
//切换地图的远近视图
|
||||
if (controller.getCurrentMapVisualAngle().isLongSight()) {
|
||||
//Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true);
|
||||
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
|
||||
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
|
||||
//Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
|
||||
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
|
||||
} else {
|
||||
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
|
||||
if(mapBizView != null){
|
||||
IMogoMapUIController uiController = mapBizView.getUI();
|
||||
if(uiController != null){
|
||||
if (uiController.getCurrentMapVisualAngle().isLongSight()) {
|
||||
uiController.setLockMode(true);
|
||||
uiController.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
|
||||
} else if (uiController.getCurrentMapVisualAngle().isMediumSight()) {
|
||||
uiController.setLockMode(false);
|
||||
uiController.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
|
||||
} else {
|
||||
uiController.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -263,14 +261,16 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
protected abstract void onArriveStation();
|
||||
|
||||
private void updateSwitchMapIcon() {
|
||||
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
||||
if (controller != null) {
|
||||
if (controller.getCurrentMapVisualAngle().isLongSight()) {
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
|
||||
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
|
||||
} else {
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
|
||||
if(mapBizView != null){
|
||||
IMogoMapUIController uiController = mapBizView.getUI();
|
||||
if(uiController != null){
|
||||
if (uiController.getCurrentMapVisualAngle().isLongSight()) {
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
|
||||
} else if (uiController.getCurrentMapVisualAngle().isMediumSight()) {
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
|
||||
} else {
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -560,7 +560,9 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
smallMapView.onDestroy();
|
||||
if(smallMapView != null){
|
||||
smallMapView.onDestroy();
|
||||
}
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().unregisterHostMapListener(TAG);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.mogo.och.bus.fragment;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
|
||||
import static com.mogo.map.MogoMap.DEFAULT;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
@@ -15,9 +17,7 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.data.temp.EventLogout;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
@@ -28,7 +28,6 @@ import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.map.overlay.IMoGoOverlayManager;
|
||||
import com.mogo.map.overlay.core.Level;
|
||||
import com.mogo.map.overlay.point.Point;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.och.bus.R;
|
||||
import com.mogo.och.data.bean.BusStationBean;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
@@ -493,24 +492,13 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
.anchor(0.5f, 0.5f)
|
||||
.set3DMode(true)
|
||||
.isUseGps(true)
|
||||
.controlAngle(true)
|
||||
.controlAngle(false)
|
||||
.icon3DRes(resourceId)
|
||||
.latitude(lat)
|
||||
.longitude(longi);
|
||||
IMogoMapUIController mapUIController = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
||||
if (mapUIController != null) {
|
||||
CenterLine centerLine = mapUIController.getCenterLineInfo(
|
||||
longi,lat,-1);
|
||||
if (null != centerLine) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致 地图未初始化会返回空
|
||||
Double angle = centerLine.getAngle();
|
||||
if (angle != null) {
|
||||
builder.rotate(angle.floatValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
IMoGoOverlayManager overlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
|
||||
if (overlayManager != null) {
|
||||
overlayManager.showOrUpdatePoint(builder.build());
|
||||
overlayManager.showOrUpdatePoint(builder.build(),DEFAULT);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
app:isWeatherEnable="false"
|
||||
app:locationIcon3DRes="@raw/m2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ import kotlinx.android.synthetic.jinlvvan.p_bus_view_blue_tooth.view.*
|
||||
/**
|
||||
* 魔戒蓝牙控件
|
||||
* 放置于StatusBar右侧位置
|
||||
* todo arrow
|
||||
*/
|
||||
class BusPBlueToothView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
android:id="@+id/mapBizView"
|
||||
android:layout_width="1810dp"
|
||||
android:layout_height="match_parent"
|
||||
app:styleMode="MAP_STYLE_DAY_VR"
|
||||
app:isWeatherEnable="false"
|
||||
app:locationIcon3DRes="@raw/m2"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getOverla
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.map.overlay.core.Level
|
||||
import com.mogo.map.overlay.point.Point
|
||||
import com.mogo.map.MapDataWrapper
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.constant.M2Const.Companion.TYPE_MARKER_M2_LINE
|
||||
import com.mogo.och.bus.passenger.presenter.PM2ADASPresenter
|
||||
@@ -80,8 +81,10 @@ class PM2HPMapFragment :
|
||||
) {
|
||||
//开启线程执行起终点marker设置
|
||||
val setMapMarkerRunnable = Runnable {
|
||||
d("setMapMaker= " + Thread.currentThread().name,
|
||||
uuid + "=latitude=" + station[1] + ",longitude=" + station[0])
|
||||
d(
|
||||
"setMapMaker= " + Thread.currentThread().name,
|
||||
uuid + "=latitude=" + station[1] + ",longitude=" + station[0]
|
||||
)
|
||||
|
||||
val builder = Point.Options.Builder(
|
||||
TYPE_MARKER_M2_LINE,
|
||||
@@ -95,16 +98,12 @@ class PM2HPMapFragment :
|
||||
.icon3DRes(R.raw.star_marker)
|
||||
.longitude(station[0])
|
||||
.latitude(station[1])
|
||||
val mapUIController = getMapUIController()
|
||||
if (mapUIController != null) {
|
||||
val centerLine = mapUIController.getCenterLineInfo(
|
||||
station[0], station[1], -1f
|
||||
)
|
||||
if (null != centerLine) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致 地图未初始化会返回空
|
||||
val angle = centerLine.angle
|
||||
if (angle != null) {
|
||||
builder.rotate(angle.toFloat())
|
||||
}
|
||||
MapDataWrapper.getCenterLineInfo(
|
||||
station[0], station[1], -1f
|
||||
) {
|
||||
// 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致 地图未初始化会返回空
|
||||
it?.let{
|
||||
builder.rotate(it.angle.toFloat())
|
||||
}
|
||||
}
|
||||
val overlayManager = getOverlayManager()
|
||||
|
||||
@@ -12,7 +12,6 @@ import kotlinx.android.synthetic.m2.p_m2_view_blue_tooth.view.*
|
||||
/**
|
||||
* 魔戒蓝牙控件
|
||||
* 放置于StatusBar右侧位置
|
||||
* todo arrow
|
||||
*/
|
||||
class M2BlueToothView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
|
||||
@@ -5,9 +5,13 @@
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<!-- 高精地图 -->
|
||||
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
app:styleMode="MAP_STYLE_DAY_VR"
|
||||
app:carPosition="-0.5"
|
||||
app:default_perspective="MAP_STYLE_VR_ERHAI_B2"
|
||||
app:isWeatherEnable="false"
|
||||
app:locationIcon3DRes="@raw/m2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@ import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.och.common.module.manager.autopilotmanager.OCHAdasAbilityManager;
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
|
||||
@@ -53,7 +52,6 @@ import com.zhjt.mogo.adas.data.AiCloudTask;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
|
||||
@@ -44,9 +44,8 @@ import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask.TaskModel
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.cloud.s_r.SweeperTaskCloudSuspendResume
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.confirm.SweeperTaskConfirm
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.stop.SweeperTaskStop
|
||||
import kotlinx.android.synthetic.main.fragment_och_sweeper.sweeper_cl_work_mode
|
||||
import kotlinx.android.synthetic.main.fragment_och_sweeper.sweeper_current_task_view
|
||||
import kotlinx.android.synthetic.main.sweeper_no_data_common_view.noTaskDataView
|
||||
import kotlinx.android.synthetic.main.fragment_och_sweeper.*
|
||||
import kotlinx.android.synthetic.main.sweeper_no_data_common_view.*
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@@ -148,7 +147,8 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
getCurrentTaskView().updateStartAutoPilotBtnByAutoPilotState(
|
||||
state == STATUS_AUTOPILOT_ENABLE,
|
||||
mCurrentRunningSubTaskInfo?.taskModel == TaskModel.AUTO,
|
||||
mCurrentRunningSubTaskInfo?.taskStatus == TaskStatus.RUNNING)
|
||||
mCurrentRunningSubTaskInfo?.taskStatus == TaskStatus.RUNNING
|
||||
)
|
||||
}
|
||||
|
||||
fun onSweeperFutianCleanSystemState(cleanSystemState: ChassisStatesOuterClass.SweeperFuTianTaskSystemStates) {
|
||||
@@ -293,7 +293,7 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
if (subTaskList[index].subTaskId == subTaskId) {
|
||||
val subBuilder = subTaskList[index].toBuilder()
|
||||
subBuilder.taskStatus = subTaskStatus
|
||||
if (subTaskStatus == SweeperCommon.TaskStatus.RUNNING) {
|
||||
if (subTaskStatus == TaskStatus.RUNNING) {
|
||||
mCurrentRunningSubTaskInfo = subBuilder.build()
|
||||
//更新当前正在执行的任务状态
|
||||
updateCurrentSubTaskInfo(index + 1)
|
||||
@@ -303,13 +303,13 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
} else {
|
||||
mCurrentRunningSubTaskInfo = null
|
||||
}
|
||||
if (subTaskStatus == SweeperCommon.TaskStatus.SUSPENDED) {
|
||||
if (subTaskStatus == TaskStatus.SUSPENDED) {
|
||||
mCurrentSuspendSubTaskInfo = subBuilder.build()
|
||||
} else {
|
||||
mCurrentSuspendSubTaskInfo = null
|
||||
}
|
||||
//判断是否结束子任务
|
||||
if (subTaskStatus == SweeperCommon.TaskStatus.FINISHED) {
|
||||
if (subTaskStatus == TaskStatus.FINISHED) {
|
||||
//已完成的计入任务进度,未完成的不计入
|
||||
ToastUtils.showLong("任务完成")
|
||||
showNotice("任务完成")
|
||||
@@ -317,8 +317,8 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
removeHDMapMarkerBySubTask(subTaskList[index])
|
||||
}
|
||||
// 其他异常结束时也需要remove marker
|
||||
if (subTaskStatus == SweeperCommon.TaskStatus.ABNORMAL ||
|
||||
subTaskStatus == SweeperCommon.TaskStatus.CANCEL
|
||||
if (subTaskStatus == TaskStatus.ABNORMAL ||
|
||||
subTaskStatus == TaskStatus.CANCEL
|
||||
) {
|
||||
removeHDMapMarkerBySubTask(subTaskList[index])
|
||||
}
|
||||
@@ -384,7 +384,10 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
// mLoadingDialog.showLoading()
|
||||
// //ToastUtils.showLong("确认")
|
||||
// 发送接收到信息的ACK回执
|
||||
mPresenter?.sendSweeperStopTaskResp(taskId, SweeperTaskStop.StopTaskCode.RECEIVED)
|
||||
mPresenter?.sendSweeperStopTaskResp(
|
||||
taskId,
|
||||
SweeperTaskStop.StopTaskCode.RECEIVED
|
||||
)
|
||||
}
|
||||
|
||||
override fun onRefuseOrEnd() {
|
||||
@@ -398,7 +401,10 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
// mLoadingDialog.showLoading()
|
||||
// //ToastUtils.showLong("倒计时")
|
||||
// 发送接收到信息的ACK回执
|
||||
mPresenter?.sendSweeperStopTaskResp(taskId, SweeperTaskStop.StopTaskCode.RECEIVED)
|
||||
mPresenter?.sendSweeperStopTaskResp(
|
||||
taskId,
|
||||
SweeperTaskStop.StopTaskCode.RECEIVED
|
||||
)
|
||||
}
|
||||
|
||||
override fun onNext() {
|
||||
@@ -468,7 +474,11 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
/**
|
||||
* 云端同步大任务状态
|
||||
*/
|
||||
fun onSweeperCloudBigTaskStatus(taskId: String, bigTaskStatus: SweeperCommon.TaskStatus, isPop: Boolean) {
|
||||
fun onSweeperCloudBigTaskStatus(
|
||||
taskId: String,
|
||||
bigTaskStatus: SweeperCommon.TaskStatus,
|
||||
isPop: Boolean
|
||||
) {
|
||||
//隐藏loading
|
||||
mLoadingDialog.hideLoading()
|
||||
mTaskInfo?.let {
|
||||
@@ -477,16 +487,17 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
return
|
||||
}
|
||||
//大任务处于取消状态/异常结束/正常结束 时都代表大任务结束了,任务列表切换为无任务列表状态
|
||||
if (bigTaskStatus == SweeperCommon.TaskStatus.CANCEL
|
||||
|| bigTaskStatus == SweeperCommon.TaskStatus.ABNORMAL
|
||||
|| bigTaskStatus == SweeperCommon.TaskStatus.FINISHED
|
||||
if (bigTaskStatus == TaskStatus.CANCEL
|
||||
|| bigTaskStatus == TaskStatus.ABNORMAL
|
||||
|| bigTaskStatus == TaskStatus.FINISHED
|
||||
) {
|
||||
mPresenter?.isHasTaskInfo(false)
|
||||
if (isPop) {
|
||||
mDialog = if (bigTaskStatus == SweeperCommon.TaskStatus.CANCEL
|
||||
|| bigTaskStatus == SweeperCommon.TaskStatus.ABNORMAL){
|
||||
sweeperCloudTaskExceptionEndDialog(bigTaskStatus == SweeperCommon.TaskStatus.CANCEL)}
|
||||
else
|
||||
mDialog = if (bigTaskStatus == TaskStatus.CANCEL
|
||||
|| bigTaskStatus == TaskStatus.ABNORMAL
|
||||
) {
|
||||
sweeperCloudTaskExceptionEndDialog(bigTaskStatus == TaskStatus.CANCEL)
|
||||
} else
|
||||
sweeperCloudTaskNormalEndDialog()
|
||||
mDialog?.show()
|
||||
}
|
||||
@@ -495,29 +506,29 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
// 大任务这里也判断移除HD Marker, 双重判断
|
||||
removeHDMapMarkerBySubTask(mCurrentRunningSubTaskInfo)
|
||||
resetTaskInfoPanel()
|
||||
} else if (bigTaskStatus == SweeperCommon.TaskStatus.SUSPENDED) {// 暂停
|
||||
} else if (bigTaskStatus == TaskStatus.SUSPENDED) {// 暂停
|
||||
showNotice("任务已暂停")
|
||||
ToastUtils.showLong("任务已暂停")
|
||||
//更新任务列表中大任务状态
|
||||
val builder = it.toBuilder()
|
||||
builder.taskStatus = SweeperCommon.TaskStatus.SUSPENDED
|
||||
builder.taskStatus = TaskStatus.SUSPENDED
|
||||
mTaskInfo = builder.build()
|
||||
getCurrentTaskView().setData(mTaskInfo, getCurrentRunningSubTaskPosition())
|
||||
} else if (it.taskStatus == SweeperCommon.TaskStatus.SUSPENDED
|
||||
&& bigTaskStatus == SweeperCommon.TaskStatus.RUNNING
|
||||
} else if (it.taskStatus == TaskStatus.SUSPENDED
|
||||
&& bigTaskStatus == TaskStatus.RUNNING
|
||||
) { //恢复
|
||||
showNotice("任务已恢复")
|
||||
ToastUtils.showLong("任务已恢复")
|
||||
|
||||
//更新任务列表中大任务状态
|
||||
val builder = it.toBuilder()
|
||||
builder.taskStatus = SweeperCommon.TaskStatus.RUNNING
|
||||
builder.taskStatus = TaskStatus.RUNNING
|
||||
mTaskInfo = builder.build()
|
||||
getCurrentTaskView().setData(mTaskInfo, getCurrentRunningSubTaskPosition())
|
||||
} else if (bigTaskStatus == SweeperCommon.TaskStatus.RUNNING) { //首次开始运行的时候,非恢复后的运行
|
||||
} else if (bigTaskStatus == TaskStatus.RUNNING) { //首次开始运行的时候,非恢复后的运行
|
||||
//更新任务列表中大任务状态
|
||||
val builder = it.toBuilder()
|
||||
builder.taskStatus = SweeperCommon.TaskStatus.RUNNING
|
||||
builder.taskStatus = TaskStatus.RUNNING
|
||||
mTaskInfo = builder.build()
|
||||
getCurrentTaskView().setData(mTaskInfo, getCurrentRunningSubTaskPosition())
|
||||
}
|
||||
@@ -637,7 +648,7 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
mSubMutableList = mTaskInfo?.subListList
|
||||
mSubMutableList?.apply {
|
||||
for (index in 0 until size) {
|
||||
if (get(index).taskStatus == SweeperCommon.TaskStatus.RUNNING) {
|
||||
if (get(index).taskStatus == TaskStatus.RUNNING) {
|
||||
mCurrentRunningSubTaskInfo = get(index)
|
||||
updateCurrentSubTaskInfo(index + 1)
|
||||
return index
|
||||
@@ -691,7 +702,7 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
if (mTaskInfo?.taskId != taskId) return
|
||||
val subInfo = getSubTaskInfoBySubId(subTaskId)
|
||||
subInfo?.let {
|
||||
updateSubTaskInfo(taskId, subTaskId, SweeperCommon.TaskStatus.RUNNING)
|
||||
updateSubTaskInfo(taskId, subTaskId, TaskStatus.RUNNING)
|
||||
|
||||
if (isPop) {
|
||||
showSubTaskConfirmDialog(taskId, subTaskId, it)
|
||||
@@ -858,7 +869,10 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
/**
|
||||
* 大任务恢复弹框
|
||||
*/
|
||||
private fun sweeperCloudTaskResumeDialog(contentStr: String, taskId: String): SweeperCloudDialog? {
|
||||
private fun sweeperCloudTaskResumeDialog(
|
||||
contentStr: String,
|
||||
taskId: String
|
||||
): SweeperCloudDialog? {
|
||||
return createSweeperTaskResumeDialog(context, object : SweeperCloudDialogClickListener {
|
||||
override fun onConfirm() {
|
||||
// 发送接收到信息的ACK回执
|
||||
@@ -901,8 +915,18 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
val hdMarkerIdStart = "marker_sweeper_subtask_${subTask.subTaskId}_start"
|
||||
val hdMarkerIdEnd = "marker_sweeper_subtask_${subTask.subTaskId}_end"
|
||||
|
||||
val setStartMarkerRunnable = createSetHDMapMakerRunnable(hdMarkerIdStart, startPoint.wgsLongitude, startPoint.wgsLatitude, true)
|
||||
val setEndMarkerRunnable = createSetHDMapMakerRunnable(hdMarkerIdEnd, endPoint.wgsLongitude, endPoint.wgsLatitude, false)
|
||||
val setStartMarkerRunnable = createSetHDMapMakerRunnable(
|
||||
hdMarkerIdStart,
|
||||
startPoint.wgsLongitude,
|
||||
startPoint.wgsLatitude,
|
||||
true
|
||||
)
|
||||
val setEndMarkerRunnable = createSetHDMapMakerRunnable(
|
||||
hdMarkerIdEnd,
|
||||
endPoint.wgsLongitude,
|
||||
endPoint.wgsLatitude,
|
||||
false
|
||||
)
|
||||
val removeMarkerRunnable = createRemoveHDMapMakerRunnable()
|
||||
|
||||
val addSubTaskHDMarkRunnable = Runnable {
|
||||
@@ -930,11 +954,11 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
longitude: Double,
|
||||
latitude: Double,
|
||||
isStartMarker: Boolean
|
||||
) : Runnable {
|
||||
): Runnable {
|
||||
//开启线程执行起终点marker设置
|
||||
val setMapMarkerRunnable = Runnable {
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_SWEEPER + "-" +TAG + "-setMapMaker",
|
||||
SceneConstant.M_SWEEPER + "-" + TAG + "-setMapMaker",
|
||||
"threadName=${Thread.currentThread().name}, uuid=$uuid, latitude=$latitude, longitude=$longitude"
|
||||
)
|
||||
|
||||
@@ -944,20 +968,10 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
.anchor(0.5f, 0.5f)
|
||||
.set3DMode(true)
|
||||
.isUseGps(true)
|
||||
.controlAngle(true)
|
||||
.controlAngle(false)
|
||||
.icon3DRes(if (isStartMarker) R.raw.star_marker else R.raw.end_marker)
|
||||
.longitude(longitude)
|
||||
.latitude(latitude)
|
||||
val mapUIController = CallerMapUIServiceManager.getMapUIController()
|
||||
if (mapUIController != null) {
|
||||
val centerLine = mapUIController.getCenterLineInfo(longitude, latitude, -1f)
|
||||
if (null != centerLine) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致 地图未初始化会返回空
|
||||
val angle = centerLine.angle
|
||||
if (angle != null) {
|
||||
builder.rotate(angle.toFloat())
|
||||
}
|
||||
}
|
||||
}
|
||||
val overlayManager = CallerMapUIServiceManager.getOverlayManager()
|
||||
overlayManager?.showOrUpdatePoint(builder.build())
|
||||
}
|
||||
@@ -967,11 +981,11 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
/**
|
||||
* 移除高精地图里的Marker Runnable
|
||||
*/
|
||||
private fun createRemoveHDMapMakerRunnable() : Runnable{
|
||||
private fun createRemoveHDMapMakerRunnable(): Runnable {
|
||||
//开启线程移除起终点marker设置
|
||||
val removeMapMarkerRunnable = Runnable {
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_SWEEPER + "-" +TAG + "-RemoveMapMaker",
|
||||
SceneConstant.M_SWEEPER + "-" + TAG + "-RemoveMapMaker",
|
||||
"threadName=${Thread.currentThread().name}"
|
||||
)
|
||||
val overlayManager = CallerMapUIServiceManager.getOverlayManager()
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.zhjt.mogo.adas.data.sweeper.task.big.SweeperBigTaskStatus
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.confirm.SweeperTaskConfirm.TaskConfirm
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.status.SweeperTaskStatus
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.stop.SweeperTaskStop
|
||||
import java.util.UUID
|
||||
import java.util.*
|
||||
|
||||
object SweeperCloudTaskUtils {
|
||||
const val TAG = "SweeperCloudTaskUtils"
|
||||
@@ -66,10 +66,10 @@ object SweeperCloudTaskUtils {
|
||||
subBuilder0.taskStatus = SweeperCommon.TaskStatus.TO_START
|
||||
val startLocation0 = Location.newBuilder()
|
||||
startLocation0.siteName = "自动驾驶子任务起点0"
|
||||
startLocation0.wgsLongitude =112.56970262448544
|
||||
startLocation0.wgsLongitude = 112.56970262448544
|
||||
startLocation0.wgsLatitude = 26.817567832504274
|
||||
startLocation0.longitude = 112.57493487730413
|
||||
startLocation0.latitude = 26.81397095451884
|
||||
startLocation0.latitude = 26.81397095451884
|
||||
subBuilder0.startLocation = startLocation0.build()
|
||||
val endLocation0 = Location.newBuilder()
|
||||
endLocation0.siteName = "自动驾驶子任务终点0"
|
||||
@@ -156,7 +156,10 @@ object SweeperCloudTaskUtils {
|
||||
System.currentTimeMillis(),
|
||||
builder.build()
|
||||
)
|
||||
CallerLogger.d(SceneConstant.M_SWEEPER + TAG, "messageType:" + messageType.number + "taskInfo:" + printMessage(builder.build()))
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_SWEEPER + TAG,
|
||||
"messageType:" + messageType.number + "taskInfo:" + printMessage(builder.build())
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -244,28 +247,21 @@ object SweeperCloudTaskUtils {
|
||||
*/
|
||||
@JvmStatic
|
||||
fun mockAddHdMarker(uuid: String, longitude: Double, latitude: Double, isStartMarker: Boolean) {
|
||||
//开启线程执行起终点marker设置
|
||||
//开启线程执行起终点marker设置
|
||||
val setMapMarkerRunnable = Runnable {
|
||||
val builder =
|
||||
Point.Options.Builder(SweeperConst.TYPE_MARKER_SWEEPER_SUBTASK_START_END, Level.MAP_MARKER)
|
||||
Point.Options.Builder(
|
||||
SweeperConst.TYPE_MARKER_SWEEPER_SUBTASK_START_END,
|
||||
Level.MAP_MARKER
|
||||
)
|
||||
.setId(uuid)
|
||||
.anchor(0.5f, 0.5f)
|
||||
.set3DMode(true)
|
||||
.isUseGps(true)
|
||||
.controlAngle(true)
|
||||
.controlAngle(false)
|
||||
.icon3DRes(if (isStartMarker) R.raw.star_marker else R.raw.end_marker)
|
||||
.longitude(longitude)
|
||||
.latitude(latitude)
|
||||
val mapUIController = CallerMapUIServiceManager.getMapUIController()
|
||||
if (mapUIController != null) {
|
||||
val centerLine = mapUIController.getCenterLineInfo(longitude, latitude, -1f)
|
||||
if (null != centerLine) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致 地图未初始化会返回空
|
||||
val angle = centerLine.angle
|
||||
if (angle != null) {
|
||||
builder.rotate(angle.toFloat())
|
||||
}
|
||||
}
|
||||
}
|
||||
val overlayManager = CallerMapUIServiceManager.getOverlayManager()
|
||||
Log.d(TAG, "CallerMapUIServiceManager.getOverlayManager()=$overlayManager")
|
||||
overlayManager?.showOrUpdatePoint(builder.build())
|
||||
@@ -294,18 +290,23 @@ object SweeperCloudTaskUtils {
|
||||
* 创建接收大任务弹窗
|
||||
*/
|
||||
@JvmStatic
|
||||
fun createReceivedBigTaskInfoDialog(context: Context?, listener: SweeperCloudDialogClickListener?, taskInfo: TaskInfo): SweeperCloudDialog? {
|
||||
var builder: SweeperCloudDialog.Builder = SweeperCloudDialog.Builder()
|
||||
fun createReceivedBigTaskInfoDialog(
|
||||
context: Context?,
|
||||
listener: SweeperCloudDialogClickListener?,
|
||||
taskInfo: TaskInfo
|
||||
): SweeperCloudDialog? {
|
||||
val builder: SweeperCloudDialog.Builder = SweeperCloudDialog.Builder()
|
||||
val startCalendar = DateTimeUtil.formatLongToCalendar(taskInfo.taskStartTime)
|
||||
val endCalendar = DateTimeUtil.formatLongToCalendar(taskInfo.taskEndTime)
|
||||
builder.titleStr = "任务接取"
|
||||
builder.contentStr = "已为您接取任务${taskInfo.taskName}"
|
||||
builder.tipStr = "(任务时间${DateTimeUtil.formatCalendarToString(startCalendar, DateTimeUtil.HH_mm)}-${
|
||||
DateTimeUtil.formatCalendarToString(
|
||||
endCalendar,
|
||||
DateTimeUtil.HH_mm
|
||||
)
|
||||
})"
|
||||
builder.tipStr =
|
||||
"(任务时间${DateTimeUtil.formatCalendarToString(startCalendar, DateTimeUtil.HH_mm)}-${
|
||||
DateTimeUtil.formatCalendarToString(
|
||||
endCalendar,
|
||||
DateTimeUtil.HH_mm
|
||||
)
|
||||
})"
|
||||
builder.leftStr = "确认"
|
||||
builder.middleStr = ""
|
||||
builder.rightStr = ""
|
||||
@@ -323,7 +324,7 @@ object SweeperCloudTaskUtils {
|
||||
listener: SweeperCloudDialogClickListener?,
|
||||
subTaskInfo: SubTaskInfo
|
||||
): SweeperCloudDialog? {
|
||||
var builder: SweeperCloudDialog.Builder = SweeperCloudDialog.Builder()
|
||||
val builder: SweeperCloudDialog.Builder = SweeperCloudDialog.Builder()
|
||||
builder.titleStr = "子任务确认"
|
||||
builder.contentStr = "请确认并执行子任务 ${subTaskInfo.subTaskName}"
|
||||
builder.tipStr =
|
||||
@@ -346,7 +347,7 @@ object SweeperCloudTaskUtils {
|
||||
stopTaskType: SweeperTaskStop.StopTaskType,
|
||||
timeoutStr: String
|
||||
): SweeperCloudDialog? {
|
||||
var builder: SweeperCloudDialog.Builder = SweeperCloudDialog.Builder()
|
||||
val builder: SweeperCloudDialog.Builder = SweeperCloudDialog.Builder()
|
||||
val titleStr = when (stopTaskType) {
|
||||
SweeperTaskStop.StopTaskType.ADVANCE -> "任务中止"
|
||||
SweeperTaskStop.StopTaskType.EXCEPTION -> "任务异常结束"
|
||||
@@ -386,7 +387,7 @@ object SweeperCloudTaskUtils {
|
||||
context: Context?,
|
||||
listener: SweeperCloudDialogClickListener?
|
||||
): SweeperCloudDialog? {
|
||||
var builder: SweeperCloudDialog.Builder = SweeperCloudDialog.Builder()
|
||||
val builder: SweeperCloudDialog.Builder = SweeperCloudDialog.Builder()
|
||||
builder.titleStr = "任务结束"
|
||||
builder.contentStr = "任务已完成,干的漂亮!"
|
||||
builder.tipStr = ""
|
||||
@@ -407,7 +408,7 @@ object SweeperCloudTaskUtils {
|
||||
listener: SweeperCloudDialogClickListener?,
|
||||
isCancel: Boolean
|
||||
): SweeperCloudDialog? {
|
||||
var builder: SweeperCloudDialog.Builder = SweeperCloudDialog.Builder()
|
||||
val builder: SweeperCloudDialog.Builder = SweeperCloudDialog.Builder()
|
||||
builder.titleStr = "任务结束"
|
||||
builder.contentStr = if (isCancel) "任务已取消!" else "任务已异常结束!"
|
||||
builder.tipStr = ""
|
||||
@@ -424,7 +425,7 @@ object SweeperCloudTaskUtils {
|
||||
context: Context?,
|
||||
listener: SweeperCloudDialogClickListener?
|
||||
): SweeperCloudDialog? {
|
||||
var builder: SweeperCloudDialog.Builder = SweeperCloudDialog.Builder()
|
||||
val builder: SweeperCloudDialog.Builder = SweeperCloudDialog.Builder()
|
||||
builder.titleStr = "任务暂停"
|
||||
builder.contentStr = "云端暂停任务,注意车辆即将停车!"
|
||||
builder.tipStr = "【云端任务恢复前不可启动自动驾驶】"
|
||||
@@ -442,7 +443,7 @@ object SweeperCloudTaskUtils {
|
||||
listener: SweeperCloudDialogClickListener?,
|
||||
contentStr: String
|
||||
): SweeperCloudDialog? {
|
||||
var builder: SweeperCloudDialog.Builder = SweeperCloudDialog.Builder()
|
||||
val builder: SweeperCloudDialog.Builder = SweeperCloudDialog.Builder()
|
||||
builder.titleStr = "任务恢复"
|
||||
builder.contentStr = contentStr
|
||||
builder.tipStr = "【注意安全,坐稳扶好】"
|
||||
@@ -456,11 +457,11 @@ object SweeperCloudTaskUtils {
|
||||
|
||||
@JvmStatic
|
||||
fun printMessage(message: MessageOrBuilder): String {
|
||||
return "\n"+TextFormat.printer().escapingNonAscii(false).printToString(message)
|
||||
return "\n" + TextFormat.printer().escapingNonAscii(false).printToString(message)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getRequestId():String{
|
||||
fun getRequestId(): String {
|
||||
return UUID.randomUUID().toString()
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
app:isWeatherEnable="false"
|
||||
app:locationIcon3DRes="@raw/huanwei"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import android.widget.ImageView;
|
||||
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.amap.api.navi.model.NaviLatLng;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
@@ -17,7 +16,6 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView;
|
||||
@@ -27,7 +25,6 @@ import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
import com.mogo.map.overlay.IMoGoOverlayManager;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.och.common.module.map.AmapNaviToDestinationModel;
|
||||
@@ -158,22 +155,22 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
}
|
||||
|
||||
private void updateSwitchMapIcon() {
|
||||
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
||||
if (controller != null) {
|
||||
if (controller.getCurrentMapVisualAngle().isLongSight()) {
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_big_selector);
|
||||
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_small_selector);
|
||||
} else {
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_small_selector);
|
||||
if(mapBizView != null){
|
||||
IMogoMapUIController uiController = mapBizView.getUI();
|
||||
if(uiController != null){
|
||||
if (uiController.getCurrentMapVisualAngle().isLongSight()) {
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_big_selector);
|
||||
} else if (uiController.getCurrentMapVisualAngle().isMediumSight()) {
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_small_selector);
|
||||
} else {
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_small_selector);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置任务进度
|
||||
*
|
||||
* @param progress
|
||||
*/
|
||||
protected void setTaskProgress(String progress) {
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
@@ -257,9 +254,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().registerHostMapListener(TAG, this);
|
||||
mCloseNavIcon.setOnClickListener(this);
|
||||
mRefreshNavi.setOnClickListener(this);
|
||||
mMapWeltView.getSwitchToBig().setOnClickListener((v) -> {
|
||||
showOrHideOverMapViewFragment(true);
|
||||
});
|
||||
mMapWeltView.getSwitchToBig().setOnClickListener((v) -> showOrHideOverMapViewFragment(true));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -271,15 +266,11 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
/**
|
||||
* 模拟自动驾驶返回状态
|
||||
*
|
||||
* @param status
|
||||
*/
|
||||
public abstract void debugAutoPilotStatus(int status);
|
||||
|
||||
/**
|
||||
* 迈速表实时更新
|
||||
*
|
||||
* @param newSpeed
|
||||
*/
|
||||
public void updateSpeedView(float newSpeed) {
|
||||
int speed = (int) (Math.abs(newSpeed) * 3.6F); // 倒车时工控机反馈定位信息中speed为负值
|
||||
@@ -290,8 +281,6 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
/**
|
||||
* 车辆基本信息View
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public SweeperTrafficDataView getTrafficDataView() {
|
||||
return mTrafficDataView;
|
||||
@@ -338,34 +327,24 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
mSwitchMapModeImage.setOnClickListener(new OnPreventFastClickListener() {
|
||||
@Override
|
||||
public void onClickImpl(View v) {
|
||||
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
||||
|
||||
if (controller != null) {
|
||||
//切换地图的远近视图
|
||||
if (controller.getCurrentMapVisualAngle().isLongSight()) {
|
||||
// 2.11.0去掉
|
||||
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).visibleAllMarkers();
|
||||
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_small_selector);
|
||||
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
|
||||
// 2.11.0去掉
|
||||
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
|
||||
// .inVisibleWithoutMarkers(DataTypes.TYPE_MARKER_ADAS, BusConst.TYPE_MARKER_BUS_ORDER);
|
||||
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_big_selector);
|
||||
} else {
|
||||
// 2.11.0去掉
|
||||
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).visibleAllMarkers();
|
||||
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_big_selector);
|
||||
if(mapBizView != null){
|
||||
IMogoMapUIController uiController = mapBizView.getUI();
|
||||
if(uiController != null){
|
||||
if (uiController.getCurrentMapVisualAngle().isLongSight()) {
|
||||
uiController.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_small_selector);
|
||||
} else if (uiController.getCurrentMapVisualAngle().isMediumSight()) {
|
||||
uiController.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_big_selector);
|
||||
} else {
|
||||
uiController.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_big_selector);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
mSettingBtn.setOnClickListener(v -> {
|
||||
// TODO: 2021/12/9
|
||||
CallerHmiManager.INSTANCE.showToolsView();
|
||||
});
|
||||
mSettingBtn.setOnClickListener(v -> CallerHmiManager.INSTANCE.showToolsView());
|
||||
if (mCardBtn != null) {
|
||||
CallerDevaToolsManager.INSTANCE.initBadCase(mCardBtn);
|
||||
}
|
||||
@@ -423,8 +402,6 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
/**
|
||||
* 设置作业任务全览图隐藏或者显示
|
||||
*
|
||||
* @param isShow
|
||||
*/
|
||||
public void showOrHideOverMapViewFragment(boolean isShow) {
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
@@ -470,20 +447,15 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
/**
|
||||
* 设置贴边数据到地图
|
||||
*
|
||||
* @param weltDataBeans
|
||||
*/
|
||||
public void setWeltDataToMap(ArrayList<WeltDataBean> weltDataBeans, Boolean isWeltData, String distance) {
|
||||
mWeltDataBeanList = weltDataBeans;
|
||||
ThreadUtils.getSinglePool().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mMapWeltView != null) {
|
||||
mMapWeltView.setWeltData(weltDataBeans, isWeltData, distance);
|
||||
}
|
||||
if (mTaskDataToFragmentCallback != null) {
|
||||
mTaskDataToFragmentCallback.setWeltData(weltDataBeans, distance);
|
||||
}
|
||||
ThreadUtils.getSinglePool().execute(() -> {
|
||||
if (mMapWeltView != null) {
|
||||
mMapWeltView.setWeltData(weltDataBeans, isWeltData, distance);
|
||||
}
|
||||
if (mTaskDataToFragmentCallback != null) {
|
||||
mTaskDataToFragmentCallback.setWeltData(weltDataBeans, distance);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -535,13 +507,10 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
*/
|
||||
public void setTaskRouteList(ArrayList<SweeperRoutePlanningUpdateReqBean.Result> routeList) {
|
||||
mRouteList = routeList;
|
||||
ThreadUtils.getSinglePool().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mMapWeltView.setRouteList(routeList);
|
||||
if (mTaskDataToFragmentCallback != null) {
|
||||
mTaskDataToFragmentCallback.setRouteList(routeList);
|
||||
}
|
||||
ThreadUtils.getSinglePool().execute(() -> {
|
||||
mMapWeltView.setRouteList(routeList);
|
||||
if (mTaskDataToFragmentCallback != null) {
|
||||
mTaskDataToFragmentCallback.setRouteList(routeList);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
app:isWeatherEnable="false"
|
||||
app:locationIcon3DRes="@raw/huanwei"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ enum class TaxiOrderStatusEnum(val code: Int) {
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun valueOf(code: Int): TaxiOrderStatusEnum? {
|
||||
fun valueOf(code: Int): TaxiOrderStatusEnum {
|
||||
for (value in values()) {
|
||||
if (value.code == code) {
|
||||
return value
|
||||
|
||||
@@ -894,12 +894,9 @@ public class TaxiModel {
|
||||
|
||||
//检测当前订单
|
||||
public boolean checkCurrentOCHOrder() {
|
||||
if (mCurrentOCHOrder != null
|
||||
return mCurrentOCHOrder != null
|
||||
&& mCurrentOCHOrder.startSiteGcjPoint != null
|
||||
&& mCurrentOCHOrder.endSiteGcjPoint != null) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
&& mCurrentOCHOrder.endSiteGcjPoint != null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,7 +32,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView;
|
||||
@@ -96,7 +95,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
|
||||
protected SmallMapView smallMapView;
|
||||
|
||||
private Handler mHandler = new Handler(Looper.getMainLooper());
|
||||
private final Handler mHandler = new Handler(Looper.getMainLooper());
|
||||
|
||||
private FrameAnimatorContainer startAutopilotAnimator;
|
||||
private FrameAnimatorContainer startManCOAnimator;
|
||||
@@ -140,19 +139,20 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
//视角切换
|
||||
long start = SystemClock.elapsedRealtime();
|
||||
try {
|
||||
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
||||
if (controller != null) {
|
||||
//切换地图的远近视图
|
||||
if (controller.getCurrentMapVisualAngle().isLongSight()) {
|
||||
//Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true);
|
||||
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
||||
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);
|
||||
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
|
||||
//Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
|
||||
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
|
||||
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_long);
|
||||
} else {
|
||||
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);
|
||||
if(mapBizView != null){
|
||||
IMogoMapUIController uiController = mapBizView.getUI();
|
||||
if(uiController != null){
|
||||
if (uiController.getCurrentMapVisualAngle().isLongSight()) {
|
||||
uiController.setLockMode(true);
|
||||
uiController.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
||||
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);
|
||||
} else if (uiController.getCurrentMapVisualAngle().isMediumSight()) {
|
||||
uiController.setLockMode(false);
|
||||
uiController.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
|
||||
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_long);
|
||||
} else {
|
||||
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
@@ -285,14 +285,16 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
}
|
||||
|
||||
private void updateSwitchMapIcon() {
|
||||
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
||||
if (controller != null) {
|
||||
if (controller.getCurrentMapVisualAngle().isLongSight()) {
|
||||
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_long);
|
||||
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
|
||||
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);
|
||||
} else {
|
||||
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);
|
||||
if(mapBizView != null){
|
||||
IMogoMapUIController uiController = mapBizView.getUI();
|
||||
if(uiController != null){
|
||||
if (uiController.getCurrentMapVisualAngle().isLongSight()) {
|
||||
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_long);
|
||||
} else if (uiController.getCurrentMapVisualAngle().isMediumSight()) {
|
||||
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);
|
||||
} else {
|
||||
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -318,8 +320,10 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if(smallMapView != null){
|
||||
smallMapView.onDestroy();
|
||||
}
|
||||
super.onDestroy();
|
||||
smallMapView.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -538,11 +542,6 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
mSpeedView.setText(String.valueOf(speed));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapVisualAngleChanged(VisualAngleMode visualAngleMode) {
|
||||
//todo ui 切换
|
||||
}
|
||||
|
||||
protected void showAmapNaviToStationFragment(boolean isShow) {
|
||||
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.och.taxi.ui;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI;
|
||||
import static com.mogo.map.MogoMap.DEFAULT;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.graphics.Color;
|
||||
@@ -17,7 +18,6 @@ import androidx.annotation.RequiresApi;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.amap.api.navi.model.NaviLatLng;
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
|
||||
@@ -29,7 +29,6 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.overlay.IMoGoOverlayManager;
|
||||
import com.mogo.map.overlay.core.Level;
|
||||
import com.mogo.map.overlay.point.Point;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.och.common.module.map.AmapNaviToDestinationModel;
|
||||
import com.mogo.och.common.module.map.ICommonNaviChangedCallback;
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil;
|
||||
@@ -762,24 +761,13 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
|
||||
.anchor(0.5f, 0.5f)
|
||||
.set3DMode(true)
|
||||
.isUseGps(true)
|
||||
.controlAngle(true)
|
||||
.controlAngle(false)
|
||||
.icon3DRes(resourceId)
|
||||
.latitude(station.get(1))
|
||||
.longitude(station.get(0));
|
||||
IMogoMapUIController mapUIController = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
||||
if (mapUIController != null) {
|
||||
CenterLine centerLine = mapUIController.getCenterLineInfo(station.get(0)
|
||||
, station.get(1), -1);
|
||||
if (null != centerLine) {// 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致
|
||||
Double angle = centerLine.getAngle();
|
||||
if (angle != null) {
|
||||
builder.rotate(angle.floatValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
IMoGoOverlayManager overlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
|
||||
if (overlayManager != null) {
|
||||
overlayManager.showOrUpdatePoint(builder.build());
|
||||
overlayManager.showOrUpdatePoint(builder.build(),DEFAULT);
|
||||
}
|
||||
};
|
||||
OCHThreadPoolManager.getsInstance().execute(setMapMarkerRunnable);
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.mogo.eagle.core.data.temp.EventLogout;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst;
|
||||
import com.mogo.och.common.module.biz.provider.LoginService;
|
||||
import com.mogo.och.common.module.voice.VoiceNotice;
|
||||
import com.mogo.och.taxi.R;
|
||||
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRespBean;
|
||||
@@ -106,7 +105,6 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
|
||||
return "TaxiFragment";
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
@Override
|
||||
protected void initViews() {
|
||||
super.initViews();
|
||||
@@ -201,10 +199,6 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
}
|
||||
|
||||
public void updateAutopilotStatus(int status) {
|
||||
onAutopilotStatusChanged(status);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
android:layout_width="@dimen/dp_400"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
android:longClickable="true"
|
||||
app:locationIcon3DRes="@raw/chuzuche"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
@@ -5,7 +5,6 @@ import android.view.View
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_TAXI_P
|
||||
@@ -144,13 +143,10 @@ class TaxiPassengerBaseFragment() :
|
||||
rv_location_center.onClick {
|
||||
when (bottom.getCurrentPage()) {
|
||||
BottomBar.SelectView.PRECISIONMAP -> {
|
||||
val controller = CallerMapUIServiceManager.getMapUIController()
|
||||
if (controller != null) {
|
||||
//切换到地图中间
|
||||
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
|
||||
// 切换缩放到中视角
|
||||
controller.changeZoom2(0.8f)
|
||||
}
|
||||
//切换到地图中间
|
||||
mapBizView.getUI()?.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
|
||||
// 切换缩放到中视角
|
||||
mapBizView.getUI()?.changeZoom2(0.8f)
|
||||
}
|
||||
BottomBar.SelectView.OVERMAPVIEW -> {
|
||||
overMapView.displayCustomOverView()
|
||||
@@ -161,10 +157,10 @@ class TaxiPassengerBaseFragment() :
|
||||
|
||||
}
|
||||
view?.viewTreeObserver?.addOnWindowFocusChangeListener {
|
||||
if(it){
|
||||
if (it) {
|
||||
CallerLogger.d(M_TAXI_P + TAG, "windows获取焦点")
|
||||
createProgressDialogAnim?.start()
|
||||
}else{
|
||||
} else {
|
||||
CallerLogger.d(M_TAXI_P + TAG, "window失去焦点")
|
||||
createProgressDialogAnim?.stop()
|
||||
}
|
||||
@@ -223,19 +219,19 @@ class TaxiPassengerBaseFragment() :
|
||||
*/
|
||||
fun showOrHideServingOrderFragment(isShow: Boolean) {
|
||||
when (bottom.getCurrentPage()) {
|
||||
BottomBar.SelectView.OVERMAPVIEW,BottomBar.SelectView.PRECISIONMAP -> {
|
||||
BottomBar.SelectView.OVERMAPVIEW, BottomBar.SelectView.PRECISIONMAP -> {
|
||||
if (isShow) {
|
||||
if(itinerary.visibility!=View.VISIBLE) {
|
||||
if (itinerary.visibility != View.VISIBLE) {
|
||||
itinerary.visibility = View.VISIBLE
|
||||
}
|
||||
} else {
|
||||
if(itinerary.visibility!=View.GONE) {
|
||||
if (itinerary.visibility != View.GONE) {
|
||||
itinerary.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
BottomBar.SelectView.VIDEO,BottomBar.SelectView.NONE -> {
|
||||
if(itinerary.visibility!=View.GONE) {
|
||||
BottomBar.SelectView.VIDEO, BottomBar.SelectView.NONE -> {
|
||||
if (itinerary.visibility != View.GONE) {
|
||||
itinerary.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
@@ -299,7 +295,7 @@ class TaxiPassengerBaseFragment() :
|
||||
infoVideoView.exitFullScreenMode(resetVideoPlayer)
|
||||
}
|
||||
|
||||
fun showOrHideOverMapView(){
|
||||
fun showOrHideOverMapView() {
|
||||
overMapView?.clearV2XMarkers()
|
||||
overMapView?.clearCustomPolyline()
|
||||
}
|
||||
|
||||
@@ -694,7 +694,7 @@ final class DiskLruCache implements Closeable {
|
||||
private void validateKey(String key) {
|
||||
Matcher matcher = LEGAL_KEY_PATTERN.matcher(key);
|
||||
if (!matcher.matches()) {
|
||||
throw new IllegalArgumentException("keys must match regex [a-z0-9_-]{1,64}: \"" + key + "\"");
|
||||
throw new IllegalArgumentException("keys must match regex [a-z0-9_-]{1,64}: " + key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -964,11 +964,11 @@ final class DiskLruCache implements Closeable {
|
||||
}
|
||||
|
||||
public File getCleanFile(int i) {
|
||||
return new File(directory, key + "" + i);
|
||||
return new File(directory, key + i);
|
||||
}
|
||||
|
||||
public File getDirtyFile(int i) {
|
||||
return new File(directory, key + "" + i + ".tmp");
|
||||
return new File(directory, key + i + ".tmp");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,11 +21,12 @@ import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.io.StringWriter;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/** Junk drawer of utility methods. */
|
||||
final class Util {
|
||||
static final Charset US_ASCII = Charset.forName("US-ASCII");
|
||||
static final Charset UTF_8 = Charset.forName("UTF-8");
|
||||
static final Charset US_ASCII = StandardCharsets.US_ASCII;
|
||||
static final Charset UTF_8 = StandardCharsets.UTF_8;
|
||||
|
||||
private Util() {
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
<!-- 高精地图 -->
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
app:styleMode="MAP_STYLE_DAY_VR"
|
||||
app:isWeatherEnable="false"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ data class QueryCurrentTaskRespBean(var data: Result?) : BaseData() {
|
||||
/**
|
||||
* with order.orderStatus == OnTheWayToEnd
|
||||
*/
|
||||
fun isOrderOnTheWayToEnd(data: QueryCurrentTaskRespBean.Result?): Boolean {
|
||||
fun isOrderOnTheWayToEnd(data: Result?): Boolean {
|
||||
if (data == null) {
|
||||
return false
|
||||
}
|
||||
@@ -121,7 +121,7 @@ data class QueryCurrentTaskRespBean(var data: Result?) : BaseData() {
|
||||
/**
|
||||
* with order.orderStatus == ArriveAtEnd
|
||||
*/
|
||||
fun isOrderArriveAtEnd(data: QueryCurrentTaskRespBean.Result?): Boolean {
|
||||
fun isOrderArriveAtEnd(data: Result?): Boolean {
|
||||
if (data == null) {
|
||||
return false
|
||||
}
|
||||
@@ -134,7 +134,7 @@ data class QueryCurrentTaskRespBean(var data: Result?) : BaseData() {
|
||||
/**
|
||||
* with order.orderStatus == ArriveAtStart
|
||||
*/
|
||||
fun isOrderArriveAtStart(data: QueryCurrentTaskRespBean.Result?): Boolean {
|
||||
fun isOrderArriveAtStart(data: Result?): Boolean {
|
||||
if (data == null) {
|
||||
return false
|
||||
}
|
||||
@@ -144,7 +144,7 @@ data class QueryCurrentTaskRespBean(var data: Result?) : BaseData() {
|
||||
return data.order!!.orderStatus == TaxiOrderStatusEnum.ArriveAtStart.code
|
||||
}
|
||||
|
||||
fun isUserArriveAtStart(data: QueryCurrentTaskRespBean.Result?): Boolean {
|
||||
fun isUserArriveAtStart(data: Result?): Boolean {
|
||||
if (data == null) {
|
||||
return false
|
||||
}
|
||||
@@ -157,7 +157,7 @@ data class QueryCurrentTaskRespBean(var data: Result?) : BaseData() {
|
||||
/**
|
||||
* with task.currentStatus == StartTask
|
||||
*/
|
||||
fun isStartTaskType(data: QueryCurrentTaskRespBean.Result?): Boolean {
|
||||
fun isStartTaskType(data: Result?): Boolean {
|
||||
if (data == null) {
|
||||
return false
|
||||
}
|
||||
@@ -167,7 +167,7 @@ data class QueryCurrentTaskRespBean(var data: Result?) : BaseData() {
|
||||
/**
|
||||
* with task.currentStatus == CompleteTask
|
||||
*/
|
||||
fun isCompleteTaskType(data: QueryCurrentTaskRespBean.Result?): Boolean {
|
||||
fun isCompleteTaskType(data: Result?): Boolean {
|
||||
if (data == null) {
|
||||
return false
|
||||
}
|
||||
@@ -177,7 +177,7 @@ data class QueryCurrentTaskRespBean(var data: Result?) : BaseData() {
|
||||
/**
|
||||
* with task.currentStatus == GetTask
|
||||
*/
|
||||
fun isGetTaskType(data: QueryCurrentTaskRespBean.Result?): Boolean {
|
||||
fun isGetTaskType(data: Result?): Boolean {
|
||||
if (data == null) {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ abstract class BaseTaxiTabFragment<V : IView, P : Presenter<V>> : MvpFragment<V,
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
smallMapView.onDestroy()
|
||||
smallMapView?.onDestroy()
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.module.status.StatusDescriptor
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
@@ -33,11 +32,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.i
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
|
||||
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
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
|
||||
@@ -54,22 +49,9 @@ import com.mogo.och.common.module.manager.distancemamager.TrajectoryAndDistanceM
|
||||
import com.mogo.och.common.module.map.AmapNaviToDestinationModel
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil.coordinateConverterWgsToGcjLocations
|
||||
import com.mogo.och.common.module.voice.VoiceNotice
|
||||
import com.mogo.och.taxi.bean.PrepareTaskRespBean
|
||||
import com.mogo.och.taxi.bean.QueryCarOrderByNoRespBean
|
||||
import com.mogo.och.taxi.bean.QueryCurrentTaskRespBean
|
||||
import com.mogo.och.taxi.bean.StartServiceRespBean
|
||||
import com.mogo.och.taxi.bean.TrajectoryListRespBean
|
||||
import com.mogo.och.taxi.callback.IOCHTaxiAutopilotPlanningCallback
|
||||
import com.mogo.och.taxi.callback.ITaxiADASStatusCallback
|
||||
import com.mogo.och.taxi.callback.ITaxiCarServiceCallback
|
||||
import com.mogo.och.taxi.callback.ITaxiControllerStatusCallback
|
||||
import com.mogo.och.taxi.callback.ITaxiOrderStatusCallback
|
||||
import com.mogo.och.taxi.callback.ITaxiTaskWithOrderCallback
|
||||
import com.mogo.och.taxi.constant.TaskStatusEnum
|
||||
import com.mogo.och.taxi.constant.TaskTypeEnum
|
||||
import com.mogo.och.taxi.constant.TaxiCarServingStatusManager
|
||||
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum
|
||||
import com.mogo.och.taxi.constant.TaxiUnmannedConst
|
||||
import com.mogo.och.taxi.bean.*
|
||||
import com.mogo.och.taxi.callback.*
|
||||
import com.mogo.och.taxi.constant.*
|
||||
import com.mogo.och.taxi.constant.TaxiUnmannedConst.Companion.BUSINESSTYPE
|
||||
import com.mogo.och.taxi.network.TaxiTaskWithOrderServiceManager
|
||||
import com.mogo.och.taxi.ui.debug.DebugView
|
||||
@@ -84,8 +66,6 @@ import io.reactivex.schedulers.Schedulers
|
||||
import mogo.telematics.pad.MessagePad.ArrivalNotification
|
||||
import mogo.telematics.pad.MessagePad.GlobalPathResp
|
||||
import mogo_msg.MogoReportMsg.MogoReportMessage
|
||||
import system_master.SsmInfo
|
||||
import system_master.SystemStatusInfo
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.concurrent.TimeUnit
|
||||
import kotlin.math.ceil
|
||||
@@ -184,7 +164,7 @@ object TaxiTaskModel {
|
||||
return mCurrentTaskWithOrder
|
||||
}
|
||||
|
||||
fun getCurrentOrderTrajectoryList(): MutableList<TrajectoryListRespBean.Result>? {
|
||||
fun getCurrentOrderTrajectoryList(): MutableList<TrajectoryListRespBean.Result> {
|
||||
return mTaskTrajectoryList
|
||||
}
|
||||
|
||||
@@ -251,25 +231,30 @@ object TaxiTaskModel {
|
||||
* false: 暂停启动自驾
|
||||
*/
|
||||
fun handleBrakeStatusChange(brakeStatus: Boolean) {
|
||||
if (brakeStatus){
|
||||
mControllerStatusCallback?.resumeOpenAutopilotNonManual()
|
||||
}else{
|
||||
mControllerStatusCallback?.pauseOpenAutopilotNonManual()
|
||||
}
|
||||
if (brakeStatus) {
|
||||
mControllerStatusCallback?.resumeOpenAutopilotNonManual()
|
||||
} else {
|
||||
mControllerStatusCallback?.pauseOpenAutopilotNonManual()
|
||||
}
|
||||
}
|
||||
|
||||
private val mMogoAutopilotStatusListener: IMoGoAutopilotStatusListener =
|
||||
object : IMoGoAutopilotStatusListener {
|
||||
override fun onAutopilotDockerInfo(dockerVersion: String) {}
|
||||
override fun onAutopilotRouteLineId(lineId: Long) {}
|
||||
override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) {
|
||||
DebugView.printInfoMsg("[域控连接状态变化] status=$status, reason=${if (TextUtils.isEmpty(reason)) "" else reason}")
|
||||
DebugView.printInfoMsg(
|
||||
"[域控连接状态变化] status=$status, reason=${
|
||||
if (TextUtils.isEmpty(
|
||||
reason
|
||||
)
|
||||
) "" else reason
|
||||
}"
|
||||
)
|
||||
}
|
||||
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMessage?) {
|
||||
TaxiTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo)
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {}
|
||||
override fun onAutopilotStatusResponse(state: Int) {
|
||||
i(TAG, "onAutopilotStatusResponse autopilotsState= $state")
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
@@ -300,7 +285,8 @@ object TaxiTaskModel {
|
||||
if ((FunctionBuildConfig.isDemoMode
|
||||
&& checkCurrentTaskCondition()
|
||||
&& QueryCurrentTaskRespBean.isStartTaskType(mCurrentTaskWithOrder)
|
||||
)){
|
||||
)
|
||||
) {
|
||||
// 当美化模式(演示模式)开启时:且有订单、且为去往目的地状态,维持自动驾驶icon开启状态
|
||||
return
|
||||
}
|
||||
@@ -310,20 +296,20 @@ object TaxiTaskModel {
|
||||
if ((FunctionBuildConfig.isDemoMode
|
||||
&& checkCurrentTaskCondition()
|
||||
&& QueryCurrentTaskRespBean.isStartTaskType(mCurrentTaskWithOrder)
|
||||
)
|
||||
)
|
||||
) {
|
||||
// 当美化模式(演示模式)开启时:且有订单、且为去往目的地状态,维持自动驾驶icon开启状态
|
||||
return
|
||||
}
|
||||
if (mADASStatusCallback != null) {
|
||||
mADASStatusCallback!!.onAutopilotDisable()
|
||||
}
|
||||
mADASStatusCallback?.onAutopilotDisable()
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING) {
|
||||
DebugView.printInfoMsg("[自驾状态变化] afterValue=STATUS_PARALLEL_DRIVING,meaning=平行驾驶中")
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
if ((checkCurrentTaskCondition()
|
||||
&& QueryCurrentTaskRespBean.isStartTaskType(mCurrentTaskWithOrder)
|
||||
)
|
||||
&& QueryCurrentTaskRespBean.isStartTaskType(
|
||||
mCurrentTaskWithOrder
|
||||
)
|
||||
)
|
||||
) { //订单中
|
||||
// 当美化模式(演示模式)开启时:且有订单、且为去往目的地状态,维持自动驾驶icon开启状态
|
||||
} else { //美化模式下没订单,显示人工驾驶
|
||||
@@ -335,7 +321,6 @@ object TaxiTaskModel {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotSNRequest() {}
|
||||
override fun onAutopilotArriveAtStation(arrivalNotification: ArrivalNotification?) {
|
||||
i(TAG, "onAutopilotArriveAtStation = ${arrivalNotification.toString()}")
|
||||
DebugView.printInfoMsg("[MAP到站通知] 上报到站,location=${arrivalNotification?.endLocation}")
|
||||
@@ -359,9 +344,6 @@ object TaxiTaskModel {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusRespByQuery(status: SystemStatusInfo.StatusInfo) {}
|
||||
|
||||
override fun onSystemStatus(statusInf: SsmInfo.SsmStatusInf) {}
|
||||
}
|
||||
|
||||
private val mMogoStatusChangedListener: IMogoStatusChangedListener =
|
||||
@@ -407,7 +389,7 @@ object TaxiTaskModel {
|
||||
if (checkCurrentTaskCondition()) {
|
||||
d(TAG, "--------本地开始计算全路径数据---------- ")
|
||||
//转换成高德坐标系
|
||||
if (mCurrentTaskRoutePointsGcj!!.size > 0) {
|
||||
if (mCurrentTaskRoutePointsGcj.size > 0) {
|
||||
mCurrentTaskRoutePointsGcj.clear()
|
||||
}
|
||||
mCurrentTaskRoutePointsGcj.addAll(
|
||||
@@ -455,7 +437,7 @@ object TaxiTaskModel {
|
||||
return OCHOperationalMessage::class.java
|
||||
}
|
||||
|
||||
override fun onMsgReceived(obj: OCHOperationalMessage) {
|
||||
override fun onMsgReceived(obj: OCHOperationalMessage?) {
|
||||
if (obj == null) {
|
||||
d(TAG, "onMsgReceived = null")
|
||||
return
|
||||
@@ -483,17 +465,18 @@ object TaxiTaskModel {
|
||||
}
|
||||
|
||||
private val localCalculateDistanceListener: IDistanceListener = object : IDistanceListener {
|
||||
override fun distanceCallback(lastSumLength: Float) {
|
||||
val lastTime = lastSumLength / TaxiUnmannedConst.TAXI_AVERAGE_SPEED * 3.6 //秒
|
||||
override fun distanceCallback(distance: Float) {
|
||||
val lastTime = distance / TaxiUnmannedConst.TAXI_AVERAGE_SPEED * 3.6 //秒
|
||||
d(
|
||||
TAG,
|
||||
"dynamicCalculateRouteInfo: lastSumLength=$lastSumLength, lastTime=$lastTime, threadName=Thread.currentThread().name"
|
||||
"dynamicCalculateRouteInfo: lastSumLength=$distance, lastTime=$lastTime, threadName=Thread.currentThread().name"
|
||||
)
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onTaskTripInfoLocalCalculateChanged(
|
||||
lastSumLength.toLong(),
|
||||
lastTime.toLong())
|
||||
distance.toLong(),
|
||||
lastTime.toLong()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -525,7 +508,7 @@ object TaxiTaskModel {
|
||||
)
|
||||
routeArrivingTemp.add(temp)
|
||||
}
|
||||
mAutopilotPlanningCallback!!.routeResult(
|
||||
mAutopilotPlanningCallback?.routeResult(
|
||||
routeArriviedTemp,
|
||||
routeArrivingTemp,
|
||||
location
|
||||
@@ -574,7 +557,7 @@ object TaxiTaskModel {
|
||||
siteId: Long, isArriveAtEndSite: Boolean,
|
||||
isArrivedNearestStation: Boolean = false
|
||||
) {
|
||||
if (mIsArrivedSiteTag){
|
||||
if (mIsArrivedSiteTag) {
|
||||
DebugView.printInfoMsg("arriveSite接口正在调用中")
|
||||
i(TAG, message = "arriveSite接口正在调用中 mIsArrivedSite = $mIsArrivedSiteTag")
|
||||
return
|
||||
@@ -597,7 +580,6 @@ object TaxiTaskModel {
|
||||
}
|
||||
|
||||
if (isArriveAtEndSite) {
|
||||
updateLocalCalculateStation()
|
||||
//取消自驾,D档位会溜车 map3.6.0 修改
|
||||
cancelAutopilot()
|
||||
}
|
||||
@@ -683,7 +665,7 @@ object TaxiTaskModel {
|
||||
)
|
||||
return
|
||||
}
|
||||
val result: QueryCurrentTaskRespBean.Result = data.data!!
|
||||
val result: QueryCurrentTaskRespBean.Result? = data.data
|
||||
d(
|
||||
TAG,
|
||||
"queryCurrentTaskOnce onSuccess:result=${GsonUtil.jsonFromObject(result)}"
|
||||
@@ -710,15 +692,15 @@ object TaxiTaskModel {
|
||||
}
|
||||
|
||||
//订单或者伪任务更新, 都去刷新下界面
|
||||
if (mCurrentTaskWithOrder == null
|
||||
|| !mCurrentTaskWithOrder!!.equals(result)
|
||||
) {
|
||||
if (mCurrentTaskWithOrder == null || mCurrentTaskWithOrder!! != result) {
|
||||
d(TAG, "queryCurrentTaskOnce: 更新本地数据")
|
||||
|
||||
mCurrentTaskWithOrder = result
|
||||
|
||||
updateLocalCalculateStation()
|
||||
|
||||
// 任务为空
|
||||
if (result.endSite == null && result.order == null) {
|
||||
if (result?.endSite == null && result?.order == null) {
|
||||
d(TAG, "queryCurrentTaskOnce: 任务为空")
|
||||
if (mDriveToNearestStationTask == null) {
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
@@ -734,7 +716,7 @@ object TaxiTaskModel {
|
||||
//8.29更新: 当前任务完成且订单状态为乘客已上车, 则立马去拉取任务 不再等120s,否则送驾任务要等120s后才能去执行
|
||||
// 主要是解决A-B演练任务同时接到A-B订单状态流转的问题
|
||||
//注意: 需要去除到达乘客上车点的节点, 这个节点不拉取任务
|
||||
if (result?.currentStatus == TaskStatusEnum.CompleteTask.code
|
||||
if (result.currentStatus == TaskStatusEnum.CompleteTask.code
|
||||
) {
|
||||
mADASStatusCallback?.updateAutopilotStatus()
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
@@ -743,8 +725,6 @@ object TaxiTaskModel {
|
||||
}
|
||||
}
|
||||
|
||||
updateLocalCalculateStation()
|
||||
|
||||
//达到终点后查询全程里程和用时
|
||||
if (QueryCurrentTaskRespBean.isOrderArriveAtEnd(result)) {
|
||||
d(TAG, "queryCurrentTaskOnce ArriveAtEnd")
|
||||
@@ -755,7 +735,7 @@ object TaxiTaskModel {
|
||||
}
|
||||
|
||||
//根据lineId集合去查轨迹集合, 返回的只是接驾任务的line集合, 没有送驾任务
|
||||
var linesIds = arrayListOf<Long>()
|
||||
val linesIds = arrayListOf<Long>()
|
||||
linesIds.add(result.lineId) // 当前任务的
|
||||
result.order?.also {
|
||||
linesIds.addAll(it.planningLines) // 接驾
|
||||
@@ -816,9 +796,9 @@ object TaxiTaskModel {
|
||||
}
|
||||
|
||||
fun updateLocalCalculateStation() {
|
||||
if (mCurrentTaskWithOrder == null) return
|
||||
if (mCurrentTaskWithOrder!!.startSite != null && mCurrentTaskWithOrder!!.endSite != null
|
||||
&& mCurrentTaskWithOrder!!.currentStatus == TaskStatusEnum.StartTask.code
|
||||
if (mCurrentTaskWithOrder != null &&
|
||||
mCurrentTaskWithOrder?.startSite != null && mCurrentTaskWithOrder?.endSite != null
|
||||
&& mCurrentTaskWithOrder?.currentStatus == TaskStatusEnum.StartTask.code
|
||||
) {
|
||||
d(TAG, "updateLocalCalculateStation start")
|
||||
val curTaskAndOrder = getCurrentTaskWithOrder() ?: return
|
||||
@@ -892,7 +872,7 @@ object TaxiTaskModel {
|
||||
object : OchCommonServiceCallback<BaseData> {
|
||||
override fun onSuccess(data: BaseData?) {
|
||||
DebugView.printInfoMsg("[开始任务] 请求success,lindId=$lineId")
|
||||
if (isStartAutopilot){
|
||||
if (isStartAutopilot) {
|
||||
startAutoPilot() //自驾开启
|
||||
}
|
||||
d(TAG, "startTask onSuccess: data=${GsonUtil.jsonFromObject(data)}")
|
||||
@@ -917,7 +897,7 @@ object TaxiTaskModel {
|
||||
})
|
||||
}
|
||||
|
||||
fun prepareNextTask(delayTime: Long,siteId: Long) {
|
||||
fun prepareNextTask(delayTime: Long, siteId: Long) {
|
||||
DebugView.printInfoMsg("[PrepareNextTask] 准备发送请求, siteId=$siteId")
|
||||
TaxiTaskWithOrderServiceManager.prepareTask(
|
||||
mContext,
|
||||
@@ -936,7 +916,7 @@ object TaxiTaskModel {
|
||||
DebugView.printErrorMsg("[PrepareNextTask] 请求fail, code=$code ,msg=$msg")
|
||||
d(TAG, "prepareNextTask onFail: code=$code ,msg=$msg")
|
||||
if (LoginStatusManager.isLogin() && TaxiCarServingStatusManager.isCarServingStatus()) {
|
||||
startPrepareTaskDelay(delayTime,siteId)
|
||||
startPrepareTaskDelay(delayTime, siteId)
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -946,12 +926,12 @@ object TaxiTaskModel {
|
||||
removePrepareTaskDelay()
|
||||
|
||||
mPrepareTaskDelayRunnable = Runnable {
|
||||
prepareNextTask(delayTime,siteId)
|
||||
prepareNextTask(delayTime, siteId)
|
||||
}
|
||||
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onStartPrepareTaskUI(delayTime,true)
|
||||
listener.onStartPrepareTaskUI(delayTime, true)
|
||||
}
|
||||
DebugView.printInfoMsg("[PrepareNextTask] 倒计时${delayTime / 1000}秒后prepareNextTask, siteId=$siteId")
|
||||
UiThreadHandler.postDelayed(
|
||||
@@ -966,7 +946,7 @@ object TaxiTaskModel {
|
||||
UiThreadHandler.removeCallbacks(mPrepareTaskDelayRunnable)
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onStartPrepareTaskUI(0,false)
|
||||
listener.onStartPrepareTaskUI(0, false)
|
||||
}
|
||||
mPrepareTaskDelayRunnable = null
|
||||
}
|
||||
@@ -976,7 +956,13 @@ object TaxiTaskModel {
|
||||
* 查询当前任务的轨迹
|
||||
*/
|
||||
fun queryTaskTrajectoryByLineIds(planningLineIds: Array<Long>, currentTaskLineId: Long) {
|
||||
DebugView.printInfoMsg("[查询轨迹信息] 准备发送请求,currentTaskLineId=$currentTaskLineId, planningLineIds=${GsonUtil.jsonFromObject(planningLineIds)}")
|
||||
DebugView.printInfoMsg(
|
||||
"[查询轨迹信息] 准备发送请求,currentTaskLineId=$currentTaskLineId, planningLineIds=${
|
||||
GsonUtil.jsonFromObject(
|
||||
planningLineIds
|
||||
)
|
||||
}"
|
||||
)
|
||||
TaxiTaskWithOrderServiceManager.queryTrajectoryByLindIds(
|
||||
mContext,
|
||||
planningLineIds,
|
||||
@@ -986,7 +972,13 @@ object TaxiTaskModel {
|
||||
TAG,
|
||||
"queryTaskTrajectoryByLineIds onSuccess: ${GsonUtil.jsonFromObject(data?.data)}"
|
||||
)
|
||||
DebugView.printInfoMsg("[查询轨迹信息] 请求success, currentTaskLineId=$currentTaskLineId, planningLineIds=${GsonUtil.jsonFromObject(planningLineIds)}")
|
||||
DebugView.printInfoMsg(
|
||||
"[查询轨迹信息] 请求success, currentTaskLineId=$currentTaskLineId, planningLineIds=${
|
||||
GsonUtil.jsonFromObject(
|
||||
planningLineIds
|
||||
)
|
||||
}"
|
||||
)
|
||||
data?.data?.also {
|
||||
mTaskTrajectoryList.addAll(it)
|
||||
mCurrentTaskTrajectory = it.first { currentTaskLineId == it.lineId }
|
||||
@@ -1039,8 +1031,8 @@ object TaxiTaskModel {
|
||||
//暂停接单状态下,去接单
|
||||
DebugView.printInfoMsg("[开始接单] 准备发送请求")
|
||||
TaxiTaskWithOrderServiceManager.startService(mContext,
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().latitude,
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().longitude,
|
||||
getChassisLocationGCJ02().latitude,
|
||||
getChassisLocationGCJ02().longitude,
|
||||
object : OchCommonServiceCallback<StartServiceRespBean> {
|
||||
override fun onSuccess(data: StartServiceRespBean?) {
|
||||
if (data == null) return
|
||||
@@ -1089,13 +1081,13 @@ object TaxiTaskModel {
|
||||
paramIndexes = [-1]
|
||||
)
|
||||
|
||||
fun startAutopilotByClick(){
|
||||
fun startAutopilotByClick() {
|
||||
//订单状态流转成功, 点击了开启自驾按钮, 启动自驾
|
||||
if (QueryCurrentTaskRespBean.isStartTaskType(mCurrentTaskWithOrder)) {
|
||||
startAutoPilot()
|
||||
}else if (QueryCurrentTaskRespBean.isGetTaskType(mCurrentTaskWithOrder)){
|
||||
} else if (QueryCurrentTaskRespBean.isGetTaskType(mCurrentTaskWithOrder)) {
|
||||
startTask(mCurrentTaskWithOrder!!.lineId, true)
|
||||
}else{
|
||||
} else {
|
||||
e(TAG, "task currentStatus is not StartTask.")
|
||||
DebugView.printInfoMsg("[启自驾] task currentStatus is not StartTask")
|
||||
}
|
||||
@@ -1178,9 +1170,7 @@ object TaxiTaskModel {
|
||||
mCurrentTaskWithOrder!!.lineId,
|
||||
if (mCurrentTaskWithOrder!!.order != null) mCurrentTaskWithOrder!!.order!!.orderNo else ""
|
||||
)
|
||||
if (mControllerStatusCallback != null) {
|
||||
mControllerStatusCallback!!.startOpenAutopilot()
|
||||
}
|
||||
mControllerStatusCallback?.startOpenAutopilot()
|
||||
}
|
||||
|
||||
private fun initAutopilotControlParameters(): AutopilotControlParameters? {
|
||||
@@ -1316,16 +1306,12 @@ object TaxiTaskModel {
|
||||
curTaskAndOrder.endSite!!.gcjLat,
|
||||
curTaskAndOrder.endSite!!.gcjLon
|
||||
)
|
||||
if (mAutopilotPlanningCallback != null) {
|
||||
mAutopilotPlanningCallback!!.setLineMarker(startStation, endStation)
|
||||
}
|
||||
mAutopilotPlanningCallback?.setLineMarker(startStation, endStation)
|
||||
}
|
||||
}
|
||||
|
||||
private fun cleanLineMarker() {
|
||||
if (mAutopilotPlanningCallback != null) {
|
||||
mAutopilotPlanningCallback!!.setLineMarker(null, null)
|
||||
}
|
||||
mAutopilotPlanningCallback?.setLineMarker(null, null)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1345,7 +1331,7 @@ object TaxiTaskModel {
|
||||
|
||||
// 登出
|
||||
fun logout() {
|
||||
loginService!!.loginOut(
|
||||
loginService?.loginOut(
|
||||
getChassisLocationGCJ02().latitude,
|
||||
getChassisLocationGCJ02().longitude
|
||||
)
|
||||
@@ -1356,18 +1342,15 @@ object TaxiTaskModel {
|
||||
|
||||
//导航去订单终点目的地
|
||||
fun startNaviToEndStation(isShow: Boolean) {
|
||||
if (mCurrentTaskRoutePointsGcj == null) return
|
||||
if (mCurrentTaskRoutePointsGcj.size > 0) { //使用自驾轨迹
|
||||
if (mOrderStatusCallback != null) {
|
||||
mOrderStatusCallback!!.onNaviToEnd(false, isShow)
|
||||
}
|
||||
mOrderStatusCallback?.onNaviToEnd(false, isShow)
|
||||
} else { //若直接要显示导航地图则直接导航, 若不是则2s后若无轨迹数据使用高德导航
|
||||
if (isShow && mOrderStatusCallback != null) {
|
||||
mOrderStatusCallback!!.onNaviToEnd(true, true)
|
||||
if (isShow) {
|
||||
mOrderStatusCallback?.onNaviToEnd(true, true)
|
||||
} else {
|
||||
UiThreadHandler.postDelayed({
|
||||
if (mCurrentTaskRoutePointsGcj.size == 0 && mOrderStatusCallback != null) {
|
||||
mOrderStatusCallback!!.onNaviToEnd(true, false)
|
||||
if (mCurrentTaskRoutePointsGcj.size == 0) {
|
||||
mOrderStatusCallback?.onNaviToEnd(true, false)
|
||||
}
|
||||
}, 2000L)
|
||||
}
|
||||
@@ -1459,7 +1442,7 @@ object TaxiTaskModel {
|
||||
d(
|
||||
TAG, "stopAutoStartAutopilot = ${mCurrentTaskWithOrder?.currentStatus}"
|
||||
)
|
||||
if (QueryCurrentTaskRespBean.isGetTaskType(mCurrentTaskWithOrder)){
|
||||
if (QueryCurrentTaskRespBean.isGetTaskType(mCurrentTaskWithOrder)) {
|
||||
mControllerStatusCallback?.stopOpenAutopilotNonManual()
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
@@ -1468,14 +1451,14 @@ object TaxiTaskModel {
|
||||
}
|
||||
}
|
||||
|
||||
fun pauseStartAutopilot(){
|
||||
fun pauseStartAutopilot() {
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onPauseStartAutopilot()
|
||||
}
|
||||
}
|
||||
|
||||
fun resumeStartAutopilot(remainingTime: Long){
|
||||
fun resumeStartAutopilot(remainingTime: Long) {
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onStartAutopilot(remainingTime)
|
||||
|
||||
@@ -13,7 +13,7 @@ import com.mogo.och.common.module.utils.OCHThreadPoolManager
|
||||
*/
|
||||
object MapMakerManager {
|
||||
|
||||
fun addMapMaker(owner: String, uuid: String, lat: Double, lon: Double, resourceId: Int){
|
||||
fun addMapMaker(owner: String, uuid: String, lat: Double, lon: Double, resourceId: Int) {
|
||||
|
||||
val setMapMarkerRunnable = Runnable {
|
||||
CallerLogger.d(
|
||||
@@ -34,20 +34,6 @@ object MapMakerManager {
|
||||
.icon3DRes(resourceId)
|
||||
.latitude(lat)
|
||||
.longitude(lon)
|
||||
// val mapUIController =
|
||||
// CallerMapUIServiceManager.getMapUIController()
|
||||
// if (mapUIController != null) {
|
||||
// val centerLine =
|
||||
// mapUIController.getCenterLineInfo(
|
||||
// lon, lat, -1f
|
||||
// )
|
||||
// if (null != centerLine) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致
|
||||
// val angle = centerLine.angle
|
||||
// if (angle != null) {
|
||||
// builder.rotate(angle.toFloat())
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
val overlayManager =
|
||||
CallerMapUIServiceManager.getOverlayManager()
|
||||
overlayManager?.showOrUpdatePoint(builder.build())
|
||||
@@ -55,7 +41,7 @@ object MapMakerManager {
|
||||
OCHThreadPoolManager.getsInstance().execute(setMapMarkerRunnable)
|
||||
}
|
||||
|
||||
fun removeMapMaker(uuid: String, lat: Double, lon: Double){
|
||||
fun removeMapMaker(uuid: String, lat: Double, lon: Double) {
|
||||
//开启线程移除起终点marker设置
|
||||
val removeMapMarkerRunnable = Runnable {
|
||||
CallerLogger.d(
|
||||
@@ -70,7 +56,7 @@ object MapMakerManager {
|
||||
OCHThreadPoolManager.getsInstance().execute(removeMapMarkerRunnable)
|
||||
}
|
||||
|
||||
fun removeAllMapMarkerByOwner(owner: String){
|
||||
fun removeAllMapMarkerByOwner(owner: String) {
|
||||
//开启线程移除起终点marker设置
|
||||
val removeAllMapMarkerRunnable = Runnable {
|
||||
CallerLogger.d(
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
android:layout_marginTop="@dimen/dp_72">
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
app:isWeatherEnable="false"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
<!-- 高精地图 -->
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
app:styleMode="MAP_STYLE_DAY_VR"
|
||||
app:isWeatherEnable="false"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
||||
@@ -6,15 +6,9 @@ import java.text.SimpleDateFormat
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'bugly'
|
||||
|
||||
apply from: rootProject.file('gradle/bytex/bytex.gradle')
|
||||
|
||||
bugly {
|
||||
appId = 'ac71228f85' // 注册时分配的App ID
|
||||
appKey = '3c736249-d6be-4066-b577-b7a6dc975cf7' // 注册时分配的App Key
|
||||
}
|
||||
|
||||
Properties properties = new Properties()
|
||||
properties.load(project.rootProject.file("gradle.properties").newDataInputStream())
|
||||
|
||||
@@ -220,7 +214,8 @@ dependencies {
|
||||
// releaseImplementation rootProject.ext.dependencies.releaseleakcanary
|
||||
implementation rootProject.ext.dependencies.android_start_up
|
||||
implementation rootProject.ext.dependencies.lancetx_runtime
|
||||
implementation rootProject.ext.dependencies.mogocustommap
|
||||
// implementation rootProject.ext.dependencies.mogocustommap
|
||||
implementation project(':libraries:mapmodule')
|
||||
|
||||
implementation project(':core:function-impl:mogo-core-function-startup')
|
||||
implementation project(':core:function-impl:mogo-core-function-devatools')
|
||||
|
||||
@@ -6,7 +6,6 @@ project.android.productFlavors {
|
||||
|
||||
// 配置AndroidManifest.xml中用到的参数
|
||||
manifestPlaceholders = [
|
||||
// BUGLY_APP_CHANNEL
|
||||
CHANNEL_VALUE_TAIL: "Noop",
|
||||
]
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ project.android.productFlavors {
|
||||
|
||||
// 配置AndroidManifest.xml中用到的参数
|
||||
manifestPlaceholders = [
|
||||
// BUGLY_APP_CHANNEL
|
||||
CHANNEL_VALUE_TAIL: "DFHQ",
|
||||
]
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ project.android.productFlavors {
|
||||
|
||||
// 配置AndroidManifest.xml中用到的参数
|
||||
manifestPlaceholders = [
|
||||
// BUGLY_APP_CHANNEL
|
||||
CHANNEL_VALUE_TAIL: "FT",
|
||||
]
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ project.android.productFlavors {
|
||||
|
||||
// 配置AndroidManifest.xml中用到的参数
|
||||
manifestPlaceholders = [
|
||||
// BUGLY_APP_CHANNEL
|
||||
CHANNEL_VALUE_TAIL : "JL",
|
||||
]
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ project.android.productFlavors {
|
||||
|
||||
// 配置AndroidManifest.xml中用到的参数
|
||||
manifestPlaceholders = [
|
||||
// BUGLY_APP_CHANNEL
|
||||
CHANNEL_VALUE_TAIL: "M1",
|
||||
]
|
||||
|
||||
|
||||
@@ -20,15 +20,6 @@
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:replace="android:label">
|
||||
|
||||
<!-- 配置APP ID -->
|
||||
<meta-data
|
||||
android:name="BUGLY_APPID"
|
||||
android:value="ac71228f85" />
|
||||
<!-- 配置APP渠道号 -->
|
||||
<meta-data
|
||||
android:name="BUGLY_APP_CHANNEL"
|
||||
android:value="${CHANNEL_VALUE_HEAD}_${CHANNEL_VALUE_BODY}_${CHANNEL_VALUE_TAIL}" />
|
||||
|
||||
<meta-data
|
||||
android:name="com.amap.api.v2.apikey"
|
||||
android:value="${AMAP_API_VALUE}" />
|
||||
|
||||
@@ -35,7 +35,7 @@ public class CrashSystem implements UncaughtExceptionHandler {
|
||||
private String mOsVersion = null;
|
||||
private String mDeviceId = null;
|
||||
private UncaughtExceptionHandler mDefaultHandler;
|
||||
private final Map<String, String> info = new HashMap();
|
||||
private final Map<String, String> info = new HashMap<>();
|
||||
private final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
|
||||
private boolean mDebug = false;
|
||||
private final List<CrashCallback> callbackList = new ArrayList<>();
|
||||
@@ -109,15 +109,13 @@ public class CrashSystem implements UncaughtExceptionHandler {
|
||||
}
|
||||
|
||||
private boolean handleException(Throwable ex) {
|
||||
if(ex == null) {
|
||||
return true;
|
||||
} else {
|
||||
if (ex != null) {
|
||||
String msg = ex.getLocalizedMessage();
|
||||
Log.e("CrashSystem", msg);
|
||||
String filePath = saveCrashInfo2File(ex);
|
||||
Log.i(TAG, "handleException: filePath = " + filePath);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private String saveCrashInfo2File(Throwable ex) {
|
||||
@@ -148,7 +146,7 @@ public class CrashSystem implements UncaughtExceptionHandler {
|
||||
result = entry.getValue();
|
||||
sb.append(key).append("=").append(result).append("\n");
|
||||
}
|
||||
sb.append("TIME=").append(String.valueOf(System.currentTimeMillis())).append("\n");
|
||||
sb.append("TIME=").append(System.currentTimeMillis()).append("\n");
|
||||
sb.append("fileName=").append(fileName).append("\n");
|
||||
Writer writer = new StringWriter();
|
||||
PrintWriter pw = new PrintWriter(writer);
|
||||
@@ -187,7 +185,7 @@ public class CrashSystem implements UncaughtExceptionHandler {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
try {
|
||||
PackageInfo packageInfo = pm.getPackageInfo(this.mAppPackage, 0);
|
||||
this.mAppVersionCode = "" + packageInfo.versionCode;
|
||||
this.mAppVersionCode = String.valueOf(packageInfo.versionCode);
|
||||
this.mAppVersionName = packageInfo.versionName;
|
||||
this.mAppPackage = packageInfo.packageName;
|
||||
this.mAppName = packageInfo.applicationInfo.loadLabel(context.getPackageManager()).toString();
|
||||
|
||||
@@ -93,9 +93,6 @@ object ConfigStartUp {
|
||||
}
|
||||
|
||||
private fun initOtherConfig(context: Context) {
|
||||
// 配置BuglyAppID:MoGoEagleEye
|
||||
CrashReportConstants.buglyAppID = "ac71228f85"
|
||||
|
||||
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
|
||||
HdMapBuildConfig.currentCarVrIconRes = R.raw.chuzuche
|
||||
} else if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
@@ -132,60 +129,11 @@ object ConfigStartUp {
|
||||
}
|
||||
|
||||
val mapParams = MapParams.init()
|
||||
mapParams.setDebugMode(false) // 1-使用本地地图数据,0-使用在线地图数据
|
||||
//.setDataFileSource(1)
|
||||
mapParams.setDebugMode(false)
|
||||
// 1-使用本地地图数据,0-使用在线地图数据
|
||||
// .setDataFileSource(1)
|
||||
.setIsRecordLogs(false)
|
||||
.setLocationIcon3DRes(HdMapBuildConfig.currentCarVrIconRes)
|
||||
.setIsWeatherEnable(false)
|
||||
.setCoordinateType(MapParams.COORDINATETYPE_GCJ02)
|
||||
.setPerspectiveMode(MapParams.MAP_PERSPECTIVE_UP_CAR)
|
||||
.setHDVisibileArray(
|
||||
intArrayOf(
|
||||
HDTypes.DIVIDER.type,
|
||||
HDTypes.ROAD_AREA.type,
|
||||
HDTypes.STOP_LINE.type,
|
||||
HDTypes.ARROW.type,
|
||||
HDTypes.STATION_BRIDGE.type,
|
||||
HDTypes.ZEBRA_LINE.type,
|
||||
HDTypes.GREEN_BELT.type,
|
||||
HDTypes.DIVERSION.type,
|
||||
HDTypes.SAFE_ISLAND.type,
|
||||
HDTypes.ALPHANUMERIC.type,
|
||||
HDTypes.GUARDBAR.type,
|
||||
HDTypes.TRAFFIC_DEVICE.type,
|
||||
HDTypes.CABLE.type,
|
||||
HDTypes.SIGNAL_LINE.type,
|
||||
HDTypes.building.type,
|
||||
HDTypes.streetLight.type,
|
||||
HDTypes.area.type,
|
||||
HDTypes.regional.type,
|
||||
HDTypes.geometricLinear.type,
|
||||
HDTypes.geometricSurface.type
|
||||
)
|
||||
)
|
||||
// .setZoom( 20 )
|
||||
// .setPointToCenter( 0.734375f, 0.5f )
|
||||
//todo 2D模式下需要注意ADAS部分遮挡
|
||||
//.setPointToCenter(0.5f, 0.5f)
|
||||
// 根据 FunctionBuildConfig 配置的皮肤样式设置题图的样式
|
||||
|
||||
if (FunctionBuildConfig.skinMode == 1) {
|
||||
mapParams.setStyleMode(MapParams.MAP_STYLE_DAY_VR)
|
||||
} else {
|
||||
mapParams.setStyleMode(MapParams.MAP_STYLE_NIGHT_VR)
|
||||
}
|
||||
//todo 临时放在这 @梁利辉
|
||||
if (AppIdentityModeUtils.isBusPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
mapParams.setShadowEnable(false)
|
||||
}
|
||||
if(AppIdentityModeUtils.isShuttlePassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
// shuttle m2 车需要偏移
|
||||
if (AppIdentityModeUtils.isM2(FunctionBuildConfig.appIdentityMode)) {
|
||||
mapParams.setCarPosition(-0.5f)
|
||||
mapParams.setDefaultPerspective(MapParams.MAP_STYLE_VR_ERHAI_B2)
|
||||
}
|
||||
}
|
||||
|
||||
MapAutoApi.init(context, mapParams)
|
||||
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ import com.zhjt.mogo.adas.data.bean.UnableAutopilotReason;
|
||||
import com.zhjt.mogo.adas.data.sweeper.SweeperCloudTask;
|
||||
import com.zhjt.mogo.adas.data.sweeper.bootable.SweeperBootable;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTaskSuspendResume;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.s_r.SweeperTaskSuspendResume;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.big.SweeperBigTaskStatus;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.confirm.SweeperTaskConfirm;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.status.SweeperTaskStatus;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
apply from: "config.gradle"
|
||||
apply from: "javadoc.gradle"
|
||||
|
||||
buildscript {
|
||||
apply from: rootProject.file('gradle/ext.gradle')
|
||||
repositories {
|
||||
@@ -21,6 +22,7 @@ buildscript {
|
||||
maven {
|
||||
url "https://artifact.bytedance.com/repository/byteX/"
|
||||
}
|
||||
gradlePluginPortal()
|
||||
// mavenCentral()
|
||||
google()
|
||||
}
|
||||
@@ -28,7 +30,6 @@ buildscript {
|
||||
classpath "com.android.tools.build:gradle:${gradle_version}"
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_plugin_version}"
|
||||
classpath "com.alibaba:arouter-register:10.0.5_mogo"
|
||||
classpath 'com.tencent.bugly:symtabfileuploader:2.2.1'
|
||||
classpath "com.bytedance.android.byteX:base-plugin:${plugin_version}"
|
||||
classpath "com.mogo.cloud:hook:${service_chain_version}"
|
||||
classpath "com.mogo.cloud:bizconfig:${plugin_version}"
|
||||
@@ -38,7 +39,7 @@ buildscript {
|
||||
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18'
|
||||
classpath "com.mogo.sticky:service:${plugin_version}"
|
||||
classpath "io.github.knight-zxw:lancet-plugin:${lancetx_plugin_version}"
|
||||
|
||||
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.21.0"
|
||||
classpath 'com.mogo.cloud:matrix:1.0.0'
|
||||
// classpath 'com.bytedance.btrace:rhea-gradle-plugin:2.0.0'
|
||||
}
|
||||
@@ -51,6 +52,7 @@ buildscript {
|
||||
}
|
||||
|
||||
allprojects {
|
||||
apply from: rootProject.file('codequality/pmd.gradle')
|
||||
repositories {
|
||||
mavenLocal()
|
||||
maven { url 'http://nexus.zhidaoauto.com/repository/maven-releases/' }
|
||||
@@ -71,7 +73,6 @@ allprojects {
|
||||
}
|
||||
google()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
|
||||
76
codequality/custom-pmd-ruleset.xml
Normal file
76
codequality/custom-pmd-ruleset.xml
Normal file
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0"?>
|
||||
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Custom ruleset"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"
|
||||
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
|
||||
<description>
|
||||
This ruleset checks my code for bad stuff
|
||||
</description>
|
||||
|
||||
<!--https://pmd.github.io/pmd-5.6.1/pmd-java/index.html-->
|
||||
|
||||
<exclude-pattern>.*/R.java</exclude-pattern>
|
||||
<exclude-pattern>.*/gen/.*</exclude-pattern>
|
||||
<exclude-pattern>.*Dagger*.*</exclude-pattern>
|
||||
|
||||
<!-- 最佳实践 -->
|
||||
|
||||
<!-- 用log代替e.PrintStackTrace -->
|
||||
<!-- <rule ref="category/java/bestpractices.xml/AvoidPrintStackTrace" />-->
|
||||
<!-- for/foreach 避免index重新赋值 -->
|
||||
<!-- <rule ref="category/java/bestpractices.xml/AvoidReassigningLoopVariables">-->
|
||||
<!-- <properties>-->
|
||||
<!-- <property name="foreachReassign" value="deny" />-->
|
||||
<!-- <property name="forReassign" value="deny" />-->
|
||||
<!-- </properties>-->
|
||||
<!-- </rule>-->
|
||||
|
||||
<!-- 应避免重新分配catch语句中捕获的异常变量 -->
|
||||
<rule ref="category/java/bestpractices.xml/AvoidReassigningCatchVariables" />
|
||||
<!-- StringBuffers/StringBuilders可能会大幅增长,因此如果保存在寿命较长的对象中,可能会成为内存泄漏的来源 -->
|
||||
<rule ref="category/java/bestpractices.xml/AvoidStringBufferField" />
|
||||
<!-- 在同一行中声明多个变量,会比较混乱 -->
|
||||
<rule ref="category/java/bestpractices.xml/OneDeclarationPerLine">
|
||||
<properties>
|
||||
<property name="strictMode" value="true" />
|
||||
</properties>
|
||||
</rule>
|
||||
<!-- 检查赋值字段未使用问题 -->
|
||||
<rule ref="category/java/bestpractices.xml/UnusedAssignment">
|
||||
<properties>
|
||||
<property name="checkUnusedPrefixIncrement" value="true" />
|
||||
<property name="reportUnusedVariables" value="true" />
|
||||
</properties>
|
||||
</rule>
|
||||
<!-- 检查未使用的局部变量 -->
|
||||
<rule ref="category/java/bestpractices.xml/UnusedLocalVariable" />
|
||||
<!-- 检查未使用的private变量 -->
|
||||
<!-- <rule ref="category/java/bestpractices.xml/UnusedPrivateField" />-->
|
||||
<rule ref="category/java/bestpractices.xml/UseStandardCharsets" />
|
||||
|
||||
<!-- 容易出现运行时错误 -->
|
||||
<rule ref="category/java/errorprone.xml/AvoidBranchingStatementAsLastInLoop" />
|
||||
<rule ref="category/java/errorprone.xml/AvoidDecimalLiteralsInBigDecimalConstructor" />
|
||||
<rule ref="category/java/errorprone.xml/AvoidMultipleUnaryOperators" />
|
||||
<rule ref="category/java/errorprone.xml/AvoidUsingOctalValues" />
|
||||
<rule ref="category/java/errorprone.xml/BrokenNullCheck" />
|
||||
<rule ref="category/java/errorprone.xml/CheckSkipResult" />
|
||||
<rule ref="category/java/errorprone.xml/ClassCastExceptionWithToArray" />
|
||||
<rule ref="category/java/errorprone.xml/DontUseFloatTypeForLoopIndices" />
|
||||
<rule ref="category/java/errorprone.xml/JumbledIncrementer" />
|
||||
<rule ref="category/java/errorprone.xml/MisplacedNullCheck" />
|
||||
<rule ref="category/java/errorprone.xml/OverrideBothEqualsAndHashcode" />
|
||||
<rule ref="category/java/errorprone.xml/ReturnFromFinallyBlock" />
|
||||
<rule ref="category/java/errorprone.xml/UnconditionalIfStatement" />
|
||||
<rule ref="category/java/errorprone.xml/UnnecessaryConversionTemporary" />
|
||||
<rule ref="category/java/errorprone.xml/UnusedNullCheckInEquals" />
|
||||
<rule ref="category/java/errorprone.xml/UselessOperationOnImmutable" />
|
||||
<!-- 多线程时问题-->
|
||||
<rule ref="category/java/multithreading.xml/AvoidThreadGroup" />
|
||||
<rule ref="category/java/multithreading.xml/DontCallThreadRun" />
|
||||
<rule ref="category/java/multithreading.xml/DoubleCheckedLocking" />
|
||||
<!-- 需要优化代码的地方-->
|
||||
<rule ref="category/java/performance.xml/BigIntegerInstantiation" />
|
||||
<!-- 安全问题-->
|
||||
<rule ref="category/java/security.xml" />
|
||||
</ruleset>
|
||||
0
codequality/detekt.gradle
Normal file
0
codequality/detekt.gradle
Normal file
25
codequality/pmd.gradle
Normal file
25
codequality/pmd.gradle
Normal file
@@ -0,0 +1,25 @@
|
||||
apply plugin: "pmd"
|
||||
|
||||
def pmdConfigPath = rootProject.file("codequality").path
|
||||
|
||||
task pmd(type:Pmd){
|
||||
//忽略失败,如果设置为true,检测出bug会停止task
|
||||
ignoreFailures = false
|
||||
consoleOutput = true
|
||||
//filter路径
|
||||
ruleSetFiles = files("${pmdConfigPath}/custom-pmd-ruleset.xml") // todo 新增rules
|
||||
ruleSets = []
|
||||
//检测资源路径
|
||||
source 'src/main/java','src/jinlvvan/java','src/driverm1/java'
|
||||
//排除项
|
||||
exclude '**/gen/**'
|
||||
|
||||
reports {
|
||||
xml.getRequired().set(false)
|
||||
html.getRequired().set(true)
|
||||
//结果输出到项目根目录下的 build/reports/pmd 文件夹中,只需要html格式的结果文档
|
||||
def destination = new File(new File("${project.rootProject.buildDir.path}/reports/pmd"), "${project.name}-pmd.html")
|
||||
html.destination(destination)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,7 +9,7 @@ ext {
|
||||
androidxconstraintlayout : "androidx.constraintlayout:constraintlayout:2.1.0",
|
||||
boostmultidex : "com.bytedance.boost_multidex:boost_multidex:1.0.1",
|
||||
androidxviewpager2 : "androidx.viewpager2:viewpager2:1.0.0",
|
||||
androidxrecyclerview : "androidx.recyclerview:recyclerview:1.1.0",
|
||||
androidxrecyclerview : "androidx.recyclerview:recyclerview:1.2.0",
|
||||
androidxcardview : "androidx.cardview:cardview:1.0.0",
|
||||
localbroadcastmanager : "androidx.localbroadcastmanager:localbroadcastmanager:1.0.0",
|
||||
// flexbox
|
||||
|
||||
@@ -118,7 +118,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
"$M_V2X$TAG",
|
||||
"路口经度为:${trafficLightResult.lon},纬度为:${trafficLightResult.lat};车的经度为:${it.longitude},纬度为:${it.latitude};两点距离为:${distance}"
|
||||
)
|
||||
val remainTime = trafficLightStatus.remain
|
||||
val remainTime = trafficLightStatus.time()
|
||||
val arriveTime = distance / speed
|
||||
CallerLogger.d(
|
||||
"$M_V2X$TAG",
|
||||
@@ -235,7 +235,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
|
||||
speed
|
||||
)
|
||||
if (content.isNullOrEmpty() || tts.isNullOrEmpty()) {
|
||||
if (content.isEmpty() || tts.isEmpty()) {
|
||||
Log.d("MsgBox-RedLightWarManaG", "alertContent或ttsContent为空!")
|
||||
}
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
@@ -263,8 +263,8 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
|
||||
gnssInfo?.let {
|
||||
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
|
||||
mogoLocation?.let {
|
||||
mLocation = it
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.mogo.eagle.core.data.biz.trafficlight.isInRange
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||
@@ -21,7 +21,8 @@ import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandl
|
||||
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_TRAFFIC_LIGHT
|
||||
import com.mogo.eagle.function.biz.v2x.trafficlight.network.TrafficLightNetWorkModel
|
||||
|
||||
class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
|
||||
class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener,
|
||||
CallerMapRoadListenerManager.OnRoadListener {
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -40,7 +41,7 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
|
||||
private var roadIDResult: RoadIDResult? = null
|
||||
@Volatile
|
||||
private var trafficLightResult: TrafficLightResult? = null
|
||||
|
||||
@Volatile
|
||||
private var inRange: Boolean = false
|
||||
@Volatile
|
||||
private var firstLoopCrossRoad: Boolean = true //开启循环请求路口
|
||||
@@ -50,6 +51,7 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
|
||||
fun initServer(context: Context) {
|
||||
mContext = context
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)
|
||||
CallerMapRoadListenerManager.registerRoadListener(TAG, this)
|
||||
mThreadHandler =
|
||||
TrafficLightThreadHandler(Looper.getMainLooper(), {
|
||||
//第一次查询路口时,如果红绿灯显示,则隐藏掉
|
||||
@@ -119,29 +121,46 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
|
||||
mThreadHandler?.sendEmptyMessageDelayed(MSG_WHAT_LOOP_SEARCH_CROSS_ROAD, 5_000L)
|
||||
}
|
||||
|
||||
override fun onRoadChange(cross: Boolean) {
|
||||
super.onRoadChange(cross)
|
||||
if(!cross){
|
||||
outOfCrossRange()
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkOutOfRange() {
|
||||
mLocation?.let { loc ->
|
||||
roadIDResult?.let {
|
||||
// 检测是否开过路口,开过路口则停止读灯。并重置 trafficLightResult 值为 null
|
||||
if (trafficLightResult != null && it.isInRange(loc.latitude, loc.longitude)) {
|
||||
if(inRange){
|
||||
return
|
||||
}
|
||||
inRange = true
|
||||
// CallerLogger.d(M_V2X + TAG, "进入路口")
|
||||
CallerLogger.d(M_V2X + TAG, "进入路口")
|
||||
CallerTrafficLightListenerManager.invokeEnterCrossRoad(true)
|
||||
return
|
||||
}
|
||||
if (inRange) {
|
||||
// CallerLogger.d(M_V2X + TAG, "离开路口")
|
||||
CallerTrafficLightListenerManager.invokeEnterCrossRoad(false)
|
||||
inRange = false
|
||||
trafficLightResult = null
|
||||
firstLoopCrossRoad = true
|
||||
mThreadHandler?.sendEmptyMessage(MSG_WHAT_STOP_SEARCH_TRAFFIC_LIGHT)
|
||||
CallerTrafficLightListenerManager.resetTrafficLightStatus()
|
||||
outOfCrossRange()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun outOfCrossRange(){
|
||||
CallerLogger.d(M_V2X + TAG, "离开路口 , inRange:$inRange")
|
||||
if(!inRange){
|
||||
return
|
||||
}
|
||||
CallerTrafficLightListenerManager.invokeEnterCrossRoad(false)
|
||||
inRange = false
|
||||
trafficLightResult = null
|
||||
firstLoopCrossRoad = true
|
||||
mThreadHandler?.sendEmptyMessage(MSG_WHAT_STOP_SEARCH_TRAFFIC_LIGHT)
|
||||
CallerTrafficLightListenerManager.resetTrafficLightStatus()
|
||||
}
|
||||
|
||||
fun getRoadResult(): RoadIDResult? {
|
||||
return roadIDResult
|
||||
}
|
||||
|
||||
@@ -4,12 +4,12 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.constants.HostConst
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.*
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
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.utilcode.util.GsonUtils
|
||||
import com.mogo.map.MogoData.Companion.mogoMapData
|
||||
|
||||
class TrafficLightNetWorkModel {
|
||||
|
||||
@@ -28,8 +28,7 @@ class TrafficLightNetWorkModel {
|
||||
request<BaseResponse<RoadIDResult>>("requestRoadID") {
|
||||
loader {
|
||||
apiCall {
|
||||
val tileId = CallerMapUIServiceManager.getMapUIController()
|
||||
?.getTileId(lon, lat) ?: 0
|
||||
val tileId = mogoMapData.get()?.getTileId(lon, lat)?:0
|
||||
val map = hashMapOf<String, String>()
|
||||
val roadIDRequestData = RoadIDRequestData(tileId, lat, lon, bearing)
|
||||
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package com.mogo.eagle.function.biz.v2x.v2n.scenario.impl;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X;
|
||||
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
import static com.mogo.map.MogoMap.DEFAULT;
|
||||
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig;
|
||||
@@ -25,24 +24,19 @@ import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
* version: 1.0
|
||||
*/
|
||||
public class V2XScenarioManager implements IV2XScenarioManager {
|
||||
private static V2XScenarioManager mV2XScenarioManager;
|
||||
private static final String TAG = "V2XScenarioManager";
|
||||
private AbsV2XScenario mV2XScenario = null;
|
||||
|
||||
private V2XScenarioManager() {
|
||||
}
|
||||
|
||||
public static V2XScenarioManager getInstance() {
|
||||
if (mV2XScenarioManager == null) {
|
||||
synchronized (V2XScenarioManager.class) {
|
||||
if (mV2XScenarioManager == null) {
|
||||
mV2XScenarioManager = new V2XScenarioManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
return mV2XScenarioManager;
|
||||
private static final class MV2XScenarioManagerHolder {
|
||||
static final V2XScenarioManager mV2XScenarioManager = new V2XScenarioManager();
|
||||
}
|
||||
|
||||
public static V2XScenarioManager getInstance() {
|
||||
return MV2XScenarioManagerHolder.mV2XScenarioManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlerMessage(V2XMessageEntity v2XMessageEntity) {
|
||||
@@ -93,7 +87,7 @@ public class V2XScenarioManager implements IV2XScenarioManager {
|
||||
* 道路事件触发后,切换到中景
|
||||
*/
|
||||
private void sceneChange() {
|
||||
IMogoMapUIController mapUiController = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
||||
IMogoMapUIController mapUiController = CallerMapUIServiceManager.INSTANCE.getMapUIController(DEFAULT);
|
||||
if (mapUiController != null && mapUiController.getCurrentMapVisualAngle() != VisualAngleMode.MODE_MEDIUM_SIGHT) {
|
||||
mapUiController.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
||||
}
|
||||
|
||||
@@ -18,11 +18,13 @@ import com.mogo.eagle.function.biz.v2x.v2n.consts.V2XConst
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.remove.MarkerRemoveManager
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.remove.MarkerWrapper
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.road.V2XAiRoadEventMarker
|
||||
import com.mogo.map.MogoMap
|
||||
import com.mogo.map.MogoData.Companion.mogoMapData
|
||||
import com.mogo.map.overlay.core.Level.ROAD_CENTER_LINE
|
||||
import com.mogo.map.overlay.line.*
|
||||
import com.mogo.map.overlay.line.Polyline
|
||||
import com.zhidaoauto.map.data.road.CenterLine
|
||||
import java.util.*
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
|
||||
/**
|
||||
@@ -33,9 +35,9 @@ class AiRoadMarker {
|
||||
companion object {
|
||||
@JvmField
|
||||
val aiMakers = ConcurrentHashMap<String, AiRoadMarker>()
|
||||
}
|
||||
|
||||
private val TAG = "AiRoadMarker"
|
||||
private const val TAG = "AiRoadMarker"
|
||||
}
|
||||
|
||||
private val marker by lazy { AtomicReference<Marker>() }
|
||||
|
||||
@@ -49,20 +51,26 @@ class AiRoadMarker {
|
||||
private val roadMarker by lazy { V2XAiRoadEventMarker() }
|
||||
|
||||
private val line = AtomicReference<Polyline>()
|
||||
private val countDown = AtomicInteger(0)
|
||||
|
||||
private val handler by lazy {
|
||||
Handler(Looper.getMainLooper())
|
||||
}
|
||||
|
||||
private val v2nDrawHandler by lazy {
|
||||
HandlerThread("v2n_draw_thread").let { it.start(); Handler(it.looper)}
|
||||
HandlerThread("v2n_draw_thread").let { it.start(); Handler(it.looper) }
|
||||
}
|
||||
|
||||
private val checkExpiredTask = Runnable {
|
||||
val poi = this.marker.get()
|
||||
val car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
if (poi != null) {
|
||||
val distance = CoordinateUtils.calculateLineDistance(car.longitude, car.latitude, poi.poi_lon, poi.poi_lat)
|
||||
val distance = CoordinateUtils.calculateLineDistance(
|
||||
car.longitude,
|
||||
car.latitude,
|
||||
poi.poi_lon,
|
||||
poi.poi_lat
|
||||
)
|
||||
if (distance < 500) {
|
||||
unMarker(poi)
|
||||
}
|
||||
@@ -70,7 +78,8 @@ class AiRoadMarker {
|
||||
}
|
||||
|
||||
private val builder by lazy {
|
||||
Polyline.Options.Builder(V2XConst.V2X_MARKER_OWNER, ROAD_CENTER_LINE).setIsGradient(true).setWidth(50f).setUseGps(true)
|
||||
Polyline.Options.Builder(V2XConst.V2X_MARKER_OWNER, ROAD_CENTER_LINE).setIsGradient(true)
|
||||
.setWidth(50f).setUseGps(true)
|
||||
}
|
||||
|
||||
fun marker(marker: Marker, drawMarker: Boolean, drawRoadLine: Boolean = false) {
|
||||
@@ -83,99 +92,130 @@ class AiRoadMarker {
|
||||
}
|
||||
if (drawRoadLine) {
|
||||
//施工中心点前方的自车行驶方向上300米距离
|
||||
val l1 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(
|
||||
var l1: CenterLine? = null
|
||||
var l2: CenterLine? = null
|
||||
mogoMapData.get()?.getCenterLineRangeInfo(
|
||||
marker.poi_lon,
|
||||
marker.poi_lat,
|
||||
location.heading.toFloat(),
|
||||
300f
|
||||
)
|
||||
//施工中心点后方的自车行驶方向上300米距离
|
||||
V2XBizTrace.onAck("$TAG --- marker --- 3 --- l1:", l1)
|
||||
val l2 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(
|
||||
marker.poi_lon,
|
||||
marker.poi_lat,
|
||||
location.heading.toFloat(),
|
||||
-300f
|
||||
)
|
||||
if (l1.points.isEmpty() || l2.points.isEmpty()) {
|
||||
V2XBizTrace.onAck("$TAG --- marker --- 3 --- return ----", "")
|
||||
return@post
|
||||
}
|
||||
V2XBizTrace.onAck("$TAG --- marker --- 4 --- l2:", l2)
|
||||
val points = LinkedList<MogoLatLng>()
|
||||
if (l2 != null && l2.points.isNotEmpty()) {
|
||||
points.addAll(l2.points.reversed().map {
|
||||
MogoLatLng(it.second, it.first)
|
||||
300f, call = { result ->
|
||||
//施工中心点后方的自车行驶方向上300米距离
|
||||
result?.let {
|
||||
V2XBizTrace.onAck("$TAG --- marker --- 3 --- l1:", it)
|
||||
l1 = result
|
||||
}
|
||||
countDown.incrementAndGet()
|
||||
realMark(marker, wrapper, l1, l2, location.heading)
|
||||
})
|
||||
}
|
||||
val centerX = marker.poi_lon
|
||||
val centerY = marker.poi_lat
|
||||
V2XBizTrace.onAck("$TAG --- marker --- 5 --- marker:", marker)
|
||||
val farthestPoint = marker.polygon?.let {
|
||||
var find: Pair<Double, Double> = Pair(centerX, centerY)
|
||||
var min = Long.MAX_VALUE
|
||||
for (p in it) {
|
||||
val angle = DrivingDirectionUtils.getDegreeOfCar2Poi2(
|
||||
centerX,
|
||||
centerY,
|
||||
p.first,
|
||||
p.second,
|
||||
location.heading
|
||||
)
|
||||
if (angle < min) {
|
||||
min = angle
|
||||
find = p
|
||||
mogoMapData.get()?.getCenterLineRangeInfo(
|
||||
marker.poi_lon,
|
||||
marker.poi_lat,
|
||||
location.heading.toFloat(),
|
||||
-300f, call = { result ->
|
||||
result?.let {
|
||||
V2XBizTrace.onAck("$TAG --- marker --- 3 --- l2:", it)
|
||||
l2 = result
|
||||
}
|
||||
}
|
||||
MogoLatLng(find.second, find.first)
|
||||
} ?: MogoLatLng(centerY, centerX)
|
||||
marker.farthestPoint = Pair(farthestPoint.lon, farthestPoint.lat)
|
||||
V2XBizTrace.onAck("$TAG --- marker --- 6 --- marker:", marker)
|
||||
if (l1 != null && l1.points.isNotEmpty()) {
|
||||
for (l in l1.points) {
|
||||
if (DrivingDirectionUtils.getDegreeOfCar2Poi2(
|
||||
farthestPoint.lon,
|
||||
farthestPoint.lat,
|
||||
l.first,
|
||||
l.second,
|
||||
(location.heading + 180)
|
||||
) < 90L
|
||||
) {
|
||||
points.add(l.let { MogoLatLng(it.second, it.first) })
|
||||
}
|
||||
}
|
||||
}
|
||||
if (points.size <= 1) {
|
||||
return@post
|
||||
}
|
||||
val evaluator = ArgbEvaluator()
|
||||
val interceptor = DecelerateInterpolator(1.5f)
|
||||
val total = points.size
|
||||
val colors = ArrayList<Int>()
|
||||
(0..total).forEach { i ->
|
||||
colors += evaluator.evaluate(
|
||||
interceptor.getInterpolation(i * 1f / total),
|
||||
START_COLOR,
|
||||
END_COLOR
|
||||
) as Int
|
||||
}
|
||||
builder.points(points)
|
||||
builder.colors(colors)
|
||||
builder.setVisible(true)
|
||||
V2XBizTrace.onAck("$TAG --- marker --- 7 --- points:", "${points.size}")
|
||||
val line = overlayManager?.showOrUpdateLine(builder.build())
|
||||
if (line != null) {
|
||||
this.line.set(line)
|
||||
wrapper.addLine(line)
|
||||
}
|
||||
countDown.incrementAndGet()
|
||||
realMark(marker, wrapper, l1, l2, location.heading)
|
||||
})
|
||||
}
|
||||
wrapper.onRemoved = { id ->
|
||||
aiMakers.remove(id)
|
||||
}
|
||||
MarkerRemoveManager.addMarker(wrapper)
|
||||
}
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
private fun realMark(
|
||||
marker: Marker,
|
||||
wrapper: MarkerWrapper,
|
||||
l1: CenterLine?,
|
||||
l2: CenterLine?,
|
||||
heading: Double
|
||||
) {
|
||||
if (countDown.get() != 2) {
|
||||
return
|
||||
}
|
||||
if (l1 == null || l2 == null) {
|
||||
V2XBizTrace.onAck("$TAG --- marker --- 3 --- line null return ----", "")
|
||||
return
|
||||
}
|
||||
if (l1.points.isEmpty() || l2.points.isEmpty()) {
|
||||
V2XBizTrace.onAck("$TAG --- marker --- 3 --- line points null return ----", "")
|
||||
return
|
||||
}
|
||||
V2XBizTrace.onAck("$TAG --- marker --- 4 --- l2:", l2)
|
||||
val points = LinkedList<MogoLatLng>()
|
||||
if (l2.points.isNotEmpty()) {
|
||||
points.addAll(l2.points.reversed().map {
|
||||
MogoLatLng(it.latitude, it.longitude)
|
||||
})
|
||||
}
|
||||
val centerX = marker.poi_lon
|
||||
val centerY = marker.poi_lat
|
||||
V2XBizTrace.onAck("$TAG --- marker --- 5 --- marker:", marker)
|
||||
val farthestPoint = marker.polygon?.let {
|
||||
var find: Pair<Double, Double> = Pair(centerX, centerY)
|
||||
var min = Long.MAX_VALUE
|
||||
for (p in it) {
|
||||
val angle = DrivingDirectionUtils.getDegreeOfCar2Poi2(
|
||||
centerX,
|
||||
centerY,
|
||||
p.first,
|
||||
p.second,
|
||||
heading
|
||||
)
|
||||
if (angle < min) {
|
||||
min = angle
|
||||
find = p
|
||||
}
|
||||
}
|
||||
MogoLatLng(find.second, find.first)
|
||||
} ?: MogoLatLng(centerY, centerX)
|
||||
marker.farthestPoint = Pair(farthestPoint.lon, farthestPoint.lat)
|
||||
V2XBizTrace.onAck("$TAG --- marker --- 6 --- marker:", marker)
|
||||
if (l1.points.isNotEmpty()) {
|
||||
for (l in l1.points) {
|
||||
if (DrivingDirectionUtils.getDegreeOfCar2Poi2(
|
||||
farthestPoint.lon,
|
||||
farthestPoint.lat,
|
||||
l.longitude,
|
||||
l.latitude,
|
||||
(heading + 180)
|
||||
) < 90L
|
||||
) {
|
||||
points.add(l.let { MogoLatLng(it.latitude, it.longitude) })
|
||||
}
|
||||
}
|
||||
}
|
||||
if (points.size <= 1) {
|
||||
return
|
||||
}
|
||||
val evaluator = ArgbEvaluator()
|
||||
val interceptor = DecelerateInterpolator(1.5f)
|
||||
val total = points.size
|
||||
val colors = ArrayList<Int>()
|
||||
(0..total).forEach { i ->
|
||||
colors += evaluator.evaluate(
|
||||
interceptor.getInterpolation(i * 1f / total),
|
||||
START_COLOR,
|
||||
END_COLOR
|
||||
) as Int
|
||||
}
|
||||
builder.points(points)
|
||||
builder.colors(colors)
|
||||
builder.setVisible(true)
|
||||
V2XBizTrace.onAck("$TAG --- marker --- 7 --- points:", "${points.size}")
|
||||
val line = overlayManager?.showOrUpdateLine(builder.build())
|
||||
if (line != null) {
|
||||
this.line.set(line)
|
||||
wrapper.addLine(line)
|
||||
}
|
||||
wrapper.onRemoved = { id ->
|
||||
aiMakers.remove(id)
|
||||
}
|
||||
MarkerRemoveManager.addMarker(wrapper)
|
||||
countDown.set(0)
|
||||
}
|
||||
|
||||
private fun removeLine() {
|
||||
val old = line.get()
|
||||
V2XBizTrace.onAck("$TAG --- removeRedLine --- 1", "")
|
||||
@@ -202,7 +242,12 @@ class AiRoadMarker {
|
||||
val poi = this.marker.get()
|
||||
val car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
if (poi != null) {
|
||||
val distance = CoordinateUtils.calculateLineDistance(car.longitude, car.latitude, poi.poi_lon, poi.poi_lat)
|
||||
val distance = CoordinateUtils.calculateLineDistance(
|
||||
car.longitude,
|
||||
car.latitude,
|
||||
poi.poi_lon,
|
||||
poi.poi_lat
|
||||
)
|
||||
V2XBizTrace.onAck(
|
||||
"$TAG --- receive --- 2 ---",
|
||||
"car:[${car.longitude}, ${car.latitude}] -> poi:[${poi.poi_lon}, ${poi.poi_lat}] --> distance:$distance"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.road;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X;
|
||||
import static com.mogo.map.MogoMap.DEFAULT;
|
||||
|
||||
import androidx.core.util.Pair;
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
|
||||
@@ -54,7 +55,7 @@ public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
|
||||
.longitude(entity.getLocation().getLon())
|
||||
.latitude(entity.getLocation().getLat())
|
||||
.set3DMode(true)
|
||||
.icon3DRes(EventTypeEnumNew.getMarker3DRes(entity.getPoiType())).build());
|
||||
.icon3DRes(EventTypeEnumNew.getMarker3DRes(entity.getPoiType())).build(),DEFAULT);
|
||||
if (point != null) {
|
||||
V2XBizTrace.Companion.onAck("V2XRoadEventMarker -> --- add Marker type: ", entity.getPoiType());
|
||||
ArrayList<Point> markers = new ArrayList<>();
|
||||
|
||||
@@ -5,8 +5,6 @@ import com.mogo.commons.utils.MogoAnalyticUtils
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.enums.CommunicationType
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.api.biz.IFuncBizProvider
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizListenerManager
|
||||
@@ -17,7 +15,7 @@ import java.util.concurrent.atomic.AtomicBoolean
|
||||
/**
|
||||
* V2X消息播报埋点统计
|
||||
*/
|
||||
object V2XEventAnalyticsManager: IMoGoChassisLocationWGS84Listener,IFuncBizProvider{
|
||||
object V2XEventAnalyticsManager: IFuncBizProvider{
|
||||
|
||||
private const val TAG = "V2XEventAnalyticsManager"
|
||||
private val hasInit by lazy { AtomicBoolean(false) }
|
||||
@@ -38,10 +36,6 @@ object V2XEventAnalyticsManager: IMoGoChassisLocationWGS84Listener,IFuncBizProvi
|
||||
private const val EVENT_PARAMS_LATITUDE ="latitude" // 纬度
|
||||
private const val EVENT_PARAMS_HEADING ="heading" // 航向角
|
||||
|
||||
private var longitude: Double?=null //经度
|
||||
private var latitude: Double?=null //纬度
|
||||
private var heading: Double?=null //航向角
|
||||
|
||||
private var oldTime = System.currentTimeMillis()
|
||||
|
||||
fun init(){
|
||||
@@ -52,13 +46,11 @@ object V2XEventAnalyticsManager: IMoGoChassisLocationWGS84Listener,IFuncBizProvi
|
||||
|
||||
private fun registerListener(){
|
||||
// 添加 ADAS车辆状态&定位 监听
|
||||
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
|
||||
CallerFuncBizListenerManager.addListener(TAG,this)
|
||||
}
|
||||
|
||||
private fun unRegisterListener(){
|
||||
// 移除 ADAS车辆状态&定位 监听
|
||||
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
|
||||
CallerFuncBizListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
@@ -87,9 +79,9 @@ object V2XEventAnalyticsManager: IMoGoChassisLocationWGS84Listener,IFuncBizProvi
|
||||
msgEventParams[EVENT_PARAMS_PLATE_NUMBER] = AppConfigInfo.plateNumber //车牌号
|
||||
msgEventParams[EVENT_PARAMS_CAR_SN] = MoGoAiCloudClientConfig.getInstance().sn //鹰眼SN
|
||||
msgEventParams[EVENT_PARAMS_EYE_VERSION] = AppUtils.getAppVersionName() //鹰眼版本
|
||||
msgEventParams[EVENT_PARAMS_LONGITUDE] = "$longitude" //经度
|
||||
msgEventParams[EVENT_PARAMS_LATITUDE] = "$latitude" //纬度
|
||||
msgEventParams[EVENT_PARAMS_HEADING] = "$heading" //航向角
|
||||
msgEventParams[EVENT_PARAMS_LONGITUDE] = "${CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude}" //经度
|
||||
msgEventParams[EVENT_PARAMS_LATITUDE] = "${CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude}" //纬度
|
||||
msgEventParams[EVENT_PARAMS_HEADING] = "${CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().heading}" //航向角
|
||||
MogoAnalyticUtils.track(EVENT_KEY_RECEIVE_V2X_MSG,msgEventParams)
|
||||
}
|
||||
|
||||
@@ -109,20 +101,12 @@ object V2XEventAnalyticsManager: IMoGoChassisLocationWGS84Listener,IFuncBizProvi
|
||||
msgEventParams[EVENT_PARAMS_PLATE_NUMBER] = AppConfigInfo.plateNumber //车牌号
|
||||
msgEventParams[EVENT_PARAMS_CAR_SN] = MoGoAiCloudClientConfig.getInstance().sn //鹰眼SN
|
||||
msgEventParams[EVENT_PARAMS_EYE_VERSION] = AppUtils.getAppVersionName() //鹰眼版本
|
||||
msgEventParams[EVENT_PARAMS_LONGITUDE] = "$longitude" //经度
|
||||
msgEventParams[EVENT_PARAMS_LATITUDE] = "$latitude" //纬度
|
||||
msgEventParams[EVENT_PARAMS_HEADING] = "$heading" //航向角
|
||||
msgEventParams[EVENT_PARAMS_LONGITUDE] = "${CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude}" //经度
|
||||
msgEventParams[EVENT_PARAMS_LATITUDE] = "${CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude}" //纬度
|
||||
msgEventParams[EVENT_PARAMS_HEADING] = "${CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().heading}" //航向角
|
||||
MogoAnalyticUtils.track(EVENT_KEY_V2X_MSG_EVENT,msgEventParams)
|
||||
}
|
||||
|
||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||
gnssInfo.let {
|
||||
longitude = it.longitude
|
||||
latitude = it.latitude
|
||||
heading = it.heading
|
||||
}
|
||||
}
|
||||
|
||||
fun onDestroy(){
|
||||
if (hasInit.compareAndSet(true, false)){
|
||||
unRegisterListener()
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.currentRoadTrafficLight
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.isGreen
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.time
|
||||
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.CommunicationType
|
||||
@@ -34,6 +35,7 @@ import com.mogo.eagle.function.biz.v2x.trafficlight.core.MogoTrafficLightManager
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.utils.V2XEventAnalyticsManager
|
||||
import com.mogo.eagle.function.biz.v2x.vip.network.VipNetWorkModel
|
||||
import com.zhjt.service_biz.BizConfig
|
||||
import kotlin.math.abs
|
||||
|
||||
class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListener,
|
||||
Handler.Callback {
|
||||
@@ -133,7 +135,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
if (!turnLight) {
|
||||
// 首次判断,变灯
|
||||
turnLight = true
|
||||
val controlTime = if (currentResult!!.isGreen()) 45 - currentResult.remain else 45
|
||||
val controlTime = if (currentResult!!.isGreen()) 45 - abs(currentResult.time()) else 45
|
||||
turnLight(controlTime)
|
||||
}
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ class MoGoAutopilotControlProvider :
|
||||
timer = Timer()
|
||||
}
|
||||
// 10s同步一次数据到乘客屏
|
||||
timer!!.schedule(object : TimerTask() {
|
||||
timer?.schedule(object : TimerTask() {
|
||||
override fun run() {
|
||||
// 同步是否开启美化模式
|
||||
setDemoMode(FunctionBuildConfig.isDemoMode)
|
||||
@@ -424,7 +424,7 @@ class MoGoAutopilotControlProvider :
|
||||
}
|
||||
|
||||
override fun cancelAutoPilot() {
|
||||
if (AdasManager.getInstance().ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.CONNECTED) {
|
||||
if (AdasManager.getInstance().ipcConnectionStatus == IPC_CONNECTION_STATUS.CONNECTED) {
|
||||
AdasManager.getInstance().sendAutoPilotModeReq(0, 1, null)
|
||||
} else {
|
||||
CallerLogger.e("$M_D_C$TAG", "车机与工控机链接失败,无法断开自动驾驶")
|
||||
@@ -687,10 +687,6 @@ class MoGoAutopilotControlProvider :
|
||||
|
||||
/**
|
||||
* 获取数据采集录制模式配置列表
|
||||
* @param reqType 0: all, 1:获取当前所有topic列表, 2:配置需要预加载的topic组合
|
||||
* @param recordType 0:不需要修改内置类型的topic组合, 1:需要修改内置类型的topic组合
|
||||
* @param topicsNeedToCache
|
||||
* @return boolean
|
||||
*/
|
||||
override fun sendBagManagerCmd(bagManagerEntity: BagManagerEntity): Boolean {
|
||||
val bagManager = BagManagerOuterClass.BagManager
|
||||
|
||||
@@ -212,7 +212,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
* 底盘数据
|
||||
*
|
||||
* @param header 头
|
||||
* @param vehicleState 数据
|
||||
* @param chassisStates 数据
|
||||
*/
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_TYPE_SOCKET_VEHICLE,
|
||||
@@ -492,7 +492,9 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
header: MessagePad.Header?,
|
||||
spatWarningData: ObuScene.SpatWarningData?
|
||||
) {
|
||||
CallerObuWarningSpatListenerManager.invokeObuSpatWarning(spatWarningData!!)
|
||||
spatWarningData?.let {
|
||||
CallerObuWarningSpatListenerManager.invokeObuSpatWarning(it)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -505,7 +507,9 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
header: MessagePad.Header?,
|
||||
rsiWarningData: ObuScene.RsiWarningData?
|
||||
) {
|
||||
CallerObuWarningRsiListenerManager.invokeObuRsiWarning(rsiWarningData!!)
|
||||
rsiWarningData?.let {
|
||||
CallerObuWarningRsiListenerManager.invokeObuRsiWarning(it)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -518,7 +522,9 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
header: MessagePad.Header?,
|
||||
rsmWarningData: ObuScene.RsmWarningData?
|
||||
) {
|
||||
CallerObuWarningRsmListenerManager.invokeObuRsmWarning(rsmWarningData!!)
|
||||
rsmWarningData?.let {
|
||||
CallerObuWarningRsmListenerManager.invokeObuRsmWarning(it)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -528,7 +534,9 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
* @param mapMatchData 数据
|
||||
*/
|
||||
override fun onObuMapMath(header: MessagePad.Header?, mapMatchData: ObuScene.MapMatchData?) {
|
||||
CallerObuMapMathListenerManager.invokeObuMapMath(mapMatchData!!)
|
||||
mapMatchData?.let {
|
||||
CallerObuMapMathListenerManager.invokeObuMapMath(it)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -894,13 +902,9 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
}
|
||||
|
||||
override fun onParallelDrivingAbility(
|
||||
isParallelDrivingAbility: Boolean,
|
||||
unableParallelDrivingReasons: java.util.ArrayList<UnableLaunchReason>?
|
||||
isParallelDrivingAbility: Boolean
|
||||
) {
|
||||
CallerParallelDrivingActionsListenerManager.invokeParallelDrivingAbility(
|
||||
isParallelDrivingAbility,
|
||||
unableParallelDrivingReasons
|
||||
)
|
||||
CallerParallelDrivingActionsListenerManager.invokeParallelDrivingAbility(isParallelDrivingAbility)
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
|
||||
@@ -332,7 +332,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
||||
)
|
||||
// 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu
|
||||
if (rsmWarningData != null && rsmWarningData.participant != null) {
|
||||
var v2xType = when (rsmWarningData.participant.ptcType) {
|
||||
val v2xType = when (rsmWarningData.participant.ptcType) {
|
||||
1 -> { //机动车
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiType
|
||||
}
|
||||
@@ -434,12 +434,12 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
||||
fun onMogoObuDcSpatWarning(spatWarningData: ObuScene.SpatWarningData?) {
|
||||
CallerLogger.d(
|
||||
"${M_OBU}${TAG}",
|
||||
"onMogoObuDcSpatWarning warningType = ${spatWarningData!!.warningType} --status = ${spatWarningData?.status} --lightsList = ${spatWarningData.lightsList}"
|
||||
"onMogoObuDcSpatWarning warningType = ${spatWarningData!!.warningType} --status = ${spatWarningData.status} --lightsList = ${spatWarningData.lightsList}"
|
||||
)
|
||||
handlerTrafficLight(
|
||||
spatWarningData!!.warningType,
|
||||
spatWarningData?.status,
|
||||
spatWarningData?.lightsList
|
||||
spatWarningData.warningType,
|
||||
spatWarningData.status,
|
||||
spatWarningData.lightsList
|
||||
)
|
||||
}
|
||||
|
||||
@@ -520,7 +520,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
||||
MogoObuShowConstants.STATUS.ADD,
|
||||
MogoObuShowConstants.STATUS.UPDATE
|
||||
-> {
|
||||
if (lights != null && lights.isNotEmpty()) {
|
||||
if (lights.isNotEmpty()) {
|
||||
changeTrafficLightStatus(appId, lights)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,8 +65,8 @@ object TrafficMarkerDrawer {
|
||||
* 更新识别数据,V2V预警的时候需要修改车辆颜色
|
||||
*/
|
||||
fun updateITrafficInfo(trafficData: TrafficData) {
|
||||
if (trafficData.uuid != null) {
|
||||
mTrafficMap[trafficData.uuid!!] = trafficData
|
||||
trafficData.uuid?.let {
|
||||
mTrafficMap[it] = trafficData
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,12 +85,12 @@ object TrafficMarkerDrawer {
|
||||
tempTraffic.lat = trafficData.lat
|
||||
tempTraffic.lon = trafficData.lon
|
||||
tempTraffic.heading = trafficData.heading
|
||||
if (trafficData.uuid != null) {
|
||||
mTrafficMap[trafficData.uuid!!] = tempTraffic
|
||||
trafficData.uuid?.let {
|
||||
mTrafficMap[it] = tempTraffic
|
||||
}
|
||||
} else {
|
||||
if (trafficData.uuid != null) {
|
||||
mTrafficMap[trafficData.uuid!!] = trafficData
|
||||
trafficData.uuid?.let {
|
||||
mTrafficMap[it] = trafficData
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,12 +111,12 @@ object TrafficMarkerDrawer {
|
||||
tempTraffic.lon = trafficData.lon
|
||||
tempTraffic.heading = trafficData.heading
|
||||
tempTraffic.threatLevel = trafficData.threatLevel
|
||||
if (trafficData.uuid != null) {
|
||||
mTrafficMap[trafficData.uuid!!] = tempTraffic
|
||||
trafficData.uuid?.let {
|
||||
mTrafficMap[it] = tempTraffic
|
||||
}
|
||||
} else {
|
||||
if (trafficData.uuid != null) {
|
||||
mTrafficMap[trafficData.uuid!!] = trafficData
|
||||
trafficData.uuid?.let {
|
||||
mTrafficMap[it] = trafficData
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -197,8 +197,8 @@ object TrafficMarkerDrawer {
|
||||
|
||||
// 缓存3D资源
|
||||
mMarkerCachesResMd5Values[resIdVal] = options.resName ?: "" // 缓存数据
|
||||
if (trafficData.uuid != null) {
|
||||
mMarkersCaches[trafficData.uuid!!] = point
|
||||
trafficData.uuid?.let {
|
||||
mMarkersCaches[it] = point
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -293,10 +293,10 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
|
||||
"updateTrafficLight ----- currentTrafficLight = $currentTrafficLight"
|
||||
)
|
||||
currentTrafficLight?.let {
|
||||
val remain = if (it.remain > 99) {
|
||||
val remain = if (it.time() > 99) {
|
||||
99
|
||||
} else {
|
||||
it.remain
|
||||
it.time()
|
||||
}
|
||||
onTrafficLightPlusSource(it.convert(), remain, DataSourceType.AICLOUD)
|
||||
}
|
||||
|
||||
@@ -17,12 +17,10 @@ import com.mogo.eagle.core.data.deva.badcase.BagDescriptionEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagInfoEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagManagerEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.RecordCaseEntity
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84
|
||||
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
|
||||
@@ -37,12 +35,10 @@ import com.zhidao.loglib.upload.UploadManager
|
||||
import com.zhidao.loglib.util.FileUtil
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseAnalyticsManager
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseManager
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.record.RecordManager
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import record_cache.RecordPanelOuterClass
|
||||
import java.io.File
|
||||
import java.lang.StringBuilder
|
||||
@@ -55,7 +51,7 @@ import java.util.*
|
||||
* @since: 2022/7/13
|
||||
*/
|
||||
class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
IMoGoAutopilotRecordListener, IMoGoChassisLocationWGS84Listener {
|
||||
IMoGoAutopilotRecordListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "InitiativeBadCaseWindow"
|
||||
@@ -94,8 +90,6 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
private var recordFileName: String?=null //录制文件包名
|
||||
private var receiveTime: String?= null
|
||||
private var uploadStamp: String = System.currentTimeMillis().toString()
|
||||
private var longitude: Double?=null
|
||||
private var latitude: Double?=null
|
||||
|
||||
private var bagManagerEntity: BagManagerEntity = BagManagerEntity()
|
||||
|
||||
@@ -109,7 +103,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
private var clickListener: ClickListener? = null
|
||||
|
||||
init {
|
||||
initFloatWindow();
|
||||
initFloatWindow()
|
||||
}
|
||||
|
||||
private val presenter by lazy {
|
||||
@@ -147,8 +141,6 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
|
||||
//采集结果回调监听
|
||||
CallerAutopilotRecordListenerManager.addListener(this.hashCode().toString(),this)
|
||||
// 添加 ADAS车辆状态&定位 监听
|
||||
CallerChassisLocationWGS84ListenerManager.addListener(this.hashCode().toString(), this)
|
||||
viewAudioButton.setOnClickListener {
|
||||
audioStatus = !audioStatus
|
||||
setAudio(audioStatus)
|
||||
@@ -309,14 +301,14 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
itx["audioUrl"] = downloadUrl?:"" //音频COS地址
|
||||
itx["mapVersion"] = BadCaseConfig.dockerVersion ?:"" //工控机版本
|
||||
itx["eyeVersion"] = AppUtils.getAppVersionName() //鹰眼版本
|
||||
itx["coordinate"] = "latitude:${latitude};longitude:${longitude}" //坐标
|
||||
itx["coordinate"] = "latitude:${getChassisLocationWGS84().latitude};longitude:${getChassisLocationWGS84().longitude}" //坐标
|
||||
})
|
||||
if (uploadResult == null || uploadResult.code != 200) {
|
||||
TipToast.shortTip("上报失败")
|
||||
} else {
|
||||
TipToast.shortTip("上报成功")
|
||||
//将上报BI的结果同步给工控机记录保存
|
||||
recordKey?.let {
|
||||
recordKey.let {
|
||||
val hasAudio = downloadUrl != null
|
||||
val descReqEntity = BagDescriptionEntity(uploadReason.toString(),hasAudio,downloadUrl.toString(),true)
|
||||
bagManagerEntity.reqType = 5
|
||||
@@ -324,15 +316,16 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
bagManagerEntity.descReq = descReqEntity
|
||||
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
|
||||
}
|
||||
val loc = getChassisLocationWGS84()
|
||||
BadCaseAnalyticsManager.bagRecordUpload(recordKey.toString(),recordFileName?:"",uploadStamp,
|
||||
"100",AppConfigInfo.plateNumber,BadCaseConfig.totalDuration.toString(),MoGoAiCloudClientConfig.getInstance().sn,
|
||||
BadCaseConfig.dockerVersion ?:"",AppUtils.getAppVersionName(),latitude.toString(),longitude.toString(),
|
||||
BadCaseConfig.dockerVersion ?:"",AppUtils.getAppVersionName(),loc.latitude.toString(),loc.longitude.toString(),
|
||||
BadCaseConfig.identity,downloadUrl?:"",uploadReason.toString(),System.currentTimeMillis().toString(),"1")
|
||||
//日志
|
||||
CallerLogger.i("$M_DEVA$TAG", "BadCase Initiative Analytics="+"key="+recordKey+" filename="+recordFileName+
|
||||
" receiveTime="+uploadStamp+" stat="+"100"+" plateNumber="+AppConfigInfo.plateNumber+
|
||||
" totalDuration="+ BadCaseConfig.totalDuration +" carSn="+MoGoAiCloudClientConfig.getInstance().sn+" mapVersion="+BadCaseConfig.dockerVersion+
|
||||
" eyeVersion="+AppUtils.getAppVersionName()+" latitude="+ latitude +" longitude="+ longitude+
|
||||
" eyeVersion="+AppUtils.getAppVersionName()+" latitude="+ loc.latitude +" longitude="+ loc.longitude+
|
||||
" identity="+BadCaseConfig.identity + " downloadUrl="+downloadUrl +" uploadReason="+uploadReason+
|
||||
" uploadTime="+System.currentTimeMillis()+" channel="+"1")
|
||||
BadCaseConfig.windowNum--
|
||||
@@ -413,8 +406,6 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
fun hideFloatWindow() {
|
||||
//注销采集结果回调监听
|
||||
CallerAutopilotRecordListenerManager.removeListener(this.hashCode().toString())
|
||||
// 移除 ADAS车辆状态&定位 监听
|
||||
CallerChassisLocationWGS84ListenerManager.removeListener(this.hashCode().toString())
|
||||
if (mFloatLayout.parent != null) mWindowManager!!.removeView(mFloatLayout)
|
||||
}
|
||||
|
||||
@@ -440,9 +431,4 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
fun closeWindow()
|
||||
}
|
||||
|
||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||
latitude = gnssInfo.latitude
|
||||
longitude = gnssInfo.longitude
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,8 +6,6 @@ import android.graphics.Color
|
||||
import android.graphics.PixelFormat
|
||||
import android.os.CountDownTimer
|
||||
import android.os.Handler
|
||||
import android.os.Parcel
|
||||
import android.os.Parcelable
|
||||
import android.util.DisplayMetrics
|
||||
import android.view.*
|
||||
import android.widget.CheckBox
|
||||
@@ -19,10 +17,8 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagDescriptionEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagManagerEntity
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.RecordBagMsg
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
@@ -38,7 +34,6 @@ import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.record.RecordManager
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import com.zhidao.loglib.upload.UploadManager
|
||||
import com.zhidao.loglib.util.FileUtil
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseAnalyticsManager
|
||||
@@ -52,7 +47,7 @@ import java.io.File
|
||||
* @since: 2022/7/17
|
||||
*/
|
||||
class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
IMoGoChassisLocationWGS84Listener, CompoundButton.OnCheckedChangeListener {
|
||||
CompoundButton.OnCheckedChangeListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "PassiveBadCaseWindow"
|
||||
@@ -74,8 +69,6 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
private var receiveTime: String ?= null //接收时间
|
||||
private var stat: String = ""
|
||||
private var boxBean: MsgBoxBean ?= null
|
||||
private var longitude: Double = 0.0
|
||||
private var latitude: Double = 0.0
|
||||
|
||||
private var mInViewX = 0f
|
||||
private var mInViewY = 0f
|
||||
@@ -100,7 +93,7 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
private lateinit var flReasonLayout: FlexboxLayout
|
||||
|
||||
init {
|
||||
initFloatWindow();
|
||||
initFloatWindow()
|
||||
}
|
||||
|
||||
private val presenter by lazy {
|
||||
@@ -126,8 +119,6 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
BadCaseConfig.windowNum++
|
||||
tvPassiveTime.text = "时间:${millis2String(System.currentTimeMillis(),TimeUtils.getHourMinSecondFormat())}"
|
||||
tvPassiveIdentity.text = "身份:${BadCaseConfig.identity}"
|
||||
// 添加 ADAS车辆状态&定位 监听
|
||||
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
|
||||
viewAudioButton.setOnClickListener {
|
||||
audioStatus = !audioStatus
|
||||
setAudio(audioStatus)
|
||||
@@ -271,7 +262,7 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
itx["audioUrl"] = downloadUrl?:"" //音频COS地址
|
||||
itx["mapVersion"] = BadCaseConfig.dockerVersion ?:"" //工控机版本
|
||||
itx["eyeVersion"] = AppUtils.getAppVersionName() //鹰眼版本
|
||||
itx["coordinate"] = "latitude:${latitude};longitude:${longitude}" //坐标
|
||||
itx["coordinate"] = "latitude:${CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude};longitude:${CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude}" //坐标
|
||||
|
||||
})
|
||||
if (uploadResult == null || uploadResult.code != 200) {
|
||||
@@ -288,15 +279,16 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
|
||||
}
|
||||
//被动上报埋点统计
|
||||
val loc = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
BadCaseAnalyticsManager.bagRecordUpload(recordKey?:"",recordFileName?:"",receiveTime?:System.currentTimeMillis().toString(),
|
||||
stat,AppConfigInfo.plateNumber,BadCaseConfig.totalDuration.toString(),MoGoAiCloudClientConfig.getInstance().sn,
|
||||
BadCaseConfig.dockerVersion ?:"",AppUtils.getAppVersionName(),latitude.toString(),longitude.toString(),
|
||||
BadCaseConfig.dockerVersion ?:"",AppUtils.getAppVersionName(),loc.latitude.toString(),loc.longitude.toString(),
|
||||
BadCaseConfig.identity,downloadUrl?:"",uploadReason,System.currentTimeMillis().toString(),"0")
|
||||
//日志
|
||||
CallerLogger.i("$M_DEVA$TAG", "BadCase Passive Analytics="+"key="+recordKey+" filename="+recordFileName+
|
||||
" receiveTime="+receiveTime+" stat="+"100"+" plateNumber="+AppConfigInfo.plateNumber+
|
||||
" totalDuration="+ BadCaseConfig.totalDuration +" carSn="+MoGoAiCloudClientConfig.getInstance().sn+" mapVersion="+BadCaseConfig.dockerVersion+
|
||||
" eyeVersion="+AppUtils.getAppVersionName()+" latitude="+ latitude +" longitude="+ longitude+
|
||||
" eyeVersion="+AppUtils.getAppVersionName()+" latitude="+ loc.latitude +" longitude="+ loc.longitude+
|
||||
" identity="+BadCaseConfig.identity + " downloadUrl="+downloadUrl +" uploadReason="+uploadReason+
|
||||
" uploadTime="+System.currentTimeMillis()+" channel="+"0")
|
||||
BadCaseConfig.windowNum--
|
||||
@@ -390,7 +382,6 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
|
||||
fun hideFloatWindow() {
|
||||
// 移除 ADAS车辆状态&定位 监听
|
||||
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
|
||||
if (mFloatLayout.parent != null) mWindowManager!!.removeView(mFloatLayout)
|
||||
}
|
||||
|
||||
@@ -411,9 +402,4 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
fun closeWindow()
|
||||
}
|
||||
|
||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||
latitude = gnssInfo.latitude
|
||||
longitude = gnssInfo.longitude
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,7 +18,6 @@ import com.mogo.eagle.core.function.api.map.deva.IMoGoMapDevaProvider
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDevaListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
@@ -26,6 +25,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.map.MogoData
|
||||
import com.zhidao.loglib.bean.RemoteLogPushContent
|
||||
import com.zhidao.loglib.call.LogInfoManagerFactory
|
||||
import com.zhidao.loglib.core.ILogListener
|
||||
@@ -224,7 +224,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
|
||||
config.isShowDebugLog = true
|
||||
config.isShowNetDebugLog = true
|
||||
}
|
||||
CallerMapUIServiceManager.getMapUIController()?.setDebugMode(true)
|
||||
// MogoData.mogoMapData.get()?.setDebugMode(true)
|
||||
CallerAutoPilotControlManager.setEnableLog(true)
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
|
||||
config.isShowDebugLog = false
|
||||
config.isShowNetDebugLog = false
|
||||
}
|
||||
CallerMapUIServiceManager.getMapUIController()?.setDebugMode(false)
|
||||
// MogoData.mogoMapData.get()?.setDebugMode(false)
|
||||
CallerAutoPilotControlManager.setEnableLog(false)
|
||||
}
|
||||
|
||||
|
||||
@@ -23,9 +23,6 @@ import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.function.hmi.ui.utils.SearchCriteria;
|
||||
import com.mogo.eagle.core.function.hmi.ui.utils.TagColorUtil;
|
||||
|
||||
import me.jessyan.autosize.AutoSizeCompat;
|
||||
|
||||
|
||||
public class LogItemAdapter extends AbsRecyclerAdapter<AbsViewBinder<LogLine>, LogLine> implements Filterable {
|
||||
|
||||
public LogItemAdapter(Context context) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui.map
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.os.Looper
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.ProgressBar
|
||||
@@ -10,16 +11,16 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.mogo.map.hdcache.IHdCacheListener
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.map.MogoData.Companion.mogoMapData
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
/**
|
||||
* 离线地图缓存
|
||||
*/
|
||||
class OfflineMapDialog(context: Context): BaseFloatDialog(context) {
|
||||
class OfflineMapDialog(context: Context) : BaseFloatDialog(context) {
|
||||
|
||||
private var roundRootLayout: ConstraintLayout? = null
|
||||
private var offlineTitleView: TextView? = null
|
||||
@@ -86,37 +87,29 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) {
|
||||
|
||||
okView?.setOnClickListener {
|
||||
if (isLoading) {
|
||||
CallerMapUIServiceManager.cancelDownloadCacheData()
|
||||
mogoMapData.get()?.cancelDownloadCacheData()
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
private fun cacheHDDataByCityByLonLat() {
|
||||
CallerMapUIServiceManager.cacheHDDataByCityByLonLat(object : IHdCacheListener {
|
||||
override fun onMapHdCacheProgress(cityId: Int, progress: Double) {
|
||||
mogoMapData.get()?.cacheHDDataByCityByLonLat(location!!, { _, progress ->
|
||||
updateProgress(progress.toInt())
|
||||
}, { _, state ->
|
||||
if (state == 0) {// 失败
|
||||
showNewContent(isLoading = false, false)
|
||||
}
|
||||
|
||||
override fun onMapHdCacheResult(cityId: Int, state: Int) {
|
||||
if (state == 0) {// 失败
|
||||
showNewContent(isLoading = false, false)
|
||||
}
|
||||
}
|
||||
}, location!!)
|
||||
})
|
||||
}
|
||||
|
||||
private fun cacheHDOfflineData() {
|
||||
if (location == null) {// 拿到了高德地图的cityCode
|
||||
CallerMapUIServiceManager.cacheHDDataByCity(object : IHdCacheListener {
|
||||
override fun onMapHdCacheProgress(cityId: Int, progress: Double) {
|
||||
updateProgress(progress.toInt())
|
||||
}
|
||||
|
||||
override fun onMapHdCacheResult(cityId: Int, state: Int) {
|
||||
if (state == 0) {// 失败
|
||||
showNewContent(isLoading = false, false)
|
||||
}
|
||||
mogoMapData.get()?.cacheHDDataByCity({ _, progress ->
|
||||
updateProgress(progress.toInt())
|
||||
}, { _, state ->
|
||||
if (state == 0) {// 失败
|
||||
showNewContent(isLoading = false, false)
|
||||
}
|
||||
})
|
||||
} else {// 只拿到了高精的经纬度
|
||||
@@ -176,15 +169,18 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) {
|
||||
isSuccess -> {
|
||||
okView?.visibility = View.VISIBLE
|
||||
okView?.text = context.resources.getString(R.string.ok_tip)
|
||||
offlineTitleView?.text = context.resources.getString(R.string.offline_download_success)
|
||||
offlineTitleView?.text =
|
||||
context.resources.getString(R.string.offline_download_success)
|
||||
progressBar?.visibility = View.GONE
|
||||
downloadPercentView?.visibility = View.GONE
|
||||
downloadResultImg?.background = ContextCompat.getDrawable(context, R.drawable.download_success_icon)
|
||||
downloadResultImg?.background =
|
||||
ContextCompat.getDrawable(context, R.drawable.download_success_icon)
|
||||
}
|
||||
else -> {
|
||||
isRetry = true
|
||||
isConfirm = false
|
||||
offlineTitleView?.text = context.resources.getString(R.string.offline_download_failure)
|
||||
offlineTitleView?.text =
|
||||
context.resources.getString(R.string.offline_download_failure)
|
||||
okView?.visibility = View.GONE
|
||||
progressBar?.visibility = View.GONE
|
||||
downloadPercentView?.visibility = View.GONE
|
||||
@@ -193,7 +189,8 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) {
|
||||
rightView?.visibility = View.VISIBLE
|
||||
vertLineView?.visibility = View.VISIBLE
|
||||
rightView?.text = context.resources.getString(R.string.retry)
|
||||
downloadResultImg?.background = ContextCompat.getDrawable(context, R.drawable.download_fail_icon)
|
||||
downloadResultImg?.background =
|
||||
ContextCompat.getDrawable(context, R.drawable.download_fail_icon)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import android.content.ClipboardManager
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.net.*
|
||||
import android.os.Build
|
||||
import android.os.Process
|
||||
import android.text.Html
|
||||
@@ -18,8 +17,8 @@ import androidx.annotation.RequiresApi
|
||||
import androidx.appcompat.widget.PopupMenu
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.FileProvider
|
||||
import androidx.core.view.*
|
||||
import androidx.core.view.MenuCompat
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import chassis.Chassis
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
@@ -38,19 +37,19 @@ import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_FULL_
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_RAIN_MODE
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_WARNING_UPLOAD
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.data.deva.report.ReportEntity
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneModule
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
|
||||
import com.mogo.eagle.core.data.gnss.AccelerationEntity
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.data.multidisplay.TelematicConstant
|
||||
import com.mogo.eagle.core.data.obu.MogoObuConst
|
||||
import com.mogo.eagle.core.data.obu.ObuStatusInfo
|
||||
import com.mogo.eagle.core.data.deva.report.ReportEntity
|
||||
import com.mogo.eagle.core.data.multidisplay.TelematicConstant
|
||||
import com.mogo.eagle.core.function.api.autopilot.*
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListener
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
|
||||
import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuConnectListener
|
||||
import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuInfoListener
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListener
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
|
||||
import com.mogo.eagle.core.function.api.setting.ISopSettingListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.*
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsFuncConfigListenerManager
|
||||
@@ -66,7 +65,10 @@ import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.logcatch.ILogViewListener
|
||||
import com.mogo.eagle.core.function.hmi.ui.logcatch.LogInfoView
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.kotlin.currentPadding
|
||||
import com.mogo.eagle.core.utilcode.kotlin.lifecycleOwner
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.kotlin.scope
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
@@ -75,11 +77,10 @@ import com.mogo.eagle.core.utilcode.mogo.permissions.BackgrounderPermission
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.map.hdcache.IHdCacheListener
|
||||
import com.mogo.map.MogoData.Companion.mogoMapData
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.*
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.tbRouteDynamicEffect
|
||||
import kotlinx.coroutines.*
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo_msg.MogoReportMsg
|
||||
@@ -194,10 +195,10 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
*/
|
||||
private val timerTaskRefresh = object : TimerTask() {
|
||||
override fun run() {
|
||||
if(this@DebugSettingView == null){
|
||||
if (this@DebugSettingView == null) {
|
||||
return
|
||||
}
|
||||
if(!isRunCheck){
|
||||
if (!isRunCheck) {
|
||||
return
|
||||
}
|
||||
UiThreadHandler.post {
|
||||
@@ -231,7 +232,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
//添加 底盘灯光数据 监听
|
||||
CallerChassisLamplightListenerManager.addListener(TAG, this)
|
||||
//雨天、美化、点云设置同步
|
||||
CallerSopSettingManager.addListener(TAG,this)
|
||||
CallerSopSettingManager.addListener(TAG, this)
|
||||
|
||||
//添加 业务配置监听
|
||||
CallerDevaToolsFuncConfigListenerManager.registerDevaToolsFuncConfigListener(
|
||||
@@ -299,11 +300,12 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun initView() {
|
||||
post {
|
||||
val maxHeight = ScreenUtils.getScreenHeight()-BarUtils.getStatusBarHeight()
|
||||
val maxHeight = ScreenUtils.getScreenHeight() - BarUtils.getStatusBarHeight()
|
||||
val height = clDebugContain.height
|
||||
if(height>maxHeight){
|
||||
if (height > maxHeight) {
|
||||
val layoutParamsOther = clDebugContain.layoutParams
|
||||
layoutParamsOther.height = maxHeight
|
||||
clDebugContain.layoutParams = layoutParamsOther
|
||||
@@ -593,12 +595,9 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
ThreadUtils.getIoPool().execute {
|
||||
val isCached = CallerMapUIServiceManager.isCityDataCached()
|
||||
isHDCached = isCached
|
||||
UiThreadHandler.post {
|
||||
btn_cache_hd_map.text = "缓存高精离线地图(${if (isCached) "已是最新版" else "待更新"}!)"
|
||||
}
|
||||
mogoMapData.get()?.isCityDataCached {
|
||||
isHDCached = it
|
||||
btn_cache_hd_map.text = "缓存高精离线地图(${if (it) "已是最新版" else "待更新"}!)"
|
||||
}
|
||||
btn_cache_hd_map.visibility = View.VISIBLE
|
||||
}
|
||||
@@ -633,9 +632,15 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
*/
|
||||
tbControlPassengerDriverMonitor.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (isChecked) {
|
||||
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.CONTROL_PASSENGER_DRIVER_MONITOR, "1".toByteArray())
|
||||
CallerTelematicManager.sendMsgToAllClients(
|
||||
TelematicConstant.CONTROL_PASSENGER_DRIVER_MONITOR,
|
||||
"1".toByteArray()
|
||||
)
|
||||
} else {
|
||||
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.CONTROL_PASSENGER_DRIVER_MONITOR, "0".toByteArray())
|
||||
CallerTelematicManager.sendMsgToAllClients(
|
||||
TelematicConstant.CONTROL_PASSENGER_DRIVER_MONITOR,
|
||||
"0".toByteArray()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -661,7 +666,8 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
// 初始化OBU IP信息
|
||||
val ipAddress =
|
||||
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, MogoObuConst.OBU_DEFAULT_IP)
|
||||
SharedPrefsMgr.getInstance(context)
|
||||
.getString(MoGoConfig.OBU_IP, MogoObuConst.OBU_DEFAULT_IP)
|
||||
|
||||
etObuIP.setText(ipAddress)
|
||||
etObuIP.text?.let { etObuIP.setSelection(it.length) }
|
||||
@@ -694,7 +700,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
tbIsDemoMode.isChecked = FunctionBuildConfig.isDemoMode
|
||||
// 演示模式
|
||||
tbIsDemoMode.setOnCheckedChangeListener { compoundButton, isChecked ->
|
||||
if(!compoundButton.isPressed){
|
||||
if (!compoundButton.isPressed) {
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
FunctionBuildConfig.isDemoMode = !FunctionBuildConfig.isDemoMode
|
||||
@@ -716,9 +722,11 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
tbIsStrictMode?.also {
|
||||
it.isChecked = SharedPrefs.getInstance(Utils.getApp()).getBoolean("MOGO_STRICT_MODE_ENABLED", false)
|
||||
it.isChecked = SharedPrefs.getInstance(Utils.getApp())
|
||||
.getBoolean("MOGO_STRICT_MODE_ENABLED", false)
|
||||
it.setOnCheckedChangeListener { _, isChecked ->
|
||||
SharedPrefs.getInstance(Utils.getApp()).putBoolean("MOGO_STRICT_MODE_ENABLED", isChecked)
|
||||
SharedPrefs.getInstance(Utils.getApp())
|
||||
.putBoolean("MOGO_STRICT_MODE_ENABLED", isChecked)
|
||||
scope.launch {
|
||||
ToastUtils.showShort("配置生效, 2秒后重启应用...")
|
||||
delay(2000)
|
||||
@@ -731,7 +739,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
tbIsRainMode.isChecked = FunctionBuildConfig.isRainMode
|
||||
//雨天模式
|
||||
tbIsRainMode.setOnCheckedChangeListener { compoundButton, isChecked ->
|
||||
if(!compoundButton.isPressed){
|
||||
if (!compoundButton.isPressed) {
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
CallerAutoPilotControlManager.setRainMode(isChecked)
|
||||
@@ -848,16 +856,37 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
//TODO
|
||||
tbIsDrawPath.setOnCheckedChangeListener { _, isChecked ->
|
||||
ToastUtils.showShort("功能开发中")
|
||||
}
|
||||
|
||||
if(FunctionBuildConfig.isDrawPointCloudData){
|
||||
//如果点云效果是打开的,则自车光圈也跟随打开
|
||||
tbCarAperture.isChecked = true
|
||||
}else{
|
||||
tbCarAperture.isChecked = FunctionBuildConfig.isDisplayAnimEnable
|
||||
}
|
||||
tbCarAperture.setOnCheckedChangeListener { compoundButton, isChecked ->
|
||||
CallerMapUIServiceManager.getMapUIController()?.setDisplayAnimEnable(isChecked)
|
||||
CallerSopSettingManager.invokeCarApertureListener(isChecked)
|
||||
if(!compoundButton.isPressed){
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
FunctionBuildConfig.isDisplayAnimEnable = isChecked
|
||||
}
|
||||
|
||||
//初始化点云数据渲染情况
|
||||
tbDrawPointCloudData.isChecked = FunctionBuildConfig.isDrawPointCloudData
|
||||
//是否渲染点云数据
|
||||
tbDrawPointCloudData.setOnCheckedChangeListener { compoundButton, isChecked ->
|
||||
if(!compoundButton.isPressed){
|
||||
if (!compoundButton.isPressed) {
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
//打开点云效果时,如果自车光圈是关闭状态,则自动打开自车光圈(点云是跟随光圈的 默认没有光圈就不显示点云的)
|
||||
if(isChecked && !FunctionBuildConfig.isDisplayAnimEnable){
|
||||
tbCarAperture.isChecked = true
|
||||
}else{
|
||||
tbCarAperture.isChecked = FunctionBuildConfig.isDisplayAnimEnable
|
||||
}
|
||||
CallerAutoPilotControlManager.setIsDrawPointCloud(isChecked)
|
||||
FunctionBuildConfig.isDrawPointCloudData = isChecked
|
||||
CallerMapUIServiceManager.getMapUIController()?.setIsDrawPointCloud(isChecked)
|
||||
@@ -872,7 +901,8 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
} else {
|
||||
try {
|
||||
val cloudSizeFloat = cloudSize.toFloat()
|
||||
CallerMapUIServiceManager.getMapUIController()?.setPointCloudSize(cloudSizeFloat)
|
||||
CallerMapUIServiceManager.getMapUIController()
|
||||
?.setPointCloudSize(cloudSizeFloat)
|
||||
} catch (e: Exception) {
|
||||
ToastUtils.showShort("点云大小格式输入不正确")
|
||||
}
|
||||
@@ -918,7 +948,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
tbADASLog.isChecked = CallerAutoPilotControlManager.isEnableLog()
|
||||
|
||||
//如果工控机异常上报列表窗口为展示状态,则显示上报异常布局
|
||||
if(CallerDevaToolsManager.getReportWindowStatus()){
|
||||
if (CallerDevaToolsManager.getReportWindowStatus()) {
|
||||
reportMsgLayout.visibility = View.VISIBLE
|
||||
tbReportMore.isChecked = true
|
||||
}
|
||||
@@ -951,7 +981,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
clipboardManager?.setPrimaryClip(
|
||||
ClipData.newPlainText(
|
||||
"DockVersion",
|
||||
CallerAutoPilotStatusListenerManager.getDockerVersion()?:""
|
||||
CallerAutoPilotStatusListenerManager.getDockerVersion() ?: ""
|
||||
)
|
||||
)
|
||||
ToastUtils.showLong("docker版本复制成功")
|
||||
@@ -1041,7 +1071,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
//设置连接司机屏IP
|
||||
btnConnectServerIp.setOnClickListener {
|
||||
val ip = etConnectServerIp.text.toString()
|
||||
if (!ip.isNullOrEmpty()) {
|
||||
if (!ip.isEmpty()) {
|
||||
CallerAutoPilotControlManager.connectSpecifiedServer(ip)
|
||||
}
|
||||
}
|
||||
@@ -1064,13 +1094,15 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
if (!AppIdentityModeUtils.isTaxiDriver(FunctionBuildConfig.appIdentityMode)
|
||||
&& !AppIdentityModeUtils.isBusDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
&& !AppIdentityModeUtils.isBusDriver(FunctionBuildConfig.appIdentityMode)
|
||||
) {
|
||||
tbStartAutopilotCommand.visibility = GONE
|
||||
}
|
||||
|
||||
|
||||
//切换环境
|
||||
tvCurEnv.text = "当前环境:${CallerDevaToolsManager.getEnvCityName()}${CallerDevaToolsManager.getEnvNetMode()}"
|
||||
tvCurEnv.text =
|
||||
"当前环境:${CallerDevaToolsManager.getEnvCityName()}${CallerDevaToolsManager.getEnvNetMode()}"
|
||||
btChangeEnv.onClick {
|
||||
PopupMenu(context, btChangeEnv).also { p ->
|
||||
p.menuInflater.inflate(R.menu.menu_env_pop, p.menu)
|
||||
@@ -1086,13 +1118,22 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
R.id.env_reset ->
|
||||
CallerDevaToolsManager.envConfigReset()
|
||||
R.id.hy_product ->
|
||||
CallerDevaToolsManager.envConfigChange("0734", DebugConfig.NET_MODE_RELEASE)
|
||||
CallerDevaToolsManager.envConfigChange(
|
||||
"0734",
|
||||
DebugConfig.NET_MODE_RELEASE
|
||||
)
|
||||
R.id.hy_qa ->
|
||||
CallerDevaToolsManager.envConfigChange("0734", DebugConfig.NET_MODE_QA)
|
||||
R.id.hy_demo ->
|
||||
CallerDevaToolsManager.envConfigChange("0734", DebugConfig.NET_MODE_DEMO)
|
||||
CallerDevaToolsManager.envConfigChange(
|
||||
"0734",
|
||||
DebugConfig.NET_MODE_DEMO
|
||||
)
|
||||
R.id.bj_product ->
|
||||
CallerDevaToolsManager.envConfigChange("010", DebugConfig.NET_MODE_RELEASE)
|
||||
CallerDevaToolsManager.envConfigChange(
|
||||
"010",
|
||||
DebugConfig.NET_MODE_RELEASE
|
||||
)
|
||||
R.id.bj_qa ->
|
||||
CallerDevaToolsManager.envConfigChange("010", DebugConfig.NET_MODE_QA)
|
||||
R.id.bj_demo ->
|
||||
@@ -1293,7 +1334,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
* 设置是否输出高精地图日志 true-打印日志,false-不打印日志
|
||||
*/
|
||||
tbHdMapLog.setOnCheckedChangeListener { _, isChecked ->
|
||||
CallerMapUIServiceManager.getMapUIController()?.setDebugMode(isChecked)
|
||||
mogoMapData.get()?.setDebugMode(isChecked)
|
||||
}
|
||||
|
||||
cbTraceLog.isChecked = CallerDevaToolsManager.getTraceLogStatus()
|
||||
@@ -1575,8 +1616,10 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
/**
|
||||
* 版本信息
|
||||
*/
|
||||
tvAppVersionName.text = "鹰眼版本:${AppUtils.getAppVersionName()} Git Hash:${AppConfigInfo.workingBranchHash} \n渠道信息:${AppConfigInfo.flavor}"
|
||||
tvAppVersionNameKey.text = "鹰眼版本:${AppUtils.getAppVersionName()} Git Hash:${AppConfigInfo.workingBranchHash}\n渠道信息:${AppConfigInfo.flavor}"
|
||||
tvAppVersionName.text =
|
||||
"鹰眼版本:${AppUtils.getAppVersionName()} Git Hash:${AppConfigInfo.workingBranchHash} \n渠道信息:${AppConfigInfo.flavor}"
|
||||
tvAppVersionNameKey.text =
|
||||
"鹰眼版本:${AppUtils.getAppVersionName()} Git Hash:${AppConfigInfo.workingBranchHash}\n渠道信息:${AppConfigInfo.flavor}"
|
||||
|
||||
tvAutopilotProtocolVersionInfo.text =
|
||||
"Autopilot协议版本:${CallerAutoPilotControlManager.getProtocolVersion()}"
|
||||
@@ -1593,9 +1636,12 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
tvGitBranchInfo.text = "Git分支:${AppConfigInfo.workingBranchName}"
|
||||
tvAppBuildTimeInfo.text = "版本构建时间:${AppConfigInfo.appBuildTime}"
|
||||
|
||||
if(tbBeautyMode.isVisible){
|
||||
val version = ParseVersionUtils.parseVersion(true, CallerAutoPilotStatusListenerManager.getDockerVersion())
|
||||
if(version >= 30100 && AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
|
||||
if (tbBeautyMode.isVisible) {
|
||||
val version = ParseVersionUtils.parseVersion(
|
||||
true,
|
||||
CallerAutoPilotStatusListenerManager.getDockerVersion()
|
||||
)
|
||||
if (version >= 30100 && AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
|
||||
tbBeautyMode.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
@@ -1628,7 +1674,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
"移动数据"
|
||||
} else {
|
||||
//WiFi
|
||||
CommonUtils.getWifiName(context)?:""
|
||||
CommonUtils.getWifiName(context) ?: ""
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -1703,11 +1749,14 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
tvIpcInfo.text = it
|
||||
tvIpcInfoKey.text = it
|
||||
}
|
||||
tvCmdbCarInfoContent.text = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.CAR_INFO)?:""
|
||||
tvCmdbCarInfoContent.text =
|
||||
SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.CAR_INFO) ?: ""
|
||||
|
||||
//APP升级功能
|
||||
tvAppHost.text = "HOST地址:" + SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.HOST_ADDRESS)?:""
|
||||
tvAppContent.text = "APP升级数据:" + SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.APP_UPGRADE_CONTENT)?:""
|
||||
tvAppHost.text = "HOST地址:" + SharedPrefsMgr.getInstance(context)
|
||||
.getString(SharedPrefsConstants.HOST_ADDRESS) ?: ""
|
||||
tvAppContent.text = "APP升级数据:" + SharedPrefsMgr.getInstance(context)
|
||||
.getString(SharedPrefsConstants.APP_UPGRADE_CONTENT) ?: ""
|
||||
|
||||
tvCarInfo.text =
|
||||
"GPS时间:${(mGnssInfo?.satelliteTime?.times(1000))?.toLong()}\n" +
|
||||
@@ -1739,6 +1788,18 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
mTrajectoryInfoSize = 0
|
||||
mRouteInfoSize = 0
|
||||
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
tbIsDemoMode?.text = "关闭美化模式"
|
||||
} else {
|
||||
tbIsDemoMode?.text = "开启美化模式"
|
||||
}
|
||||
|
||||
if (FunctionBuildConfig.isRainMode) {
|
||||
tbIsRainMode?.text = "关闭雨天模式"
|
||||
} else {
|
||||
tbIsRainMode?.text = "开启雨天模式"
|
||||
}
|
||||
|
||||
obuConnectStatusTv.text = Html.fromHtml(
|
||||
"OBU连接状态:${
|
||||
if (AppConfigInfo.isConnectObu) {
|
||||
@@ -2120,56 +2181,47 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun restartApp() {
|
||||
Utils.getApp().startActivity(Utils.getApp().packageManager.getLaunchIntentForPackage(Utils.getApp().packageName))
|
||||
Utils.getApp()
|
||||
.startActivity(Utils.getApp().packageManager.getLaunchIntentForPackage(Utils.getApp().packageName))
|
||||
Process.killProcess(Process.myPid())
|
||||
}
|
||||
|
||||
private fun cacheHDOfflineData(isGaoDe: Boolean) {
|
||||
var progss = 0
|
||||
if (isGaoDe) {// 拿到了高德地图的cityCode
|
||||
CallerMapUIServiceManager.cacheHDDataByCity(object : IHdCacheListener {
|
||||
override fun onMapHdCacheProgress(cityId: Int, progress: Double) {
|
||||
// 更新进度
|
||||
progss = progress.toInt()
|
||||
if (progss == 100) {
|
||||
isHDCached = true
|
||||
btn_cache_hd_map.text = "缓存高精离线地图(已是最新版!)"
|
||||
} else {
|
||||
btn_cache_hd_map.text = "缓存高精离线地图(进度:${progss}%)"
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMapHdCacheResult(cityId: Int, state: Int) {
|
||||
if (state == 0) {// 失败
|
||||
btn_cache_hd_map.text = "缓存高精离线地图(下载失败!)"
|
||||
ToastUtils.showShort("下载失败,请重试!")
|
||||
}
|
||||
}
|
||||
mogoMapData.get()?.cacheHDDataByCity({ _, progress ->
|
||||
cacheHDCityProgressUpdate(progress)
|
||||
}, { _, state ->
|
||||
cacheHDCityResult(state)
|
||||
})
|
||||
} else {// 只拿到了高精的经纬度
|
||||
mGnssInfo?.let { loc ->
|
||||
CallerMapUIServiceManager.cacheHDDataByCityByLonLat(object : IHdCacheListener {
|
||||
override fun onMapHdCacheProgress(cityId: Int, progress: Double) {
|
||||
progss = progress.toInt()
|
||||
if (progss == 100) {
|
||||
isHDCached = true
|
||||
btn_cache_hd_map.text = "缓存高精离线地图(已是最新版!)"
|
||||
} else {
|
||||
btn_cache_hd_map.text = "缓存高精离线地图(进度:${progss}%)"
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMapHdCacheResult(cityId: Int, state: Int) {
|
||||
if (state == 0) {// 失败
|
||||
btn_cache_hd_map.text = "缓存高精离线地图(下载失败!)"
|
||||
ToastUtils.showShort("下载失败,请重试!")
|
||||
}
|
||||
}
|
||||
}, loc)
|
||||
mogoMapData.get()?.cacheHDDataByCityByLonLat(loc, { _, progress ->
|
||||
cacheHDCityProgressUpdate(progress)
|
||||
}, { _, state ->
|
||||
cacheHDCityResult(state)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun cacheHDCityProgressUpdate(progress: Double) {
|
||||
// 更新进度
|
||||
val progss = progress.toInt()
|
||||
if (progss == 100) {
|
||||
isHDCached = true
|
||||
btn_cache_hd_map.text = "缓存高精离线地图(已是最新版!)"
|
||||
} else {
|
||||
btn_cache_hd_map.text = "缓存高精离线地图(进度:${progss}%)"
|
||||
}
|
||||
}
|
||||
|
||||
private fun cacheHDCityResult(state: Int) {
|
||||
if (state == 0) {// 失败
|
||||
btn_cache_hd_map.text = "缓存高精离线地图(下载失败!)"
|
||||
ToastUtils.showShort("下载失败,请重试!")
|
||||
}
|
||||
}
|
||||
|
||||
override fun fwThreadClose() {
|
||||
refreshTraceInfo()
|
||||
}
|
||||
@@ -2209,4 +2261,11 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
tbDrawPointCloudData.isChecked = status
|
||||
}
|
||||
|
||||
/**
|
||||
* 自车光圈
|
||||
*/
|
||||
override fun onCarApertureClickEvent(status: Boolean) {
|
||||
tbCarAperture.isChecked = status
|
||||
}
|
||||
|
||||
}
|
||||
@@ -384,12 +384,17 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
//自车光圈
|
||||
if(FunctionBuildConfig.isDrawPointCloudData){
|
||||
//如果点云效果是打开的,则自车光圈也跟随打开
|
||||
FunctionBuildConfig.isDisplayAnimEnable = true
|
||||
scCarAperture.isChecked = true
|
||||
CallerMapUIServiceManager.getMapUIController()?.setDisplayAnimEnable(true)
|
||||
hmiAction("SOP 是否展示自车光圈,",FunctionBuildConfig.isDisplayAnimEnable)
|
||||
Log.i(TAG,"SOP 是否展示自车光圈,${FunctionBuildConfig.isDisplayAnimEnable}")
|
||||
}else{
|
||||
scCarAperture.isChecked = FunctionBuildConfig.isDisplayAnimEnable
|
||||
}
|
||||
scCarAperture.setOnCheckedChangeListener { compoundButton, isChecked ->
|
||||
CallerMapUIServiceManager.getMapUIController()?.setDisplayAnimEnable(isChecked)
|
||||
CallerSopSettingManager.invokeCarApertureListener(isChecked)
|
||||
hmiAction("SOP 是否展示自车光圈,",isChecked)
|
||||
Log.i(TAG,"SOP 是否展示自车光圈,$isChecked")
|
||||
if(!compoundButton.isPressed){
|
||||
@@ -768,6 +773,10 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
scDrawPointCloudData.isChecked = status
|
||||
}
|
||||
|
||||
override fun onCarApertureClickEvent(status: Boolean) {
|
||||
scCarAperture.isChecked = status
|
||||
}
|
||||
|
||||
/**
|
||||
* 工控机配置参数获取
|
||||
*/
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.mogo.eagle.core.data.autopilot.pnc.PncActionsHelper
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.currentRoadTrafficLight
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.isRed
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.time
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_PNC_ACTIONS
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.FOUNDATION
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningActionsListener
|
||||
@@ -137,7 +138,7 @@ class PncActionsView @JvmOverloads constructor(
|
||||
&& mTrafficLightResult!!.currentRoadTrafficLight() != null
|
||||
&& mTrafficLightResult!!.currentRoadTrafficLight()!!.isRed()
|
||||
) {
|
||||
mTrafficLightResult!!.currentRoadTrafficLight()!!.remain.toString()
|
||||
mTrafficLightResult!!.currentRoadTrafficLight()!!.time().toString()
|
||||
} else {
|
||||
""
|
||||
}
|
||||
|
||||
@@ -46,28 +46,26 @@ class SteeringBrakeView(context: Context, attrs: AttributeSet?) : ConstraintLayo
|
||||
}
|
||||
|
||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||
if (gnssInfo != null) {
|
||||
//设置刹车信息,小于默认认为是刹车
|
||||
brakeLight =
|
||||
if (gnssInfo.acceleration < SharedPrefsMgr.getInstance(Utils.getApp()).getFloat(
|
||||
MoGoConfig.BRAKE_ACCELERATION_THRESHOLD, -2.5f
|
||||
)
|
||||
) {
|
||||
1
|
||||
} else {
|
||||
0
|
||||
}
|
||||
CallerLogger.d(
|
||||
"$M_HMI$TAG",
|
||||
"---onAutopilotLightSwitchData ---Acceleration = " + gnssInfo.acceleration + "-- brakeLight = " + brakeLight
|
||||
)
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (!isShowTurnLight) { //在不展示转向灯的情况下,展示车辆刹车的动效
|
||||
brakeView.visibility = View.VISIBLE
|
||||
brakeView.setBrakeLight(brakeLight)
|
||||
} else {
|
||||
brakeView.visibility = View.GONE
|
||||
}
|
||||
//设置刹车信息,小于默认认为是刹车 //todo 优化sp获取,不要每次回调都去调用sp
|
||||
brakeLight =
|
||||
if (gnssInfo.acceleration < SharedPrefsMgr.getInstance(Utils.getApp()).getFloat(
|
||||
MoGoConfig.BRAKE_ACCELERATION_THRESHOLD, -2.5f
|
||||
)
|
||||
) {
|
||||
1
|
||||
} else {
|
||||
0
|
||||
}
|
||||
CallerLogger.d(
|
||||
"$M_HMI$TAG",
|
||||
"---onAutopilotLightSwitchData ---Acceleration = " + gnssInfo.acceleration + "-- brakeLight = " + brakeLight
|
||||
)
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (!isShowTurnLight) { //在不展示转向灯的情况下,展示车辆刹车的动效
|
||||
brakeView.visibility = View.VISIBLE
|
||||
brakeView.setBrakeLight(brakeLight)
|
||||
} else {
|
||||
brakeView.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,8 +152,7 @@ class ParallelDriveView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun onParallelDrivingAbility(
|
||||
isParallelDrivingAbility: Boolean,
|
||||
unableParallelDrivingReasons: ArrayList<UnableLaunchReason>?
|
||||
isParallelDrivingAbility: Boolean
|
||||
) {
|
||||
if (!isParallelDrivingAbility) {
|
||||
Log.d(TAG, "onParallelDrivingAbility-UNAVAILABLE")
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.FrameLayout
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import kotlinx.android.synthetic.main.view_perspective_switch.view.*
|
||||
|
||||
/**
|
||||
*@author xiaoyuzhou
|
||||
*@date 2021/10/15 11:34 上午
|
||||
* 视角切换按钮
|
||||
*/
|
||||
class PerspectiveSwitchView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : FrameLayout(context, attrs, defStyleAttr), View.OnClickListener{
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
LayoutInflater.from(context).inflate(R.layout.view_perspective_switch, this, true)
|
||||
setBackgroundResource(R.drawable.module_switch_map_bg)
|
||||
setOnClickListener(this)
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
getMapUIController()?.let {
|
||||
if (it.currentMapVisualAngle.isLongSight) {
|
||||
it.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
|
||||
textSwitch.setText(R.string.module_map_model_normal)
|
||||
} else if (it.currentMapVisualAngle.isMediumSight) {
|
||||
it.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null)
|
||||
textSwitch.setText(R.string.module_map_model_faster)
|
||||
} else {
|
||||
it.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null)
|
||||
textSwitch.setText(R.string.module_map_model_faster)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,7 +10,9 @@ import com.mogo.eagle.core.function.api.map.roma.IMoGoRomaListener
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager.romaTrigger
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.eagle.core.utilcode.util.ClickUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import kotlinx.android.synthetic.main.view_roma_taxi_bg.view.ivRomaView
|
||||
import kotlinx.android.synthetic.main.view_roma_taxi_bg.view.ll_roma_bg
|
||||
|
||||
|
||||
@@ -9,13 +9,11 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.AdUpgradeStateHelper
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.IPCUpgradeStateInfo
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
|
||||
import com.mogo.eagle.core.function.api.hmi.autopilot.IMoGoCheckAutoPilotBtnListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
|
||||
@@ -26,6 +24,7 @@ import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog.Companion.hmiActio
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.map.MogoData.Companion.mogoMapData
|
||||
import kotlinx.android.synthetic.main.view_system_version.view.*
|
||||
import system_master.SsmInfo
|
||||
import system_master.SystemStatusInfo
|
||||
@@ -41,7 +40,7 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener,
|
||||
IMoGoDevaToolsListener, IMoGoCheckAutoPilotBtnListener, IMoGoChassisLocationWGS84Listener {
|
||||
IMoGoDevaToolsListener, IMoGoCheckAutoPilotBtnListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "SystemVersionView"
|
||||
@@ -56,7 +55,6 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
private var currentProgress: Int = -1 //当前已下载包体大小
|
||||
|
||||
private var isHDCached = false
|
||||
private var location: MogoLocation? = null
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_system_version, this, true)
|
||||
@@ -140,17 +138,17 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
ivHDCache.setOnClickListener {
|
||||
hmiAction(
|
||||
"$M_HMI$TAG",
|
||||
"HD map view click , isHDCached:$isHDCached , lon:${location?.longitude} , lat:${location?.latitude}"
|
||||
"HD map view click , isHDCached:$isHDCached , lon:${getChassisLocationWGS84().longitude} , lat:${getChassisLocationWGS84().latitude}"
|
||||
)
|
||||
if (isHDCached) {// 已缓存
|
||||
ToastUtils.showShort(resources.getString(R.string.offline_had_downloaded))
|
||||
} else {// 未缓存
|
||||
if (CallerMapUIServiceManager.getCityCode().isNullOrEmpty()) {// 未拿到高德的cityCode
|
||||
if (location == null || (location!!.longitude <= 0.0 && location!!.latitude <= 0.0)) {// 未拿到高精的经纬度
|
||||
if ((getChassisLocationWGS84().longitude <= 0.0 && getChassisLocationWGS84().latitude <= 0.0)) {// 未拿到高精的经纬度
|
||||
ToastUtils.showShort(resources.getString(R.string.location_try_again))
|
||||
} else {// 拿到了高精的经纬度
|
||||
val dialog = OfflineMapDialog(context)
|
||||
dialog.location = location
|
||||
dialog.location = getChassisLocationWGS84()
|
||||
dialog.show()
|
||||
}
|
||||
} else {// 拿到高德的cityCode
|
||||
@@ -159,11 +157,8 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
ThreadUtils.getIoPool().execute {
|
||||
val isCached = CallerMapUIServiceManager.isCityDataCached()
|
||||
UiThreadHandler.post {
|
||||
updateHDDataCacheStatus(isCached)
|
||||
}
|
||||
mogoMapData.get()?.isCityDataCached {
|
||||
updateHDDataCacheStatus(it)
|
||||
}
|
||||
|
||||
if (AdUpgradeStateHelper.isConfirmUpgrade()) {
|
||||
@@ -311,7 +306,6 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
CallerHmiListenerManager.addListener(TAG, this)
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerDevaToolsListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
|
||||
needQueryContainers = true
|
||||
}
|
||||
|
||||
@@ -323,7 +317,6 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
CallerHmiListenerManager.removeListener(TAG)
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
CallerDevaToolsListenerManager.removeListener(TAG)
|
||||
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
|
||||
needQueryContainers = false
|
||||
}
|
||||
|
||||
@@ -366,22 +359,18 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
adCircularProgressView?.visibility = View.GONE
|
||||
}
|
||||
|
||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||
location = gnssInfo
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态查询应答
|
||||
* @param status 数据
|
||||
* HQ、M1 MAP350开始弃用,其他车型MAP360开始弃用
|
||||
*/
|
||||
override fun onAutopilotStatusRespByQuery(status: SystemStatusInfo.StatusInfo) {
|
||||
Log.i(TAG,"hdMapVer="+status.hdMapVer)
|
||||
Log.i(TAG, "hdMapVer=" + status.hdMapVer)
|
||||
//hdMapVer返回示例:/home/mogo/autopilot/share/hadmap_engine/data/hadmap_data/db.sqlite|bj|2.2.7|对bus路线上的junction进行修改,对原609场景修改为6091、6092、6201、 6202四种细分场景,并对通往园区路口改为619
|
||||
if(status.hdMapVer!= null && status.hdMapVer.isNotEmpty()){
|
||||
if (status.hdMapVer != null && status.hdMapVer.isNotEmpty()) {
|
||||
//对地图版本进行截取
|
||||
val city = status.hdMapVer.substringAfter(".sqlite|").substringBefore("|")
|
||||
val version =status.hdMapVer.substringAfter("$city|").substringBefore("|")
|
||||
val version = status.hdMapVer.substringAfter("$city|").substringBefore("|")
|
||||
AppConfigInfo.adHdMapVersion = "${city}_${version}"
|
||||
updateAdHdMapVersion()
|
||||
}
|
||||
@@ -395,12 +384,12 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
* @param statusInf 数据
|
||||
*/
|
||||
override fun onSystemStatus(statusInf: SsmInfo.SsmStatusInf) {
|
||||
Log.i(TAG,"hdMapVer="+statusInf.hdMapVer)
|
||||
Log.i(TAG, "hdMapVer=" + statusInf.hdMapVer)
|
||||
//hdMapVer返回示例:/home/mogo/autopilot/share/hadmap_engine/data/hadmap_data/db.sqlite|bj|2.2.7|对bus路线上的junction进行修改,对原609场景修改为6091、6092、6201、 6202四种细分场景,并对通往园区路口改为619
|
||||
if(statusInf.hdMapVer!= null && statusInf.hdMapVer.isNotEmpty()){
|
||||
if (statusInf.hdMapVer != null && statusInf.hdMapVer.isNotEmpty()) {
|
||||
//对地图版本进行截取
|
||||
val city = statusInf.hdMapVer.substringAfter(".sqlite|").substringBefore("|")
|
||||
val version =statusInf.hdMapVer.substringAfter("$city|").substringBefore("|")
|
||||
val version = statusInf.hdMapVer.substringAfter("$city|").substringBefore("|")
|
||||
AppConfigInfo.adHdMapVersion = "${city}_${version}"
|
||||
updateAdHdMapVersion()
|
||||
}
|
||||
@@ -409,8 +398,8 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
/**
|
||||
* 更新工控机高精地图版本
|
||||
*/
|
||||
private fun updateAdHdMapVersion(){
|
||||
if(tvAdHdMapVersionContent.text.isNullOrEmpty() && AppConfigInfo.adHdMapVersion.isNotEmpty() || tvAdHdMapVersionContent.text != AppConfigInfo.adHdMapVersion){
|
||||
private fun updateAdHdMapVersion() {
|
||||
if (tvAdHdMapVersionContent.text.isNullOrEmpty() && AppConfigInfo.adHdMapVersion.isNotEmpty() || tvAdHdMapVersionContent.text != AppConfigInfo.adHdMapVersion) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
tvAdHdMapVersionContent.text = AppConfigInfo.adHdMapVersion
|
||||
}
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
package com.mogo.eagle.core.function.main
|
||||
|
||||
import android.Manifest
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.provider.Settings
|
||||
import android.view.*
|
||||
import android.widget.FrameLayout
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.kwai.koom.base.MonitorManager.addMonitorConfig
|
||||
import com.kwai.koom.javaoom.monitor.OOMHprofUploader
|
||||
@@ -89,14 +86,12 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
initConnectInfoRV()
|
||||
CallerHmiManager.init(this)
|
||||
|
||||
//申请悬浮窗权限
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
// 检查是否有悬浮窗权限
|
||||
if (Settings.canDrawOverlays(this)) {
|
||||
return
|
||||
}
|
||||
PermissionsDialogUtils.openAppDetails(this, "显示悬浮窗", REQUEST_CODE_DIALOG)
|
||||
// 检查是否有悬浮窗权限
|
||||
if (Settings.canDrawOverlays(this)) {
|
||||
return
|
||||
}
|
||||
//申请悬浮窗权限
|
||||
PermissionsDialogUtils.openAppDetails(this, "显示悬浮窗", REQUEST_CODE_DIALOG)
|
||||
}
|
||||
|
||||
private fun injectStatusBar() {
|
||||
@@ -121,7 +116,6 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
decorView.addView(statusBarView, statusBarLP)
|
||||
}
|
||||
|
||||
|
||||
// todo 优化 车聊聊
|
||||
private fun injectFloatView() {
|
||||
val decorView = this.window.decorView as? FrameLayout ?: return
|
||||
|
||||
@@ -14,7 +14,6 @@ import android.os.Handler;
|
||||
import android.os.Process;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
@@ -23,14 +22,11 @@ import com.mogo.commons.module.intent.IMogoIntentListener;
|
||||
import com.mogo.commons.module.intent.IntentManager;
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.function.main.moujie.BluetoothMonitorReceiver;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.rousetime.android_startup.model.CostTimesModel;
|
||||
import com.zhjt.service.chain.ChainLog;
|
||||
|
||||
@@ -40,8 +36,6 @@ import org.greenrobot.eventbus.Subscribe;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
/**
|
||||
* 针对作为Launcher的情况,做个性化操作 TODO 测试用的,可删除
|
||||
@@ -54,10 +48,6 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte
|
||||
private final static Handler handlerV2XEvent = new Handler();
|
||||
private static Runnable runnableV2XEvent;
|
||||
|
||||
private volatile double accelerated;//加速度
|
||||
private Timer timerHorn;
|
||||
private Timer timerAcc;
|
||||
|
||||
private BluetoothMonitorReceiver mBluetoothReceiver = null;
|
||||
private BluetoothAdapter mBluetoothAdapter;
|
||||
|
||||
|
||||
@@ -1775,6 +1775,22 @@
|
||||
app:layout_constraintRight_toRightOf="@id/tbIsDrawAutopilotTrajectoryData"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbIsDrawAutopilotTrajectoryData" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbCarAperture"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="2dp"
|
||||
android:padding="@dimen/dp_20"
|
||||
android:textColor="#000"
|
||||
android:textOff="开启自车光圈"
|
||||
android:textOn="关闭自车光圈"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintLeft_toRightOf="@id/tbChangeAutoPilotStatus"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbIsDrawAutopilotTrajectoryData"
|
||||
/>
|
||||
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbDrawPointCloudData"
|
||||
android:layout_width="0dp"
|
||||
@@ -1785,9 +1801,10 @@
|
||||
android:textOff="开启渲染点云数据"
|
||||
android:textOn="关闭渲染点云数据"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintLeft_toRightOf="@id/tbChangeAutoPilotStatus"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbIsDrawAutopilotTrajectoryData" />
|
||||
app:layout_constraintLeft_toLeftOf="@id/tbChangeAutoPilotStatus"
|
||||
app:layout_constraintRight_toRightOf="@id/tbChangeAutoPilotStatus"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbChangeAutoPilotStatus"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnPointCloudSize"
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/module_switch_model_layout"
|
||||
android:layout_width="@dimen/module_switch_map"
|
||||
android:layout_height="@dimen/module_switch_map_height">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iconSwitch"
|
||||
android:layout_width="@dimen/module_switch_image"
|
||||
android:layout_height="@dimen/module_switch_image"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:paddingLeft="@dimen/module_switch_margin_left"
|
||||
android:src="@drawable/module_switch_map_angle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textSwitch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="@dimen/module_switch_margin_left"
|
||||
android:text="@string/module_map_model_normal"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="@dimen/module_switch_text_size" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
@@ -61,7 +61,8 @@ dependencies {
|
||||
exclude group: 'com.zhidaoauto.machine', module: 'map'
|
||||
}
|
||||
|
||||
implementation rootProject.ext.dependencies.mogocustommap
|
||||
// implementation rootProject.ext.dependencies.mogocustommap
|
||||
implementation project(':libraries:mapmodule')
|
||||
implementation rootProject.ext.dependencies.amapnavi3dmap
|
||||
|
||||
implementation rootProject.ext.dependencies.androidxroomruntime
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.MogoRouteOverlayManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
|
||||
import com.mogo.eagle.core.utilcode.util.DeviceUtils
|
||||
import com.mogo.map.MapDataWrapper
|
||||
|
||||
@Route(path = MogoServicePaths.PATH_MAP_BIZ)
|
||||
class MapBizProvider :IMoGoFunctionServerProvider, IMogoRoma {
|
||||
@@ -21,6 +22,7 @@ class MapBizProvider :IMoGoFunctionServerProvider, IMogoRoma {
|
||||
get() = "MapBizProvider"
|
||||
|
||||
override fun init(context: Context?) {
|
||||
MapDataWrapper.init()
|
||||
MapIdentifySubscriber.instance
|
||||
MogoRouteOverlayManager.getInstance().init()
|
||||
MapPointCloudSubscriber.instance
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user