Merge branch 'dev_robotaxi-d-app-module_2100_220816_2.10.0' into 'test_robotaxi-d-app-module_2100_220816_2.10.0.1'
Dev robotaxi d app module 2100 220816 2.10.0 See merge request zhjt/AndroidApp/MoGoEagleEye!168
This commit is contained in:
@@ -432,7 +432,9 @@ public class BusPassengerModel {
|
||||
//要前往的站在轨迹中对应的点
|
||||
int nextRouteIndex = CoordinateCalculateRouteUtil.getArrivedPointIndex(mRoutePoints
|
||||
,stationNext.getGcjLon(),stationNext.getGcjLat());
|
||||
mTwoStationsRouts.addAll(mRoutePoints.subList(currentRouteIndex,nextRouteIndex));
|
||||
if (currentRouteIndex < nextRouteIndex){ //如果找到的next在起点的轨迹前面,直接舍弃这个轨迹,不显示
|
||||
mTwoStationsRouts.addAll(mRoutePoints.subList(currentRouteIndex,nextRouteIndex));
|
||||
}
|
||||
}
|
||||
}else { //只有两个站点的时候整个路线就是两个站点之间的轨迹
|
||||
mTwoStationsRouts.clear();
|
||||
|
||||
@@ -57,8 +57,8 @@ public class BusPassengerMapDirectionView
|
||||
private int mCurrentIndex = -1;
|
||||
|
||||
private int zoomLevel = 13;
|
||||
private List<LatLng> mCoordinatesLatLng = new ArrayList<>();
|
||||
private List<LatLng> mLinePointsLatLng = new ArrayList<>();
|
||||
private List<LatLng> mCoordinatesLatLng = new ArrayList<>(); //站点坐标数据
|
||||
private List<LatLng> mLinePointsLatLng = new ArrayList<>(); //轨迹坐标数据
|
||||
private Polyline mPolyline;
|
||||
private CameraUpdate mCameraUpdate;
|
||||
private Context mContext;
|
||||
@@ -197,7 +197,7 @@ public class BusPassengerMapDirectionView
|
||||
mCarMarker.setToTop();
|
||||
}
|
||||
|
||||
if (mLinePointsLatLng.size() > 1){
|
||||
if (mLinePointsLatLng.size() > 0){
|
||||
//圈定地图显示范围
|
||||
//存放经纬度
|
||||
LatLngBounds.Builder boundsBuilder = new LatLngBounds.Builder();
|
||||
@@ -208,12 +208,13 @@ public class BusPassengerMapDirectionView
|
||||
//第二个参数为四周留空宽度
|
||||
mAMap.moveCamera(CameraUpdateFactory.newLatLngBoundsRect(boundsBuilder.build(),100,100,100,100));
|
||||
|
||||
}else {
|
||||
//设置希望展示的地图缩放级别
|
||||
CameraPosition cameraPosition = new CameraPosition.Builder()
|
||||
.target(mCarMarker.getPosition()).tilt(0).bearing(location.getBearing()).zoom(zoomLevel).build();
|
||||
mAMap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
|
||||
}
|
||||
// else {
|
||||
// //设置希望展示的地图缩放级别
|
||||
// CameraPosition cameraPosition = new CameraPosition.Builder()
|
||||
// .target(mCarMarker.getPosition()).tilt(0).bearing(location.getBearing()).zoom(zoomLevel).build();
|
||||
// mAMap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@@ -368,7 +369,7 @@ public class BusPassengerMapDirectionView
|
||||
mLinePointsLatLng.clear();
|
||||
mLinePointsLatLng.addAll(routeLineLatLngs);
|
||||
|
||||
if (mCoordinatesLatLng.size() > 0 && mCurrentIndex != currentIndex) {
|
||||
if (mLinePointsLatLng.size() > 0 && mCurrentIndex != currentIndex) {
|
||||
if (mAMap != null && mLineMarkers.size() > 0) {
|
||||
mCurrentIndex = currentIndex;
|
||||
for (int i = 0; i < mLineMarkers.size(); i++) {
|
||||
|
||||
@@ -10,4 +10,5 @@ import java.util.List;
|
||||
*/
|
||||
public interface IRefreshBusStationsCallback {
|
||||
void refreshBusStations(String lineName,List<BusStationBean> stationList, int currentStation, int nextStation, boolean isArrived);
|
||||
void clearBusStationsMarkers();
|
||||
}
|
||||
|
||||
@@ -317,14 +317,19 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
hideSlidePanel();
|
||||
hidPanel();
|
||||
//移除起点终点
|
||||
if (null != startStation) {
|
||||
setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat()
|
||||
, startStation.getLon(),R.raw.star_marker);
|
||||
}
|
||||
if (null != endStation) {
|
||||
setOrRemoveMapMaker(false, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
, endStation.getLon(),R.raw.end_marker);
|
||||
}
|
||||
clearBusStationsMarkers();
|
||||
}
|
||||
}
|
||||
|
||||
public void clearBusStationsMarkers(){
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"clearBusStationsMarkers()");
|
||||
if (null != startStation) {
|
||||
setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat()
|
||||
, startStation.getLon(),R.raw.star_marker);
|
||||
}
|
||||
if (null != endStation) {
|
||||
setOrRemoveMapMaker(false, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
, endStation.getLon(),R.raw.end_marker);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -819,6 +819,12 @@ public class BusOrderModel {
|
||||
BusTrajectoryManager.getInstance().syncTrajectoryInfo();
|
||||
}
|
||||
|
||||
public void clearBusStationDatas(){
|
||||
if (refreshBusStationsCallback != null){
|
||||
refreshBusStationsCallback.clearBusStationsMarkers();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单状态、获取下一站靠站的的站点
|
||||
*
|
||||
|
||||
@@ -53,6 +53,7 @@ public class BusLinePresenter extends Presenter<BusSwitchLineView> implements IB
|
||||
|
||||
@Override
|
||||
public void onChangeLineIdSuccess() {
|
||||
BusOrderModel.getInstance().clearBusStationDatas();
|
||||
runOnUIThread(() -> mView.onChangeLineIdSuccess());
|
||||
}
|
||||
|
||||
|
||||
@@ -137,6 +137,11 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearBusStationsMarkers() {
|
||||
runOnUIThread(() -> mView.clearBusStationsMarkers());
|
||||
}
|
||||
|
||||
private void functionDemoModeChange() {
|
||||
// CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel ="," functionDemoModeChange ="+mCurrentStation);
|
||||
if (FunctionBuildConfig.isDemoMode
|
||||
|
||||
@@ -866,6 +866,7 @@ public class TaxiModel {
|
||||
|
||||
//清除订单信息
|
||||
public void clearCurrentOCHOrder() {
|
||||
startOrStopCalculateRouteInfo(false);
|
||||
mCurrentOCHOrder = null;
|
||||
TaxiTrajectoryManager.getInstance().syncTrajectoryInfo();
|
||||
SharedPrefsMgr.getInstance(mContext).remove(TaxiConst.SP_KEY_OCH_TAXI_ORDER);
|
||||
@@ -1415,7 +1416,7 @@ public class TaxiModel {
|
||||
TaxiModelLoopManager.getInstance().startCalculateRouteInfoLoop();
|
||||
} else {
|
||||
mRoutePoints.clear();
|
||||
TaxiModelLoopManager.getInstance().stopCalculateRouteInfLoop();
|
||||
TaxiModelLoopManager.getInstance().stopCalculateRouteInfoLoop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -166,9 +166,9 @@ public class TaxiModelLoopManager {
|
||||
});
|
||||
}
|
||||
|
||||
public void stopCalculateRouteInfLoop() {
|
||||
public void stopCalculateRouteInfoLoop() {
|
||||
if (mCalculateRouteDisposable != null) {
|
||||
CallerLogger.INSTANCE.i(M_TAXI + TAG, "stopCalculateRouteInfLoop()");
|
||||
CallerLogger.INSTANCE.i(M_TAXI + TAG, "stopCalculateRouteInfoLoop()");
|
||||
mCalculateRouteDisposable.dispose();
|
||||
mCalculateRouteDisposable = null;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
@@ -381,8 +383,15 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
|
||||
}
|
||||
|
||||
public void showLoginDialogFragment(){
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG,"showLoginDialogFragment 展示登录界面");
|
||||
CallerHmiManager.INSTANCE.hideToolsView();
|
||||
Fragment fragmentByTag = getParentFragmentManager().findFragmentByTag(TaxiLoginDialogFragment.Companion.getTAG());
|
||||
if(fragmentByTag instanceof DialogFragment){
|
||||
DialogFragment dialogFragment = (DialogFragment)fragmentByTag;
|
||||
if(dialogFragment.getDialog()!=null&&dialogFragment.getDialog().isShowing()){
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(taxiLoginDialogFragment==null||taxiLoginDialogFragment.get()==null) {
|
||||
taxiLoginDialogFragment = new WeakReference<>(TaxiLoginDialogFragment.newInstance());
|
||||
}
|
||||
@@ -394,7 +403,8 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
|
||||
if (taxiLoginDialog.isAdded()) {//解决方法就是添加这行代码,如果已经添加了,就移除掉然后再show,就不会出现Fragment already added的错误了。
|
||||
getParentFragmentManager().beginTransaction().remove(taxiLoginDialog).commitAllowingStateLoss();
|
||||
}
|
||||
taxiLoginDialog.show(getParentFragmentManager(), taxiLoginDialog.getTag());
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG,"showLoginDialogFragment 展示登录界面");
|
||||
taxiLoginDialog.show(getParentFragmentManager(), TaxiLoginDialogFragment.Companion.getTAG());
|
||||
taxiLoginDialog.setOnDismissListener(dialog -> {
|
||||
taxiLoginDialogFragment.clear();
|
||||
mPresenter.queryLoginStatus();
|
||||
|
||||
@@ -230,7 +230,7 @@ class TaxiLoginDialogFragment : MvpDialogFragment<TaxiLoginDialogFragment?, Taxi
|
||||
|
||||
|
||||
companion object {
|
||||
private val TAG = TaxiLoginDialogFragment::class.java.simpleName
|
||||
val TAG = TaxiLoginDialogFragment::class.java.simpleName
|
||||
|
||||
@JvmStatic
|
||||
fun newInstance(): TaxiLoginDialogFragment {
|
||||
|
||||
@@ -22,11 +22,9 @@ import com.zhidao.support.adas.high.common.Constants
|
||||
import com.zhidao.support.adas.high.common.Constants.ENVIRONMENT.*
|
||||
import com.zhidao.support.adas.high.common.Constants.TERMINAL_ROLE.DRIVER
|
||||
import com.zhidao.support.adas.high.common.Constants.TERMINAL_ROLE.PASSENGER
|
||||
import io.reactivex.Flowable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import java.util.concurrent.TimeUnit
|
||||
import java.util.*
|
||||
import java.util.concurrent.atomic.*
|
||||
|
||||
/**
|
||||
* ADAS-SDK与工控机连接状态回调
|
||||
@@ -43,6 +41,10 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
|
||||
|
||||
private var connectStatus = false
|
||||
|
||||
private val hasUploadTaskLaunched by lazy { AtomicBoolean(false) }
|
||||
|
||||
private val timer = Timer()
|
||||
|
||||
init {
|
||||
CallerCloudListenerManager.registerCloudListener(TAG, this)
|
||||
}
|
||||
@@ -167,15 +169,16 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
|
||||
*/
|
||||
@SuppressLint("CheckResult")
|
||||
private fun updateDriveStatusTask() {
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "updateDriveStatusTask")
|
||||
Flowable.interval(0, 5, TimeUnit.SECONDS)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.unsubscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe {
|
||||
AdasServiceModel.getInstance()
|
||||
.updateDriveStatus(mCurrentAutopilotStatus, mCurrentAutopilotSpeed)
|
||||
}
|
||||
if (hasUploadTaskLaunched.compareAndSet(false, true)) {
|
||||
timer.schedule(object : TimerTask() {
|
||||
override fun run() {
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "updateDriveStatusTask")
|
||||
AdasServiceModel.getInstance()
|
||||
.updateDriveStatus(mCurrentAutopilotStatus, mCurrentAutopilotSpeed)
|
||||
}
|
||||
}, 0, 5000)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun tokenGot(sn: String) {
|
||||
|
||||
@@ -92,33 +92,33 @@ public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
|
||||
}
|
||||
}
|
||||
|
||||
if (polygons.size() > 1) {
|
||||
if (overlayManager == null) {
|
||||
overlayManager = MogoOverlayManager.getInstance();
|
||||
}
|
||||
MogoPolylineOptions options = new MogoPolylineOptions();
|
||||
List<Integer> colors = new ArrayList<>();
|
||||
colors.add(Color.argb(204, 237, 172, 21));
|
||||
colors.add(Color.argb(0, 255, 255, 255));
|
||||
options.colorValues(colors);
|
||||
List<MogoLatLng> points = new ArrayList<>();
|
||||
for (int i = 0; i < polygons.size(); i++) {
|
||||
Pair<Double, Double> p = polygons.get(i);
|
||||
points.add(new MogoLatLng(p.second, p.first));
|
||||
}
|
||||
if (points.size() > 2) {
|
||||
points.add(points.get(0));
|
||||
}
|
||||
options.points(points);
|
||||
options.useGradient(true);
|
||||
options.useFacade(true);
|
||||
options.setGps(false);
|
||||
options.width(5f);
|
||||
options.zIndex(75000f);
|
||||
options.maxIndex(800000f);
|
||||
polyline = overlayManager.addPolyline(options);
|
||||
polyline.setVisible(true);
|
||||
}
|
||||
// if (polygons.size() > 1) {
|
||||
// if (overlayManager == null) {
|
||||
// overlayManager = MogoOverlayManager.getInstance();
|
||||
// }
|
||||
// MogoPolylineOptions options = new MogoPolylineOptions();
|
||||
// List<Integer> colors = new ArrayList<>();
|
||||
// colors.add(Color.argb(204, 237, 172, 21));
|
||||
// colors.add(Color.argb(0, 255, 255, 255));
|
||||
// options.colorValues(colors);
|
||||
// List<MogoLatLng> points = new ArrayList<>();
|
||||
// for (int i = 0; i < polygons.size(); i++) {
|
||||
// Pair<Double, Double> p = polygons.get(i);
|
||||
// points.add(new MogoLatLng(p.second, p.first));
|
||||
// }
|
||||
// if (points.size() > 2) {
|
||||
// points.add(points.get(0));
|
||||
// }
|
||||
// options.points(points);
|
||||
// options.useGradient(true);
|
||||
// options.useFacade(true);
|
||||
// options.setGps(false);
|
||||
// options.width(5f);
|
||||
// options.zIndex(75000f);
|
||||
// options.maxIndex(800000f);
|
||||
// polyline = overlayManager.addPolyline(options);
|
||||
// polyline.setVisible(true);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user