Merge branch 'dev_robotaxi-d-app-module_265_220329_2.6.5' of gitlab.zhidaoauto.com:zhjt/AndroidApp/MoGoEagleEye into dev_robotaxi-d-app-module_265_220329_2.6.5
@@ -7,6 +7,7 @@ import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.elegant.utils.UiThreadHandler;
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
@@ -44,7 +45,7 @@ public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener
|
||||
this.mActivity = activity;
|
||||
this.mContainerId = containerId;
|
||||
|
||||
UiThreadHandler.post(() -> stepIntoVrMode());
|
||||
// UiThreadHandler.post(() -> stepIntoVrMode());
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -85,6 +86,8 @@ public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener
|
||||
CallerLogger.INSTANCE.d( M_TAXI_P + TAG, "进入vr模式" );
|
||||
MogoMapUIController.getInstance()
|
||||
.stepInVrMode( true ); // 白天模式
|
||||
|
||||
CallerMoGoUiSettingManager.INSTANCE.stepInDayMode();//白天模式 状态栏字体颜色变黑
|
||||
}
|
||||
|
||||
private void showFragment() {
|
||||
|
||||
@@ -329,6 +329,9 @@ public class BusPassengerModel {
|
||||
if (DebugConfig.isDebug()) {
|
||||
// TipToast.shortTip("到达目的地");
|
||||
}
|
||||
if (mADASStatusCallback != null){
|
||||
mADASStatusCallback.onAutopilotArriveEnd();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -115,7 +115,7 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
|
||||
}
|
||||
}
|
||||
String strHtml2 = "<font color=\"#2D3E5F\">距离 </font>" + "<b><font color=\"#0043FF\">" + dis + "</font></b>" + "<font color=\"#2D3E5F\"> "+disUnit+"</font>"
|
||||
+ "<font color=\"#2D3E5F\">"+" "+"剩余 </font>" + "<b><font color=\"#0043FF\">" + (int)Math.ceil((double)timeInSecond/ 60f) + "</font></b>" + "<font color=\"#2D3E5F\"> 分钟</font>";
|
||||
+ "<font color=\"#2D3E5F\">   剩余 </font>" + "<b><font color=\"#0043FF\">" + (int)Math.ceil((double)timeInSecond/ 60f) + "</font></b>" + "<font color=\"#2D3E5F\"> 分钟</font>";
|
||||
mCurrentArriveTip.setText(Html.fromHtml(strHtml2));
|
||||
}
|
||||
|
||||
|
||||
@@ -56,14 +56,17 @@ public class BusPassengerMapDirectionView
|
||||
private Marker mStartMarker;
|
||||
private Marker mEndMarker;
|
||||
|
||||
private int mCurrentIndex = -1;
|
||||
|
||||
private int zoomLevel = 13;
|
||||
private List<LatLng> mCoordinatesLatLng = new ArrayList<>();
|
||||
private List<LatLng> mWayPointsLatLng = new ArrayList<>();
|
||||
private List<LatLng> mLinePointsLatLng = new ArrayList<>();
|
||||
private Polyline mPolyline;
|
||||
private CameraUpdate mCameraUpdate;
|
||||
private Context mContext;
|
||||
|
||||
private List<Integer> colorList = new ArrayList<>();
|
||||
private List<Marker> mLineMarkers = new ArrayList<>();
|
||||
|
||||
private IBusPassengerMapViewCallback mIBusPassengerMapViewCallback;
|
||||
|
||||
@@ -84,7 +87,7 @@ public class BusPassengerMapDirectionView
|
||||
}
|
||||
}
|
||||
|
||||
public void setTaxiPassengerMapViewCallback(IBusPassengerMapViewCallback iBusPassengerMapViewCallback){
|
||||
public void setTaxiPassengerMapViewCallback(IBusPassengerMapViewCallback iBusPassengerMapViewCallback) {
|
||||
this.mIBusPassengerMapViewCallback = iBusPassengerMapViewCallback;
|
||||
}
|
||||
|
||||
@@ -111,7 +114,7 @@ public class BusPassengerMapDirectionView
|
||||
}
|
||||
|
||||
private void initAMapView() {
|
||||
mCameraUpdate = CameraUpdateFactory.zoomTo(zoomLevel);
|
||||
// mCameraUpdate = CameraUpdateFactory.zoomTo(zoomLevel);
|
||||
mAMap = mAMapNaviView.getMap();
|
||||
// 设置导航地图模式,aMap是地图控制器对象。
|
||||
mAMap.setMapType(AMap.MAP_TYPE_NIGHT);
|
||||
@@ -124,20 +127,20 @@ public class BusPassengerMapDirectionView
|
||||
.icon(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_car))
|
||||
.anchor(0.5f, 0.5f));
|
||||
mStartMarker = mAMap.addMarker(new MarkerOptions()
|
||||
.icon(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_view_dir_start)));
|
||||
.icon(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_view_dir_way_point)));
|
||||
mEndMarker = mAMap.addMarker(new MarkerOptions()
|
||||
.icon(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_view_dir_end)));
|
||||
.icon(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_view_dir_end_point)));
|
||||
|
||||
// 加载自定义样式
|
||||
CustomMapStyleOptions customMapStyleOptions = new CustomMapStyleOptions()
|
||||
.setEnable(true)
|
||||
.setStyleData(BusPassengerMapAssetStyleUtil.getAssetsStyle(getContext(),"map_style.data"))
|
||||
.setStyleExtraData(BusPassengerMapAssetStyleUtil.getAssetsExtraStyle(getContext(),"map_style_extra.data"));
|
||||
.setStyleData(BusPassengerMapAssetStyleUtil.getAssetsStyle(getContext(), "map_style.data"))
|
||||
.setStyleExtraData(BusPassengerMapAssetStyleUtil.getAssetsExtraStyle(getContext(), "map_style_extra.data"));
|
||||
// 设置自定义样式
|
||||
mAMap.setCustomMapStyle(customMapStyleOptions);
|
||||
|
||||
//设置希望展示的地图缩放级别
|
||||
mAMap.moveCamera(mCameraUpdate);
|
||||
// mAMap.moveCamera(mCameraUpdate);
|
||||
|
||||
// 设置地图的样式
|
||||
UiSettings uiSettings = mAMap.getUiSettings();
|
||||
@@ -153,8 +156,8 @@ public class BusPassengerMapDirectionView
|
||||
// 加载自定义样式
|
||||
CustomMapStyleOptions customMapStyleOptions = new CustomMapStyleOptions()
|
||||
.setEnable(true)
|
||||
.setStyleData(BusPassengerMapAssetStyleUtil.getAssetsStyle(getContext(),"map_style.data"))
|
||||
.setStyleExtraData(BusPassengerMapAssetStyleUtil.getAssetsExtraStyle(getContext(),"map_style_extra.data"));
|
||||
.setStyleData(BusPassengerMapAssetStyleUtil.getAssetsStyle(getContext(), "map_style.data"))
|
||||
.setStyleExtraData(BusPassengerMapAssetStyleUtil.getAssetsExtraStyle(getContext(), "map_style_extra.data"));
|
||||
// 设置自定义样式
|
||||
mAMap.setCustomMapStyle(customMapStyleOptions);
|
||||
mAMapNaviView.getMap().setPointToCenter(mAMapNaviView.getWidth() / 2, mAMapNaviView.getHeight() / 2);
|
||||
@@ -174,8 +177,8 @@ public class BusPassengerMapDirectionView
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(@Nullable MogoLocation location) {
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "onCarLocationChanged2 :" + location.getLatitude()+":"+location.getLongitude());
|
||||
if (location == null){
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "onCarLocationChanged2 :" + location.getLatitude() + ":" + location.getLongitude());
|
||||
if (location == null) {
|
||||
return;
|
||||
}
|
||||
LatLng currentLatLng = new LatLng(location.getLatitude(), location.getLongitude());
|
||||
@@ -188,21 +191,17 @@ public class BusPassengerMapDirectionView
|
||||
mCarMarker.setToTop();
|
||||
}
|
||||
|
||||
if (mCoordinatesLatLng.size() > 1) {
|
||||
if (mLinePointsLatLng.size() > 1){
|
||||
//圈定地图显示范围
|
||||
LatLng endLatLng = mCoordinatesLatLng.get(mCoordinatesLatLng.size() - 1);
|
||||
LatLng startLatLng = mCoordinatesLatLng.get(0);
|
||||
//存放经纬度
|
||||
LatLngBounds.Builder boundsBuilder = new LatLngBounds.Builder();
|
||||
boundsBuilder.include(startLatLng);
|
||||
boundsBuilder.include(endLatLng);
|
||||
for (int i=0;i < mWayPointsLatLng.size();i++){
|
||||
boundsBuilder.include(mWayPointsLatLng.get(i));
|
||||
for (int i = 0; i < mLinePointsLatLng.size(); i++) {
|
||||
boundsBuilder.include(mLinePointsLatLng.get(i));
|
||||
}
|
||||
//第二个参数为四周留空宽度
|
||||
mAMap.animateCamera(CameraUpdateFactory.newLatLngBounds(boundsBuilder.build(), 100));
|
||||
mAMap.animateCamera(CameraUpdateFactory.newLatLngBoundsRect(boundsBuilder.build(),100,100,100,100));
|
||||
|
||||
} else {
|
||||
}else {
|
||||
//设置希望展示的地图缩放级别
|
||||
CameraPosition cameraPosition = new CameraPosition.Builder()
|
||||
.target(mCarMarker.getPosition()).tilt(0).bearing(location.getBearing()).zoom(zoomLevel).build();
|
||||
@@ -240,15 +239,6 @@ public class BusPassengerMapDirectionView
|
||||
mPolyline = mAMap.addPolyline(polylineOptions);
|
||||
|
||||
}
|
||||
|
||||
if (mWayPointsLatLng.size() > 0){
|
||||
for (int i =0 ;i< mWayPointsLatLng.size(); i++){
|
||||
Marker mWayPointMarker = mAMap.addMarker(new MarkerOptions()
|
||||
.icon(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_view_dir_way_point)));
|
||||
mWayPointMarker.setPosition(mWayPointsLatLng.get(i));
|
||||
mWayPointMarker.setVisible(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,29 +246,11 @@ public class BusPassengerMapDirectionView
|
||||
* 添加画线颜色值
|
||||
*/
|
||||
private void addRouteColorList() {
|
||||
for (int i = 0; i < mCoordinatesLatLng.size(); i++){
|
||||
for (int i = 0; i < mCoordinatesLatLng.size(); i++) {
|
||||
colorList.add(Color.argb(255, 70, 147, 253));//路线颜色
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public LatLng CoordinateConverterFrom84(Context mContext, MogoLatLng mogoLatLng) {
|
||||
CoordinateConverter mCoordinateConverter = new CoordinateConverter(mContext);
|
||||
mCoordinateConverter.from(CoordinateConverter.CoordType.GPS);
|
||||
mCoordinateConverter.coord(new LatLng(mogoLatLng.lat, mogoLatLng.lon));
|
||||
LatLng latLng = mCoordinateConverter.convert();
|
||||
return latLng;
|
||||
}
|
||||
|
||||
public List<LatLng> CoordinateConverterFrom84ForList(Context mContext, List<MogoLatLng> mogoLatLngList) {
|
||||
List<LatLng> list = new ArrayList<>();
|
||||
for (MogoLatLng m : mogoLatLngList) {
|
||||
LatLng mogoLatLng = CoordinateConverterFrom84(mContext, m);
|
||||
list.add(mogoLatLng);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearPolyline() {
|
||||
if (mPolyline != null) {
|
||||
@@ -292,19 +264,6 @@ public class BusPassengerMapDirectionView
|
||||
}
|
||||
}
|
||||
|
||||
public void resetPolyine() {
|
||||
mCoordinatesLatLng.clear();
|
||||
if (mPolyline != null) {
|
||||
mPolyline.remove();
|
||||
}
|
||||
if (mStartMarker != null) {
|
||||
mStartMarker.setVisible(false);
|
||||
}
|
||||
if (mEndMarker != null) {
|
||||
mEndMarker.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void onCreateView(Bundle savedInstanceState) {
|
||||
if (mAMapNaviView != null) {
|
||||
mAMapNaviView.onCreate(savedInstanceState);
|
||||
@@ -321,28 +280,53 @@ public class BusPassengerMapDirectionView
|
||||
if (mAMapNaviView != null) {
|
||||
mAMapNaviView.onPause();
|
||||
}
|
||||
mCurrentIndex = -1;
|
||||
}
|
||||
|
||||
public void onDestroy() {
|
||||
if (mAMapNaviView != null) {
|
||||
mAMapNaviView.onDestroy();
|
||||
}
|
||||
mCurrentIndex = -1;
|
||||
}
|
||||
|
||||
public void convert(List<MogoLatLng> coordinates) {
|
||||
mCoordinatesLatLng.clear();
|
||||
List<LatLng> latLngs = CoordinateConverterFrom84ForList(mContext, coordinates);
|
||||
mCoordinatesLatLng.addAll(latLngs);
|
||||
}
|
||||
|
||||
public void setCoordinatesLatLng(List<LatLng> latLngs){
|
||||
public void setCoordinatesLatLng(List<LatLng> latLngs) {
|
||||
mCoordinatesLatLng.clear();
|
||||
mCoordinatesLatLng.addAll(latLngs);
|
||||
}
|
||||
|
||||
public void setWayPointMarker(List<LatLng> wayPointLatLngs){
|
||||
mWayPointsLatLng.clear();
|
||||
mCoordinatesLatLng.addAll(wayPointLatLngs);
|
||||
public void setLinePointMarkerAndDraw(List<LatLng> routeLineLatLngs, int currentIndex) {
|
||||
mLinePointsLatLng.clear();
|
||||
mLineMarkers.clear();
|
||||
mLinePointsLatLng.addAll(routeLineLatLngs);
|
||||
for (int i = 0; i < mLinePointsLatLng.size(); i++) {
|
||||
Marker mWayPointMarker = mAMap.addMarker(new MarkerOptions()
|
||||
.icon(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_view_dir_way_point)));
|
||||
mLineMarkers.add(mWayPointMarker);
|
||||
}
|
||||
|
||||
if (mCoordinatesLatLng.size() == 0) {
|
||||
for (int i = 0; i < mLineMarkers.size(); i++) {
|
||||
mLineMarkers.get(i).setPosition(mLinePointsLatLng.get(i));
|
||||
mLineMarkers.get(i).setVisible(true);
|
||||
}
|
||||
mCurrentIndex = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (mCurrentIndex != currentIndex) {
|
||||
if (mAMap != null && mLineMarkers.size() > 0) {
|
||||
mCurrentIndex = currentIndex;
|
||||
for (int i = 0; i < mLineMarkers.size(); i++) {
|
||||
if (i != currentIndex && i + 1 != currentIndex) {
|
||||
mLineMarkers.get(i).setPosition(mLinePointsLatLng.get(i));
|
||||
mLineMarkers.get(i).setVisible(true);
|
||||
} else {
|
||||
mLineMarkers.get(i).setVisible(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,19 +22,13 @@ import com.mogo.och.bus.passenger.R;
|
||||
import com.mogo.och.bus.passenger.adapter.BusPassengerLineStationsAdapter;
|
||||
import com.mogo.och.bus.passenger.bean.BusPassengerStation;
|
||||
import com.mogo.och.bus.passenger.callback.IBusPassengerMapViewCallback;
|
||||
import com.mogo.och.bus.passenger.model.BusPassengerModel;
|
||||
import com.mogo.och.bus.passenger.presenter.BaseBusPassengerPresenter;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import com.mogo.och.bus.passenger.utils.BPCoordinateCalculateRouteUtil;
|
||||
import com.mogo.och.bus.passenger.utils.BPRouteDataTestUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
|
||||
|
||||
/**
|
||||
@@ -48,7 +42,7 @@ public class BusPassengerRouteFragment extends
|
||||
|
||||
private BusPassengerTrafficLightView mTrafficLightView;
|
||||
private List<BusPassengerStation> mStationsList = new ArrayList<>();
|
||||
private List<LatLng> mWayPointsList = new ArrayList<>();
|
||||
private List<LatLng> mRoutePointsList = new ArrayList<>();
|
||||
|
||||
private TextView mSpeedTv;
|
||||
private ConstraintLayout mNoLineInfoView;
|
||||
@@ -100,196 +94,13 @@ public class BusPassengerRouteFragment extends
|
||||
mSpeedTv.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
String listStr = "{\"models\":[{\n" +
|
||||
"\t\t\"lat\": 40.19927810144466,\n" +
|
||||
"\t\t\"lon\": 116.73527259387767\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19927836356079,\n" +
|
||||
"\t\t\"lon\": 116.73513114732762\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19927759500293,\n" +
|
||||
"\t\t\"lon\": 116.73497660879111\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.199264819842284,\n" +
|
||||
"\t\t\"lon\": 116.73480063747202\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.1992510141554,\n" +
|
||||
"\t\t\"lon\": 116.73463922037767\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.199245872804,\n" +
|
||||
"\t\t\"lon\": 116.73445960685193\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19924673374912,\n" +
|
||||
"\t\t\"lon\": 116.73427704009703\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19924747108264,\n" +
|
||||
"\t\t\"lon\": 116.7340707102972\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19924828745573,\n" +
|
||||
"\t\t\"lon\": 116.73385916927226\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19924941093133,\n" +
|
||||
"\t\t\"lon\": 116.73364048294795\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19924939253381,\n" +
|
||||
"\t\t\"lon\": 116.73340837408566\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19924949105934,\n" +
|
||||
"\t\t\"lon\": 116.73317368725336\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19925040039033,\n" +
|
||||
"\t\t\"lon\": 116.73296532811216\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.1992515355653,\n" +
|
||||
"\t\t\"lon\": 116.73277787366743\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.1992512720328,\n" +
|
||||
"\t\t\"lon\": 116.73263377253741\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.199205174954606,\n" +
|
||||
"\t\t\"lon\": 116.73249773114644\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.1991015743076,\n" +
|
||||
"\t\t\"lon\": 116.7324219601283\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.198971862686285,\n" +
|
||||
"\t\t\"lon\": 116.73239393296355\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19883883071582,\n" +
|
||||
"\t\t\"lon\": 116.73237676435652\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19870171355796,\n" +
|
||||
"\t\t\"lon\": 116.73236052150362\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.1985491853193,\n" +
|
||||
"\t\t\"lon\": 116.73234157857011\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.1983890047355,\n" +
|
||||
"\t\t\"lon\": 116.73232167996464\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.1982209877466,\n" +
|
||||
"\t\t\"lon\": 116.73230101645792\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.198037574138326,\n" +
|
||||
"\t\t\"lon\": 116.73227735486083\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19787327856243,\n" +
|
||||
"\t\t\"lon\": 116.73225676816314\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19771917207499,\n" +
|
||||
"\t\t\"lon\": 116.73223814728027\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.197548305175935,\n" +
|
||||
"\t\t\"lon\": 116.73221624705808\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19739568979691,\n" +
|
||||
"\t\t\"lon\": 116.73219618210774\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19724703821575,\n" +
|
||||
"\t\t\"lon\": 116.73217598293311\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.1970956560885,\n" +
|
||||
"\t\t\"lon\": 116.73215773721505\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19697703483188,\n" +
|
||||
"\t\t\"lon\": 116.73214337172284\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19687000725696,\n" +
|
||||
"\t\t\"lon\": 116.73210037067965\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.196833449601726,\n" +
|
||||
"\t\t\"lon\": 116.73196646708011\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19685833847804,\n" +
|
||||
"\t\t\"lon\": 116.73181315361103\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.196889170203264,\n" +
|
||||
"\t\t\"lon\": 116.73164355747393\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19692242860347,\n" +
|
||||
"\t\t\"lon\": 116.7314555399657\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19696431701069,\n" +
|
||||
"\t\t\"lon\": 116.7312261834129\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19700025925464,\n" +
|
||||
"\t\t\"lon\": 116.73102774016093\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19703414798773,\n" +
|
||||
"\t\t\"lon\": 116.73084270562073\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19707287604138,\n" +
|
||||
"\t\t\"lon\": 116.73062835248406\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19710951629977,\n" +
|
||||
"\t\t\"lon\": 116.73041744082339\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19714593807105,\n" +
|
||||
"\t\t\"lon\": 116.73021414314803\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.197183297026285,\n" +
|
||||
"\t\t\"lon\": 116.7300057066447\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.1972247359487,\n" +
|
||||
"\t\t\"lon\": 116.7297751515664\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19726518822745,\n" +
|
||||
"\t\t\"lon\": 116.72954958923812\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19730538240706,\n" +
|
||||
"\t\t\"lon\": 116.72932440756041\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19734272112662,\n" +
|
||||
"\t\t\"lon\": 116.72911631453036\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.197379191549075,\n" +
|
||||
"\t\t\"lon\": 116.72890982812105\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.197417565369314,\n" +
|
||||
"\t\t\"lon\": 116.72869447869044\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19746052080799,\n" +
|
||||
"\t\t\"lon\": 116.72845641541247\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19750040582118,\n" +
|
||||
"\t\t\"lon\": 116.72823569991117\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19753999704064,\n" +
|
||||
"\t\t\"lon\": 116.72801998373052\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19757796882569,\n" +
|
||||
"\t\t\"lon\": 116.72781280504363\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.197617062364586,\n" +
|
||||
"\t\t\"lon\": 116.72759949431683\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19765391602761,\n" +
|
||||
"\t\t\"lon\": 116.72739776789756\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19768973009218,\n" +
|
||||
"\t\t\"lon\": 116.72719980764646\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.197726191028785,\n" +
|
||||
"\t\t\"lon\": 116.72699719861669\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19776233489642,\n" +
|
||||
"\t\t\"lon\": 116.72679516155276\n" +
|
||||
"\t}]}\n";
|
||||
List<MessagePad.Location> list = new ArrayList<>();
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(listStr);
|
||||
JSONArray jsonElements = jsonObject.getJSONArray("models");
|
||||
for (int i = 0; i < jsonElements.length(); i++){
|
||||
JSONObject s = jsonElements.getJSONObject(i);
|
||||
MessagePad.Location.Builder routeModels = MessagePad.Location.newBuilder();
|
||||
routeModels.setLatitude(s.getDouble("lat"));
|
||||
routeModels.setLongitude(s.getDouble("lon"));
|
||||
list.add(routeModels.build());
|
||||
BPRouteDataTestUtils.converToRouteData();
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
updateWayPointList(mStationsList,1);
|
||||
}
|
||||
BusPassengerModel.getInstance().updateRoutePoints(list);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
},1000);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
@@ -343,7 +154,6 @@ public class BusPassengerRouteFragment extends
|
||||
*/
|
||||
private void drawablePolyline(List<LatLng> coordinates) {
|
||||
if (mMapDirectionView != null) {
|
||||
mMapDirectionView.setWayPointMarker(mWayPointsList);
|
||||
mMapDirectionView.setCoordinatesLatLng(coordinates);
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
@@ -354,12 +164,13 @@ public class BusPassengerRouteFragment extends
|
||||
}
|
||||
}
|
||||
|
||||
private void clearPolyline() {
|
||||
public void clearPolyline() {
|
||||
if (mMapDirectionView != null) {
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mMapDirectionView.clearPolyline();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -385,22 +196,30 @@ public class BusPassengerRouteFragment extends
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param stations
|
||||
* @param currentStationIndex
|
||||
* @param isArrived 是否到站并离开,true 到达当前站 currentStationIndex 未离开, false 正在前往此站 currentStationIndex
|
||||
*/
|
||||
public void updateStationsInfo(List<BusPassengerStation> stations, int currentStationIndex,boolean isArrived) {
|
||||
updateArrivedStation(stations.get(currentStationIndex).getName(),currentStationIndex,isArrived);
|
||||
mStationsList.clear();
|
||||
mStationsList.addAll(stations);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
if (stations.size() > 2){
|
||||
updateWayPointList(stations);
|
||||
if (stations.size() > 0){
|
||||
updateWayPointList(stations,currentStationIndex);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateWayPointList(List<BusPassengerStation> stations) {
|
||||
mWayPointsList.clear();
|
||||
for (int i = 1; i< stations.size() -1; i++) {//去除路线的起点和终点, 只要中间途径站点
|
||||
LatLng latLng = new LatLng(stations.get(i).getLat(),stations.get(i).getLon());// lat,lon
|
||||
mWayPointsList.add(latLng);
|
||||
private void updateWayPointList(List<BusPassengerStation> stations,int currentStationIndex) {
|
||||
mRoutePointsList.clear();
|
||||
for (int i = 0; i< stations.size(); i++) {//站点集合
|
||||
LatLng latLng = BPCoordinateCalculateRouteUtil.coordinateConverterWgsToGcj(getContext()
|
||||
,stations.get(i).getLon(),stations.get(i).getLat());// lat,lon
|
||||
mRoutePointsList.add(latLng);
|
||||
}
|
||||
mMapDirectionView.setLinePointMarkerAndDraw(mRoutePointsList,currentStationIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -97,9 +97,6 @@ public class BusPassengerTrafficLightView extends IViewTrafficLight {
|
||||
super.changeCountdownRed(redNum);
|
||||
UiThreadHandler.post(() -> {
|
||||
if (redNum > 0) {
|
||||
// mLightTimeTV.setVertrial(true);
|
||||
// mLightTimeTV.setmColorList(new int[]{getResources().getColor(R.color.bus_p_traffic_light_red_color_up),
|
||||
// getResources().getColor(R.color.bus_p_traffic_light_red_color_down)});
|
||||
mLightTimeTV.setText(String.valueOf(redNum));
|
||||
} else {
|
||||
mLightTimeTV.setText("");
|
||||
@@ -112,9 +109,6 @@ public class BusPassengerTrafficLightView extends IViewTrafficLight {
|
||||
super.changeCountdownGreen(greenNum);
|
||||
UiThreadHandler.post(() -> {
|
||||
if (greenNum > 0) {
|
||||
// mLightTimeTV.setVertrial(true);
|
||||
// mLightTimeTV.setmColorList(new int[]{getResources().getColor(R.color.bus_p_traffic_light_green_color_up),
|
||||
// getResources().getColor(R.color.bus_p_traffic_light_green_color_down)});
|
||||
mLightTimeTV.setText(String.valueOf(greenNum));
|
||||
} else {
|
||||
mLightTimeTV.setText("");
|
||||
@@ -127,9 +121,6 @@ public class BusPassengerTrafficLightView extends IViewTrafficLight {
|
||||
super.changeCountdownYellow(yellowNum);
|
||||
UiThreadHandler.post(() -> {
|
||||
if (yellowNum > 0) {
|
||||
// mLightTimeTV.setVertrial(true);
|
||||
// mLightTimeTV.setmColorList(new int[]{getResources().getColor(R.color.bus_p_traffic_light_yellow_color_up),
|
||||
// getResources().getColor(R.color.bus_p_traffic_light_yellow_color_down)});
|
||||
mLightTimeTV.setText(String.valueOf(yellowNum));
|
||||
} else {
|
||||
mLightTimeTV.setText("");
|
||||
|
||||
@@ -48,6 +48,14 @@ public class BPCoordinateCalculateRouteUtil {
|
||||
return list;
|
||||
}
|
||||
|
||||
public static LatLng coordinateConverterWgsToGcj(Context mContext, double lon, double lat) {
|
||||
CoordinateConverter mCoordinateConverter = new CoordinateConverter(mContext);
|
||||
mCoordinateConverter.from(CoordinateConverter.CoordType.GPS);
|
||||
mCoordinateConverter.coord(new LatLng(lat,lon));
|
||||
LatLng latLng = mCoordinateConverter.convert();
|
||||
return latLng;
|
||||
}
|
||||
|
||||
public static LatLng coordinateConverterWgsToGcj(Context mContext, MessagePad.Location mogoLatLng) {
|
||||
CoordinateConverter mCoordinateConverter = new CoordinateConverter(mContext);
|
||||
mCoordinateConverter.from(CoordinateConverter.CoordType.GPS);
|
||||
|
||||
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 628 B |
|
After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 628 B |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 628 B |
|
After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 842 B |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 628 B |
@@ -4,8 +4,8 @@
|
||||
<shape android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:endColor="#E1E7F5"
|
||||
android:startColor="#E1E7F5"
|
||||
android:endColor="#F2F7FF"
|
||||
android:startColor="#E6ECF9"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
@@ -71,7 +71,6 @@
|
||||
android:id="@+id/dividing_line_1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bus_p_route_line_dividing_view_height"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:background="@drawable/bus_p_dividing_line_bg"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_p_speed_tv" />
|
||||
|
||||
@@ -50,11 +50,13 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="@dimen/bus_p_station_tag_width_height"
|
||||
android:layout_height="@dimen/bus_p_station_tag_width_height"
|
||||
android:textSize="@dimen/bus_p_station_tag_txt_size"
|
||||
android:textColor="@color/bus_p_end_tag_txt_color"
|
||||
android:text="@string/bus_p_end_station_txt_tag"
|
||||
android:includeFontPadding="false"
|
||||
android:gravity="center"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_end_tag"
|
||||
app:layout_constraintRight_toRightOf="@+id/bus_p_end_tag"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_end_tag"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bus_p_station_item_height"
|
||||
android:layout_height="@dimen/bus_p_station_item_middle_height"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<ImageView
|
||||
|
||||
@@ -52,11 +52,13 @@
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_start_station"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_start_station"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="@dimen/bus_p_station_tag_width_height"
|
||||
android:layout_height="@dimen/bus_p_station_tag_width_height"
|
||||
android:textSize="@dimen/bus_p_station_tag_txt_size"
|
||||
android:textColor="@color/bus_p_end_tag_txt_color"
|
||||
android:text="@string/bus_p_start_station_txt_tag"
|
||||
android:includeFontPadding="false"
|
||||
android:gravity="center"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_start_tag"
|
||||
app:layout_constraintRight_toRightOf="@+id/bus_p_start_tag"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_start_tag"
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
android:id="@+id/bus_p_traffic_light_iv"
|
||||
android:layout_width="@dimen/bus_p_traffic_light_icon_size"
|
||||
android:layout_height="@dimen/bus_p_traffic_light_icon_size"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:scaleType="fitXY"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
@@ -27,6 +28,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:textSize="@dimen/bus_p_traffic_light_time_size"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/bus_p_traffic_txt_color"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:gravity="center" />
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
<dimen name="bus_p_route_info_margin_right">40px</dimen>
|
||||
<dimen name="bus_p_route_info_margin_left">40px</dimen>
|
||||
<dimen name="bus_p_route_info_margin_bottom">40px</dimen>
|
||||
<dimen name="bus_p_route_info_margin_top">70px</dimen>
|
||||
<dimen name="bus_p_route_info_margin_top">110px</dimen>
|
||||
<dimen name="bus_p_route_line_info_height">224px</dimen>
|
||||
<dimen name="bus_p_route_line_map_view_height">510px</dimen>
|
||||
<dimen name="bus_p_route_line_dividing_view_height">1px</dimen>
|
||||
<dimen name="bus_p_route_line_dividing_view_height">3px</dimen>
|
||||
|
||||
<dimen name="bus_p_route_traffic_light_view_width">158px</dimen>
|
||||
<dimen name="bus_p_route_traffic_light_view_height">90px</dimen>
|
||||
@@ -15,8 +15,8 @@
|
||||
<dimen name="bus_p_traffic_light_bg_width">158px</dimen>
|
||||
<dimen name="bus_p_traffic_light_bg_height">90px</dimen>
|
||||
<dimen name="bus_p_traffic_light_time_size">45px</dimen>
|
||||
<dimen name="bus_p_traffic_light_time_view_width">100px</dimen>
|
||||
<dimen name="bus_p_traffic_light_icon_size">100px</dimen>
|
||||
<dimen name="bus_p_traffic_light_time_view_width">90px</dimen>
|
||||
<dimen name="bus_p_traffic_light_icon_size">90px</dimen>
|
||||
<dimen name="bus_p_traffic_light_bg_stroke_width">3px</dimen>
|
||||
|
||||
<dimen name="bus_p_route_dividing_line2_margin_top">224px</dimen>
|
||||
@@ -41,7 +41,8 @@
|
||||
<dimen name="bus_p_mid_station_circle_cor">6px</dimen>
|
||||
<dimen name="bus_p_station_txt_size">50px</dimen>
|
||||
<dimen name="bus_p_station_tag_txt_size">36px</dimen>
|
||||
<dimen name="bus_p_station_item_height">75px</dimen>
|
||||
<dimen name="bus_p_station_item_height">80px</dimen>
|
||||
<dimen name="bus_p_station_item_middle_height">100px</dimen>
|
||||
<dimen name="bus_p_station_tag_line_height">50px</dimen>
|
||||
<dimen name="bus_p_station_tag_line_width">6px</dimen>
|
||||
|
||||
|
||||
@@ -25,4 +25,5 @@
|
||||
<color name="bus_p_panel_cur_station_tips_color">#2D3E5F</color>
|
||||
<color name="bus_p_panel_cur_station_panel_color">#E6E9EFFC</color>
|
||||
<color name="bus_p_route_view_left_edge_shadow">#33394C63</color>
|
||||
<color name="bus_p_traffic_txt_color">#2D3E5F</color>
|
||||
</resources>
|
||||
@@ -5,10 +5,10 @@
|
||||
<dimen name="bus_p_route_info_margin_right">40px</dimen>
|
||||
<dimen name="bus_p_route_info_margin_left">40px</dimen>
|
||||
<dimen name="bus_p_route_info_margin_bottom">40px</dimen>
|
||||
<dimen name="bus_p_route_info_margin_top">70px</dimen>
|
||||
<dimen name="bus_p_route_info_margin_top">110px</dimen>
|
||||
<dimen name="bus_p_route_line_info_height">224px</dimen>
|
||||
<dimen name="bus_p_route_line_map_view_height">510px</dimen>
|
||||
<dimen name="bus_p_route_line_dividing_view_height">1px</dimen>
|
||||
<dimen name="bus_p_route_line_dividing_view_height">3px</dimen>
|
||||
|
||||
<dimen name="bus_p_route_traffic_light_view_width">158px</dimen>
|
||||
<dimen name="bus_p_route_traffic_light_view_height">90px</dimen>
|
||||
@@ -16,8 +16,8 @@
|
||||
<dimen name="bus_p_traffic_light_bg_width">158px</dimen>
|
||||
<dimen name="bus_p_traffic_light_bg_height">90px</dimen>
|
||||
<dimen name="bus_p_traffic_light_time_size">45px</dimen>
|
||||
<dimen name="bus_p_traffic_light_time_view_width">100px</dimen>
|
||||
<dimen name="bus_p_traffic_light_icon_size">100px</dimen>
|
||||
<dimen name="bus_p_traffic_light_time_view_width">90px</dimen>
|
||||
<dimen name="bus_p_traffic_light_icon_size">90px</dimen>
|
||||
<dimen name="bus_p_traffic_light_bg_stroke_width">3px</dimen>
|
||||
|
||||
<dimen name="bus_p_route_dividing_line2_margin_top">224px</dimen>
|
||||
@@ -42,7 +42,8 @@
|
||||
<dimen name="bus_p_mid_station_circle_cor">6px</dimen>
|
||||
<dimen name="bus_p_station_txt_size">50px</dimen>
|
||||
<dimen name="bus_p_station_tag_txt_size">36px</dimen>
|
||||
<dimen name="bus_p_station_item_height">75px</dimen>
|
||||
<dimen name="bus_p_station_item_height">80px</dimen>
|
||||
<dimen name="bus_p_station_item_middle_height">100px</dimen>
|
||||
<dimen name="bus_p_station_tag_line_height">50px</dimen>
|
||||
<dimen name="bus_p_station_tag_line_width">6px</dimen>
|
||||
|
||||
|
||||
@@ -22,17 +22,11 @@ import com.mogo.och.taxi.bean.OrderQueryRouteInfoRespBean;
|
||||
import com.mogo.och.taxi.model.TaxiModel;
|
||||
import com.mogo.och.taxi.presenter.TaxiPresenter;
|
||||
import com.mogo.och.taxi.utils.PinYinUtil;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import com.mogo.och.taxi.utils.TPRouteDataTestUtils;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2021/1/18
|
||||
@@ -359,200 +353,201 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
|
||||
}
|
||||
|
||||
private void testRouteInfoUpload() {
|
||||
String listStr = "{\"models\":[{\n" +
|
||||
"\t\t\"lat\": 40.19927810144466,\n" +
|
||||
"\t\t\"lon\": 116.73527259387767\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19927836356079,\n" +
|
||||
"\t\t\"lon\": 116.73513114732762\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19927759500293,\n" +
|
||||
"\t\t\"lon\": 116.73497660879111\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.199264819842284,\n" +
|
||||
"\t\t\"lon\": 116.73480063747202\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.1992510141554,\n" +
|
||||
"\t\t\"lon\": 116.73463922037767\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.199245872804,\n" +
|
||||
"\t\t\"lon\": 116.73445960685193\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19924673374912,\n" +
|
||||
"\t\t\"lon\": 116.73427704009703\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19924747108264,\n" +
|
||||
"\t\t\"lon\": 116.7340707102972\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19924828745573,\n" +
|
||||
"\t\t\"lon\": 116.73385916927226\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19924941093133,\n" +
|
||||
"\t\t\"lon\": 116.73364048294795\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19924939253381,\n" +
|
||||
"\t\t\"lon\": 116.73340837408566\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19924949105934,\n" +
|
||||
"\t\t\"lon\": 116.73317368725336\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19925040039033,\n" +
|
||||
"\t\t\"lon\": 116.73296532811216\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.1992515355653,\n" +
|
||||
"\t\t\"lon\": 116.73277787366743\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.1992512720328,\n" +
|
||||
"\t\t\"lon\": 116.73263377253741\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.199205174954606,\n" +
|
||||
"\t\t\"lon\": 116.73249773114644\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.1991015743076,\n" +
|
||||
"\t\t\"lon\": 116.7324219601283\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.198971862686285,\n" +
|
||||
"\t\t\"lon\": 116.73239393296355\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19883883071582,\n" +
|
||||
"\t\t\"lon\": 116.73237676435652\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19870171355796,\n" +
|
||||
"\t\t\"lon\": 116.73236052150362\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.1985491853193,\n" +
|
||||
"\t\t\"lon\": 116.73234157857011\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.1983890047355,\n" +
|
||||
"\t\t\"lon\": 116.73232167996464\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.1982209877466,\n" +
|
||||
"\t\t\"lon\": 116.73230101645792\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.198037574138326,\n" +
|
||||
"\t\t\"lon\": 116.73227735486083\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19787327856243,\n" +
|
||||
"\t\t\"lon\": 116.73225676816314\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19771917207499,\n" +
|
||||
"\t\t\"lon\": 116.73223814728027\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.197548305175935,\n" +
|
||||
"\t\t\"lon\": 116.73221624705808\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19739568979691,\n" +
|
||||
"\t\t\"lon\": 116.73219618210774\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19724703821575,\n" +
|
||||
"\t\t\"lon\": 116.73217598293311\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.1970956560885,\n" +
|
||||
"\t\t\"lon\": 116.73215773721505\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19697703483188,\n" +
|
||||
"\t\t\"lon\": 116.73214337172284\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19687000725696,\n" +
|
||||
"\t\t\"lon\": 116.73210037067965\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.196833449601726,\n" +
|
||||
"\t\t\"lon\": 116.73196646708011\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19685833847804,\n" +
|
||||
"\t\t\"lon\": 116.73181315361103\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.196889170203264,\n" +
|
||||
"\t\t\"lon\": 116.73164355747393\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19692242860347,\n" +
|
||||
"\t\t\"lon\": 116.7314555399657\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19696431701069,\n" +
|
||||
"\t\t\"lon\": 116.7312261834129\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19700025925464,\n" +
|
||||
"\t\t\"lon\": 116.73102774016093\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19703414798773,\n" +
|
||||
"\t\t\"lon\": 116.73084270562073\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19707287604138,\n" +
|
||||
"\t\t\"lon\": 116.73062835248406\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19710951629977,\n" +
|
||||
"\t\t\"lon\": 116.73041744082339\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19714593807105,\n" +
|
||||
"\t\t\"lon\": 116.73021414314803\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.197183297026285,\n" +
|
||||
"\t\t\"lon\": 116.7300057066447\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.1972247359487,\n" +
|
||||
"\t\t\"lon\": 116.7297751515664\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19726518822745,\n" +
|
||||
"\t\t\"lon\": 116.72954958923812\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19730538240706,\n" +
|
||||
"\t\t\"lon\": 116.72932440756041\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19734272112662,\n" +
|
||||
"\t\t\"lon\": 116.72911631453036\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.197379191549075,\n" +
|
||||
"\t\t\"lon\": 116.72890982812105\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.197417565369314,\n" +
|
||||
"\t\t\"lon\": 116.72869447869044\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19746052080799,\n" +
|
||||
"\t\t\"lon\": 116.72845641541247\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19750040582118,\n" +
|
||||
"\t\t\"lon\": 116.72823569991117\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19753999704064,\n" +
|
||||
"\t\t\"lon\": 116.72801998373052\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19757796882569,\n" +
|
||||
"\t\t\"lon\": 116.72781280504363\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.197617062364586,\n" +
|
||||
"\t\t\"lon\": 116.72759949431683\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19765391602761,\n" +
|
||||
"\t\t\"lon\": 116.72739776789756\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19768973009218,\n" +
|
||||
"\t\t\"lon\": 116.72719980764646\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.197726191028785,\n" +
|
||||
"\t\t\"lon\": 116.72699719861669\n" +
|
||||
"\t}, {\n" +
|
||||
"\t\t\"lat\": 40.19776233489642,\n" +
|
||||
"\t\t\"lon\": 116.72679516155276\n" +
|
||||
"\t}]}\n";
|
||||
|
||||
|
||||
List<MessagePad.Location> list = new ArrayList<>();
|
||||
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(listStr);
|
||||
JSONArray jsonElements = jsonObject.getJSONArray("models");
|
||||
for (int i = 0; i < jsonElements.length(); i++) {
|
||||
JSONObject s = jsonElements.getJSONObject(i);
|
||||
MessagePad.Location.Builder builder = MessagePad.Location.newBuilder();
|
||||
builder.setLatitude(s.getDouble("lat"));
|
||||
builder.setLongitude(s.getDouble("lon"));
|
||||
list.add(builder.build());
|
||||
}
|
||||
TaxiModel.getInstance().updateOrderRoute(list);
|
||||
TaxiModel.getInstance().updateOrderRouteInfo(list);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
TPRouteDataTestUtils.converToRouteData();
|
||||
// String listStr = "{\"models\":[{\n" +
|
||||
// "\t\t\"lat\": 40.19927810144466,\n" +
|
||||
// "\t\t\"lon\": 116.73527259387767\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19927836356079,\n" +
|
||||
// "\t\t\"lon\": 116.73513114732762\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19927759500293,\n" +
|
||||
// "\t\t\"lon\": 116.73497660879111\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.199264819842284,\n" +
|
||||
// "\t\t\"lon\": 116.73480063747202\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.1992510141554,\n" +
|
||||
// "\t\t\"lon\": 116.73463922037767\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.199245872804,\n" +
|
||||
// "\t\t\"lon\": 116.73445960685193\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19924673374912,\n" +
|
||||
// "\t\t\"lon\": 116.73427704009703\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19924747108264,\n" +
|
||||
// "\t\t\"lon\": 116.7340707102972\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19924828745573,\n" +
|
||||
// "\t\t\"lon\": 116.73385916927226\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19924941093133,\n" +
|
||||
// "\t\t\"lon\": 116.73364048294795\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19924939253381,\n" +
|
||||
// "\t\t\"lon\": 116.73340837408566\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19924949105934,\n" +
|
||||
// "\t\t\"lon\": 116.73317368725336\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19925040039033,\n" +
|
||||
// "\t\t\"lon\": 116.73296532811216\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.1992515355653,\n" +
|
||||
// "\t\t\"lon\": 116.73277787366743\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.1992512720328,\n" +
|
||||
// "\t\t\"lon\": 116.73263377253741\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.199205174954606,\n" +
|
||||
// "\t\t\"lon\": 116.73249773114644\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.1991015743076,\n" +
|
||||
// "\t\t\"lon\": 116.7324219601283\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.198971862686285,\n" +
|
||||
// "\t\t\"lon\": 116.73239393296355\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19883883071582,\n" +
|
||||
// "\t\t\"lon\": 116.73237676435652\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19870171355796,\n" +
|
||||
// "\t\t\"lon\": 116.73236052150362\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.1985491853193,\n" +
|
||||
// "\t\t\"lon\": 116.73234157857011\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.1983890047355,\n" +
|
||||
// "\t\t\"lon\": 116.73232167996464\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.1982209877466,\n" +
|
||||
// "\t\t\"lon\": 116.73230101645792\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.198037574138326,\n" +
|
||||
// "\t\t\"lon\": 116.73227735486083\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19787327856243,\n" +
|
||||
// "\t\t\"lon\": 116.73225676816314\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19771917207499,\n" +
|
||||
// "\t\t\"lon\": 116.73223814728027\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.197548305175935,\n" +
|
||||
// "\t\t\"lon\": 116.73221624705808\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19739568979691,\n" +
|
||||
// "\t\t\"lon\": 116.73219618210774\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19724703821575,\n" +
|
||||
// "\t\t\"lon\": 116.73217598293311\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.1970956560885,\n" +
|
||||
// "\t\t\"lon\": 116.73215773721505\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19697703483188,\n" +
|
||||
// "\t\t\"lon\": 116.73214337172284\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19687000725696,\n" +
|
||||
// "\t\t\"lon\": 116.73210037067965\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.196833449601726,\n" +
|
||||
// "\t\t\"lon\": 116.73196646708011\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19685833847804,\n" +
|
||||
// "\t\t\"lon\": 116.73181315361103\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.196889170203264,\n" +
|
||||
// "\t\t\"lon\": 116.73164355747393\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19692242860347,\n" +
|
||||
// "\t\t\"lon\": 116.7314555399657\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19696431701069,\n" +
|
||||
// "\t\t\"lon\": 116.7312261834129\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19700025925464,\n" +
|
||||
// "\t\t\"lon\": 116.73102774016093\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19703414798773,\n" +
|
||||
// "\t\t\"lon\": 116.73084270562073\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19707287604138,\n" +
|
||||
// "\t\t\"lon\": 116.73062835248406\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19710951629977,\n" +
|
||||
// "\t\t\"lon\": 116.73041744082339\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19714593807105,\n" +
|
||||
// "\t\t\"lon\": 116.73021414314803\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.197183297026285,\n" +
|
||||
// "\t\t\"lon\": 116.7300057066447\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.1972247359487,\n" +
|
||||
// "\t\t\"lon\": 116.7297751515664\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19726518822745,\n" +
|
||||
// "\t\t\"lon\": 116.72954958923812\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19730538240706,\n" +
|
||||
// "\t\t\"lon\": 116.72932440756041\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19734272112662,\n" +
|
||||
// "\t\t\"lon\": 116.72911631453036\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.197379191549075,\n" +
|
||||
// "\t\t\"lon\": 116.72890982812105\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.197417565369314,\n" +
|
||||
// "\t\t\"lon\": 116.72869447869044\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19746052080799,\n" +
|
||||
// "\t\t\"lon\": 116.72845641541247\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19750040582118,\n" +
|
||||
// "\t\t\"lon\": 116.72823569991117\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19753999704064,\n" +
|
||||
// "\t\t\"lon\": 116.72801998373052\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19757796882569,\n" +
|
||||
// "\t\t\"lon\": 116.72781280504363\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.197617062364586,\n" +
|
||||
// "\t\t\"lon\": 116.72759949431683\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19765391602761,\n" +
|
||||
// "\t\t\"lon\": 116.72739776789756\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19768973009218,\n" +
|
||||
// "\t\t\"lon\": 116.72719980764646\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.197726191028785,\n" +
|
||||
// "\t\t\"lon\": 116.72699719861669\n" +
|
||||
// "\t}, {\n" +
|
||||
// "\t\t\"lat\": 40.19776233489642,\n" +
|
||||
// "\t\t\"lon\": 116.72679516155276\n" +
|
||||
// "\t}]}\n";
|
||||
//
|
||||
//
|
||||
// List<MessagePad.Location> list = new ArrayList<>();
|
||||
//
|
||||
// try {
|
||||
// JSONObject jsonObject = new JSONObject(listStr);
|
||||
// JSONArray jsonElements = jsonObject.getJSONArray("models");
|
||||
// for (int i = 0; i < jsonElements.length(); i++) {
|
||||
// JSONObject s = jsonElements.getJSONObject(i);
|
||||
// MessagePad.Location.Builder builder = MessagePad.Location.newBuilder();
|
||||
// builder.setLatitude(s.getDouble("lat"));
|
||||
// builder.setLongitude(s.getDouble("lon"));
|
||||
// list.add(builder.build());
|
||||
// }
|
||||
// TaxiModel.getInstance().updateOrderRoute(list);
|
||||
// TaxiModel.getInstance().updateOrderRouteInfo(list);
|
||||
// } catch (JSONException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
}
|
||||
|
||||
public void clickTestBar() {
|
||||
|
||||
@@ -123,6 +123,13 @@ public class MogoApplication extends MainMoGoApplication {
|
||||
} else if (DebugConfig.getProductFlavor().equals("fPadLenovoOchBusPassenger")) {
|
||||
//是否显示 红绿等
|
||||
HmiBuildConfig.isShowTrafficLightView = false;
|
||||
//是否显示 限速UI
|
||||
HmiBuildConfig.isShowLimitingVelocityView = false;
|
||||
//是否显示 路侧监控
|
||||
HmiBuildConfig.isShowCameraView = false;
|
||||
//白天模式
|
||||
FunctionBuildConfig.skinMode = 1;
|
||||
|
||||
}
|
||||
//och模块
|
||||
MogoModulePaths.addModuleFunction(new MogoModule("/och/api", "IMoGoFunctionProvider"));
|
||||
|
||||
@@ -57,5 +57,5 @@ dependencies {
|
||||
// api "com.zhidao.support.adas:high:1.2.1.2_bate21"
|
||||
implementation 'org.greenrobot:eventbus:3.2.0'
|
||||
implementation 'com.android.support:multidex:1.0.3'
|
||||
implementation 'com.mogo.cloud:telematic:1.3.52'
|
||||
implementation 'com.mogo.cloud:telematic:1.3.53-beta'
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.data.trafficlight.toTrafficLightDetail
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider
|
||||
import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider
|
||||
import com.mogo.eagle.core.function.autopilot.adapter.MoGoAdasListenerImpl
|
||||
@@ -21,17 +22,16 @@ import com.mogo.eagle.core.function.autopilot.adapter.MoGoAdasMsgConnectStatusLi
|
||||
import com.mogo.eagle.core.function.autopilot.adapter.MoGoHandAdasMsgManager
|
||||
import com.mogo.eagle.core.function.autopilot.server.AsyncDataToAutopilotServer
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
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.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.telematic.MogoProtocolMsg
|
||||
import com.mogo.telematic.MogoProtocolMsg.*
|
||||
import com.mogo.telematic.NSDNettyManager
|
||||
import com.mogo.telematic.client.listener.MessageStateListener
|
||||
import com.mogo.telematic.client.listener.NettyClientListener
|
||||
import com.mogo.telematic.client.status.ConnectState
|
||||
import com.mogo.telematic.server.netty.NettyServerListener
|
||||
@@ -44,6 +44,7 @@ import com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils
|
||||
import com.zhidao.support.adas.high.common.MogoReport
|
||||
import io.netty.channel.Channel
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
|
||||
@@ -54,7 +55,8 @@ import java.util.concurrent.TimeUnit
|
||||
*/
|
||||
@Route(path = MogoServicePaths.PATH_AUTO_PILOT)
|
||||
class MoGoAutopilotProvider :
|
||||
IMoGoAutopilotProvider, IMoGoMapDataCollectProvider.OnMapCollectCmdListener {
|
||||
IMoGoAutopilotProvider, IMoGoMapDataCollectProvider.OnMapCollectCmdListener,
|
||||
IMoGoAutopilotCarConfigListener {
|
||||
private val TAG = "MoGoAutoPilotProvider"
|
||||
private var mContext: Context? = null
|
||||
|
||||
@@ -178,6 +180,8 @@ class MoGoAutopilotProvider :
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "司机端Server未启动!")
|
||||
}
|
||||
}
|
||||
} else {// 乘客屏监听工控机基础信息回调
|
||||
CallerAutopilotCarConfigListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
CallerLogger.i("$M_ADAS_IMPL$TAG", "initServer……")
|
||||
@@ -451,8 +455,6 @@ class MoGoAutopilotProvider :
|
||||
}
|
||||
REQ_CAR_NUMBER -> {
|
||||
AppConfigInfo.plateNumber = String(msg.body)
|
||||
ToastUtils.showShort(AppConfigInfo.plateNumber)
|
||||
// TODO:("获取到车牌号")
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
@@ -467,6 +469,7 @@ class MoGoAutopilotProvider :
|
||||
when (statusCode) {
|
||||
ConnectState.STATUS_CONNECT_SUCCESS -> {
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "乘客端连接司机端服务成功! sign is:${sign}")
|
||||
// 连接成功后,乘客屏没拿到车牌号就像司机屏请求
|
||||
if (AppConfigInfo.plateNumber.isNullOrEmpty()) {
|
||||
var byteArray = byteArrayOf(0)
|
||||
NSDNettyManager.getInstance().sendMogoProtocolMsgToServer(
|
||||
@@ -485,4 +488,9 @@ class MoGoAutopilotProvider :
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
|
||||
// 乘客屏才监听
|
||||
AppConfigInfo.plateNumber = carConfigResp.plateNumber
|
||||
}
|
||||
}
|
||||
@@ -155,7 +155,7 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
|
||||
location.latitude,
|
||||
location.bearing,
|
||||
location.speed,
|
||||
location.provider == "GPS_SELF")
|
||||
location.provider == "GPS_RTK")
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,9 +2,11 @@ package com.mogo.eagle.core.function.obu.mogo
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuProvider
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
@@ -29,18 +31,27 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
|
||||
override fun init(context: Context) {
|
||||
CallerLogger.d("$M_OBU$TAG", "初始化蘑菇自研OBU……")
|
||||
mContext = context
|
||||
val ipAddress =
|
||||
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, "192.168.1.199")
|
||||
MogoPrivateObuManager.INSTANCE.init(context, ipAddress)
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
//不处理
|
||||
} else {
|
||||
mContext = context
|
||||
val ipAddress =
|
||||
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, "192.168.1.199")
|
||||
MogoPrivateObuManager.INSTANCE.init(context, ipAddress)
|
||||
}
|
||||
}
|
||||
|
||||
override fun connect(ipAddress: String) {
|
||||
mContext?.let {
|
||||
// 保存本地OBU IP地址
|
||||
SharedPrefsMgr.getInstance(it).putString(MoGoConfig.OBU_IP, ipAddress)
|
||||
MogoPrivateObuManager.INSTANCE.connectObu(it, ipAddress)
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
//不处理
|
||||
} else {
|
||||
mContext?.let {
|
||||
// 保存本地OBU IP地址
|
||||
SharedPrefsMgr.getInstance(it).putString(MoGoConfig.OBU_IP, ipAddress)
|
||||
MogoPrivateObuManager.INSTANCE.connectObu(it, ipAddress)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.v2x
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_V2X_MODULE
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallTrafficLightManager
|
||||
@@ -9,6 +10,7 @@ import com.mogo.eagle.core.function.v2x.events.V2XEventManager
|
||||
import com.mogo.eagle.core.function.v2x.redlightwarning.RedLightWarningManager
|
||||
import com.mogo.eagle.core.function.v2x.speedlimit.SpeedLimitDataManager
|
||||
import com.mogo.eagle.core.function.v2x.vip.VipCarManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
|
||||
@Route(path = PATH_V2X_MODULE)
|
||||
class V2XProvider : IMoGoFunctionServerProvider {
|
||||
@@ -20,14 +22,25 @@ class V2XProvider : IMoGoFunctionServerProvider {
|
||||
CallTrafficLightManager.getTrafficLightProvider().initTrafficLightServer(context)
|
||||
VipCarManager.INSTANCE.initServer(context)
|
||||
SpeedLimitDataManager.getInstance().start()
|
||||
V2XEventManager.init(context)
|
||||
SpeedLimitDataManager.getInstance().start();
|
||||
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
//不处理
|
||||
} else {
|
||||
V2XEventManager.init(context)
|
||||
}
|
||||
|
||||
// RedLightWarningManager.INSTANCE.listenTrafficLight()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
VipCarManager.INSTANCE.destroy()
|
||||
V2XEventManager.onDestroy()
|
||||
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
//不处理
|
||||
} else {
|
||||
V2XEventManager.onDestroy()
|
||||
}
|
||||
|
||||
// RedLightWarningManager.INSTANCE.onDestroy()
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,7 @@ object AppConfigInfo {
|
||||
var mogoSN: String? = null
|
||||
|
||||
//车牌号
|
||||
@Volatile
|
||||
var plateNumber: String? = null
|
||||
//工控机MAC地址
|
||||
var iPCMacAddress: String? = null
|
||||
|
||||
@@ -86,4 +86,15 @@ object FunctionBuildConfig {
|
||||
@Volatile
|
||||
@JvmField
|
||||
var isIgnoreConditionsDrawAutopilotTrajectoryData = false
|
||||
|
||||
/**
|
||||
* 皮肤模式
|
||||
* 0--默认夜间模式,
|
||||
* 1-白天模式,
|
||||
* 2-节日模式(待开发,加载节日图片包)
|
||||
*/
|
||||
@Volatile
|
||||
@JvmField
|
||||
var skinMode = 0
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.eagle.core.function.call.setting
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.setting.MoGoUiSettingProvider
|
||||
|
||||
/**
|
||||
@@ -8,8 +9,6 @@ import com.mogo.eagle.core.function.api.setting.MoGoUiSettingProvider
|
||||
* @author mogoauto
|
||||
*/
|
||||
object CallerMoGoUiSettingManager : MoGoUiSettingProvider {
|
||||
// 0--默认夜间模式,1-白天模式,2-节日模式(待开发,加载节日图片包)
|
||||
private var skinMode = 0
|
||||
|
||||
// 是否是VR模式,true-VR模式,false-2D模式
|
||||
var vrMode = true
|
||||
@@ -23,20 +22,20 @@ object CallerMoGoUiSettingManager : MoGoUiSettingProvider {
|
||||
}
|
||||
|
||||
override fun stepInDayMode() {
|
||||
skinMode = 1
|
||||
CallerSkinModeListenerManager.invokeListener(skinMode)
|
||||
FunctionBuildConfig.skinMode = 1
|
||||
CallerSkinModeListenerManager.invokeListener(FunctionBuildConfig.skinMode)
|
||||
}
|
||||
|
||||
override fun stepOutDayMode() {
|
||||
skinMode = 0
|
||||
CallerSkinModeListenerManager.invokeListener(skinMode)
|
||||
FunctionBuildConfig.skinMode = 0
|
||||
CallerSkinModeListenerManager.invokeListener(FunctionBuildConfig.skinMode)
|
||||
}
|
||||
|
||||
/**
|
||||
* 0--默认夜间模式,1-白天模式,2-节日模式(待开发,加载节日图片包)
|
||||
*/
|
||||
override fun getDayMode(): Int {
|
||||
return skinMode
|
||||
return FunctionBuildConfig.skinMode
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ class Scene {
|
||||
val v2xMap = SceneLogCache(mutableMapOf(), false)
|
||||
sceneCache[M_V2X] = v2xMap
|
||||
//初始化map
|
||||
val map = SceneLogCache(mutableMapOf(), false)
|
||||
val map = SceneLogCache(mutableMapOf(), true)
|
||||
sceneCache[M_MAP] = map
|
||||
//初始化路径规划
|
||||
val routeMap = SceneLogCache(mutableMapOf(), true)
|
||||
|
||||
@@ -23,7 +23,7 @@ kotlin.parallel.tasks.in.project=true
|
||||
#优化kapt
|
||||
#并行运行kapt1.2.60版本以上支持
|
||||
kapt.use.worker.api=true
|
||||
#增量编译 kapt1.3.52版本以上支持
|
||||
#增量编译 kapt1.3.53版本以上支持
|
||||
kapt.incremental.apt=true
|
||||
#kapt avoiding 如果用kapt依赖的内容没有变化,会完全重用编译内容,省掉app:kaptGenerateStubsDebugKotlin的时间
|
||||
kapt.include.compile.classpath=false
|
||||
@@ -63,26 +63,26 @@ SERVICE_CHAIN_VERSION=1.1.0
|
||||
LOGLIB_VERSION=1.2.30
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 网络请求LOGLIB_VERSION
|
||||
MOGO_NETWORK_VERSION=1.3.52
|
||||
MOGO_NETWORK_VERSION=1.3.53
|
||||
# 鉴权
|
||||
MOGO_PASSPORT_VERSION=1.3.52
|
||||
MOGO_PASSPORT_VERSION=1.3.53
|
||||
# 常链接
|
||||
MOGO_SOCKET_VERSION=1.3.52
|
||||
MOGO_SOCKET_VERSION=1.3.53
|
||||
# 数据采集
|
||||
MOGO_REALTIME_VERSION=1.3.52
|
||||
MOGO_REALTIME_VERSION=1.3.53
|
||||
# 探路,道路事件发布,获取
|
||||
MOGO_TANLU_VERSION=1.3.52
|
||||
MOGO_TANLU_VERSION=1.3.53
|
||||
# 直播推流
|
||||
MOGO_LIVE_VERSION=1.3.52
|
||||
MOGO_LIVE_VERSION=1.3.53
|
||||
# 直播拉流
|
||||
MOGO_TRAFFICLIVE_VERSION=1.3.52
|
||||
MOGO_TRAFFICLIVE_VERSION=1.3.53
|
||||
# 定位服务
|
||||
MOGO_LOCATION_VERSION=1.3.52
|
||||
MOGO_LOCATION_VERSION=1.3.53
|
||||
# 远程通讯模块
|
||||
MOGO_TELEMATIC_VERSION=1.3.52
|
||||
MOGO_TELEMATIC_VERSION=1.3.53
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 自研地图
|
||||
MAP_SDK_VERSION=2.1.0.3
|
||||
MAP_SDK_VERSION=2.1.0.5
|
||||
MAP_SDK_OPERATION_VERSION=1.0.12
|
||||
# websocket
|
||||
WEBSOCKET_VERSION=1.1.7
|
||||
@@ -155,5 +155,5 @@ MOGO_OCH_TAXI_VERSION=2.0.66
|
||||
# mogoAiCloud sdk services
|
||||
MOGO_AICLOUD_SERVICES_SDK_VERSION=2.1.16.10
|
||||
# v2x-sdk
|
||||
MOGO_V2X_SDK_VERSION=1.3.52
|
||||
MOGO_V2X_SDK_VERSION=1.3.53
|
||||
################# 旧版本架构模块版本 #################
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_MAP;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_300;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_CROSS;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_TOP;
|
||||
@@ -107,16 +108,12 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
private EnumMapUI mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT_VR;
|
||||
private VisualAngleMode mVisualAngleMode = MODE_MEDIUM_SIGHT;
|
||||
|
||||
private float mDefaultZoomLevel = 16.0f;
|
||||
private boolean mIsLightStyle = false;
|
||||
private boolean mMapLoaded = false;
|
||||
private boolean mIsFirstLocated = true;
|
||||
private boolean mIsDelayed = false;
|
||||
|
||||
private volatile String mRoadId = null;
|
||||
|
||||
public AMapViewWrapper(MapAutoView mMapView) {
|
||||
CallerLogger.INSTANCE.i(TAG, "autoop--AMapViewWrapper: init");
|
||||
CallerLogger.INSTANCE.i(M_MAP+TAG, "autoop--AMapViewWrapper: init");
|
||||
this.mMapView = mMapView;
|
||||
initViews();
|
||||
initListeners();
|
||||
@@ -124,6 +121,28 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
// 初始化首次地图进入的时候的样式, MapAutoApi.INSTANCE.init(context, mapParams);将影响这里的数据
|
||||
int mapStyle = MapAutoApi.INSTANCE.getMapParams().getStyleMode();
|
||||
switch (mapStyle) {
|
||||
case MapAutoApi.MAP_STYLE_DAY:
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_DAY;
|
||||
break;
|
||||
case MapAutoApi.MAP_STYLE_DAY_VR:
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_DAY_VR;
|
||||
break;
|
||||
case MapAutoApi.MAP_STYLE_DAY_NAV:
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_DAY_NAV;
|
||||
break;
|
||||
case MapAutoApi.MAP_STYLE_NIGHT:
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT;
|
||||
break;
|
||||
case MapAutoApi.MAP_STYLE_NIGHT_VR:
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT_VR;
|
||||
break;
|
||||
case MapAutoApi.MAP_STYLE_NIGHT_NAV:
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT_NAV;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -158,17 +177,17 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
mMapView.setOnMapStyleListener(this);
|
||||
mMapView.setOnMapViewVisualAngleChangeListener(this);
|
||||
mMapView.setOnRoadInfoListener(this, 1);
|
||||
CallerLogger.INSTANCE.d(TAG, "styleop - initListeners - setOnMapStyleListener - view " + mMapView);
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "styleop - initListeners - setOnMapStyleListener - view " + mMapView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRoadIdInfo(@androidx.annotation.Nullable String roadId) {
|
||||
|
||||
if (roadId != null && !TextUtils.isEmpty(roadId)) {
|
||||
CallerLogger.INSTANCE.d(TAG, "onRoadIdInfo::" + roadId);
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "onRoadIdInfo::" + roadId);
|
||||
CallerMapRoadListenerManager.INSTANCE.invokeListenersOnRoadIdGet(roadId);
|
||||
} else {
|
||||
CallerLogger.INSTANCE.d(TAG, "onRoadIdInfo::null");
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "onRoadIdInfo::null");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,27 +205,27 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
* }
|
||||
*/
|
||||
String provider = carLoc.getProvider();
|
||||
CallerLogger.INSTANCE.d(TAG, "car_loc: " + carLoc + "");
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "car_loc: " + carLoc + "");
|
||||
if (!MapAutoApi.GPS_FLAG.equals(provider)) {
|
||||
CallerLogger.INSTANCE.d(TAG, "convert before: car_loc: {lon: " + carLoc.getLongitude() + ", lat: " + carLoc.getLatitude() + "}");
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "convert before: car_loc: {lon: " + carLoc.getLongitude() + ", lat: " + carLoc.getLatitude() + "}");
|
||||
LonLatPoint p = new LonLatPoint(carLoc.getLongitude(), carLoc.getLatitude());
|
||||
p = MapTools.INSTANCE.switchLonLatWGS84(p);
|
||||
carLoc.setLongitude(p.longitude);
|
||||
carLoc.setLatitude(p.latitude);
|
||||
CallerLogger.INSTANCE.d(TAG, "convert after: car_loc: {lon: " + carLoc.getLongitude() + ", lat: " + carLoc.getLatitude() + "}");
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "convert after: car_loc: {lon: " + carLoc.getLongitude() + ", lat: " + carLoc.getLatitude() + "}");
|
||||
}
|
||||
CallerLogger.INSTANCE.d(TAG, "onStopLineInfo:stop_line" + stopLine + ", car_loc:{lon: " + carLoc.getLatitude() + ", lat: " + carLoc.getLongitude() + "}");
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "onStopLineInfo:stop_line" + stopLine + ", car_loc:{lon: " + carLoc.getLatitude() + ", lat: " + carLoc.getLongitude() + "}");
|
||||
MapRoadInfo.StopLine stopInfo = convert(stopLine);
|
||||
LonLatPoint p1 = points.get(0);
|
||||
LonLatPoint p2 = points.get(points.size() - 1);
|
||||
double distanceOfCarToStopLine = MapDataApi.INSTANCE.getNearstFromPointToSegment(carLoc.getLongitude(), carLoc.getLatitude(), p1.longitude, p1.latitude, p2.longitude, p2.latitude) * 10_0000;
|
||||
stopInfo.setDistanceOfCarToStopLine(distanceOfCarToStopLine);
|
||||
CallerLogger.INSTANCE.d(TAG, "onStopLineInfo: --- distance: " + distanceOfCarToStopLine);
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "onStopLineInfo: --- distance: " + distanceOfCarToStopLine);
|
||||
CallerMapRoadListenerManager.INSTANCE.invokeListenersOnStopLineGet(stopInfo);
|
||||
}
|
||||
} else {
|
||||
if (carLoc != null) {
|
||||
CallerLogger.INSTANCE.d(TAG, "onStopLineInfo::null, car_loc:{lon: " + carLoc.getLatitude() + ", lat: " + carLoc.getLongitude() + "}");
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "onStopLineInfo::null, car_loc:{lon: " + carLoc.getLatitude() + ", lat: " + carLoc.getLongitude() + "}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -254,7 +273,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public void onCreate(Bundle bundle) {
|
||||
if (mMapView != null) {
|
||||
mMapView.onCreate(bundle);
|
||||
CallerLogger.INSTANCE.d(TAG, "map onCreate");
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "map onCreate");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -262,7 +281,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public void onResume() {
|
||||
if (mMapView != null) {
|
||||
mMapView.onResume();
|
||||
CallerLogger.INSTANCE.d(TAG, "map onResume");
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "map onResume");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -270,7 +289,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public void onPause() {
|
||||
if (mMapView != null) {
|
||||
mMapView.onPause();
|
||||
CallerLogger.INSTANCE.d(TAG, "map onPause");
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "map onPause");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,7 +303,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
mMapView.setOnMapClickListener(null);
|
||||
mMapView.getLocationClient().unRegisterListener(this);
|
||||
mMapView.setOnCameraChangeListener(null);
|
||||
CallerLogger.INSTANCE.d(TAG, "map onDestroy");
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "map onDestroy");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,7 +311,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
if (mMapView != null) {
|
||||
mMapView.onSaveInstanceState(outState);
|
||||
CallerLogger.INSTANCE.d(TAG, "map onSaveInstanceState");
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "map onSaveInstanceState");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,9 +325,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (isVrMold()) {
|
||||
return MapControlResult.ERROR;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(TAG, "changeZoom : " + zoom);
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "changeZoom : " + zoom);
|
||||
if (DebugConfig.isDebug()) {
|
||||
CallerLogger.INSTANCE.d(TAG, Log.getStackTraceString(new Throwable()));
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, Log.getStackTraceString(new Throwable()));
|
||||
}
|
||||
getMap().changeZoom(zoom);
|
||||
return MapControlResult.SUCCESS;
|
||||
@@ -322,7 +341,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
mVisualAngleMode = angelMode;
|
||||
if (angelMode == MODE_CLOSE_SIGHT) {
|
||||
if (mogoLatLng == null) {
|
||||
CallerLogger.INSTANCE.e(TAG, "切换地图近景需要传入要移动的经纬度数据");
|
||||
CallerLogger.INSTANCE.e(M_MAP+TAG, "切换地图近景需要传入要移动的经纬度数据");
|
||||
return;
|
||||
}
|
||||
// 近景传入经纬度为点击地图上静态marker经纬度数据,为GPS坐标点。
|
||||
@@ -345,7 +364,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
private boolean checkAMapView() {
|
||||
if (mMapView == null || mMapView.getMapAutoViewHelper() == null) {
|
||||
CallerLogger.INSTANCE.e(TAG, "自研mapView实例为空,请检查");
|
||||
CallerLogger.INSTANCE.e(M_MAP+TAG, "自研mapView实例为空,请检查");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -353,20 +372,20 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void moveToCenter(MogoLatLng latLng, boolean animate) {
|
||||
CallerLogger.INSTANCE.d(TAG, "move to center " + latLng);
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "move to center " + latLng);
|
||||
if (latLng == null || latLng.lat == 0.0d || latLng.lon == 0.0d) {
|
||||
CallerLogger.INSTANCE.e(TAG, "latlng = null or is illegal");
|
||||
CallerLogger.INSTANCE.e(M_MAP+TAG, "latlng = null or is illegal");
|
||||
return;
|
||||
}
|
||||
if (DebugConfig.isDebug()) {
|
||||
CallerLogger.INSTANCE.d(TAG, Log.getStackTraceString(new Throwable()));
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, Log.getStackTraceString(new Throwable()));
|
||||
}
|
||||
mMapView.getMapAutoViewHelper().animateCamera(new LonLatPoint(latLng.lon, latLng.lat));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation(boolean visible) {
|
||||
CallerLogger.INSTANCE.d(TAG, "showMyLocation1 " + visible);
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "showMyLocation1 " + visible);
|
||||
// 如果是VR模式
|
||||
if (isVrMold()) {
|
||||
return;
|
||||
@@ -388,7 +407,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
* @return true-是,false=不是
|
||||
*/
|
||||
private boolean isVrMold() {
|
||||
return mCurrentUI == EnumMapUI.MAP_STYLE_NIGHT_VR || mCurrentUI == EnumMapUI.MAP_STYLE_DAY_VR;
|
||||
boolean isVrMode = mCurrentUI == EnumMapUI.MAP_STYLE_NIGHT_VR || mCurrentUI == EnumMapUI.MAP_STYLE_DAY_VR;
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "是否是VR模式: " + isVrMode);
|
||||
return isVrMode;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -396,16 +417,18 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
*
|
||||
* @return true-是,false-不是
|
||||
*/
|
||||
private boolean isDayMold() {
|
||||
return mCurrentUI == EnumMapUI.MAP_STYLE_DAY_VR
|
||||
private boolean isDayMode() {
|
||||
boolean isDayMode = mCurrentUI == EnumMapUI.MAP_STYLE_DAY_VR
|
||||
|| mCurrentUI == EnumMapUI.MAP_STYLE_DAY
|
||||
|| mCurrentUI == EnumMapUI.MAP_STYLE_DAY_NAV;
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "是否是白天模式: " + isDayMode);
|
||||
return isDayMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation(View view) {
|
||||
if (DebugConfig.isDebug()) {
|
||||
CallerLogger.INSTANCE.d(TAG, Log.getStackTraceString(new Throwable()));
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, Log.getStackTraceString(new Throwable()));
|
||||
}
|
||||
if (checkAMapView()) {
|
||||
MyLocationStyle style = mMapView.getMapAutoViewHelper().getMyLocationStyle();
|
||||
@@ -474,7 +497,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (isVrMold()) {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(TAG, "setPointToCenter x : " + mapCenterX + " y : " + mapCenterY);
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "setPointToCenter x : " + mapCenterX + " y : " + mapCenterY);
|
||||
mMapView.getMapAutoViewHelper().setPointToCenter((float) mapCenterX, (float) mapCenterY);
|
||||
}
|
||||
}
|
||||
@@ -511,7 +534,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (checkAMapView()) {
|
||||
if (mMapView.getMapAutoViewHelper() != null) {
|
||||
mMapView.getMapAutoViewHelper().setRenderFps(fps);
|
||||
CallerLogger.INSTANCE.d(TAG, "设置刷新帧率 fps = " + fps);
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "设置刷新帧率 fps = " + fps);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -522,16 +545,16 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
return;
|
||||
}
|
||||
if (isVrMold()) {
|
||||
CallerLogger.INSTANCE.w(TAG, "vr 模式下忽略该设置");
|
||||
CallerLogger.INSTANCE.w(M_MAP+TAG, "vr 模式下忽略该设置");
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.i(TAG, "showBounds : " + tag + " , " + carPosition.toString() + " , " + bound.toShortString() + " , " + lockCarPosition);
|
||||
CallerLogger.INSTANCE.i(M_MAP+TAG, "showBounds : " + M_MAP+TAG + " , " + carPosition.toString() + " , " + bound.toShortString() + " , " + lockCarPosition);
|
||||
try {
|
||||
LatLngBounds latLngBounds = MogoMapUtils.getLatLngBounds(carPosition, lonLats, lockCarPosition);
|
||||
mMapView.getMapAutoViewHelper().setCenter(ObjectUtils.fromMogo(carPosition));
|
||||
mMapView.getMapAutoViewHelper().moveCamera(CameraUpdateFactory.INSTANCE.newLatLngBounds(latLngBounds, bound.left, bound.right, bound.top, bound.bottom));
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(TAG, "tag : " + tag + " error : " + e);
|
||||
CallerLogger.INSTANCE.e(M_MAP+TAG, "M_MAP+TAG : " + M_MAP+TAG + " error : " + e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -674,14 +697,14 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (!mIsDelayed) {
|
||||
mIsDelayed = true;
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
//CallerLogger.INSTANCE.d(TAG, "倒计时结束");
|
||||
//CallerLogger.INSTANCE.d(M_MAP+TAG, "倒计时结束");
|
||||
mIsFirstLocated = false;
|
||||
}, 5_000L);
|
||||
}
|
||||
} else {
|
||||
mIsFirstLocated = true;
|
||||
mIsDelayed = false;
|
||||
CallerLogger.INSTANCE.d(TAG, "同步定位:" + GsonUtils.toJson(location));
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "同步定位:" + GsonUtils.toJson(location));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -694,13 +717,13 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void onMapInit() {
|
||||
CallerLogger.INSTANCE.i(TAG, "autoop--onMapInit: ");
|
||||
CallerLogger.INSTANCE.i(M_MAP+TAG, "autoop--onMapInit: ");
|
||||
MogoMapListenerHandler.getInstance().onMapLoaded();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
CallerLogger.INSTANCE.i(TAG, "autoop--onMapLoaded: ");
|
||||
CallerLogger.INSTANCE.i(M_MAP+TAG, "autoop--onMapLoaded: ");
|
||||
mMapLoaded = true;
|
||||
CameraPosition cameraPosition = mMapView.getMapAutoViewHelper().getCameraPosition();
|
||||
Trace.beginSection("timer.onCameraChangeFinish");
|
||||
@@ -727,18 +750,18 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void onRoadLoaded(@Nullable String s) {
|
||||
CallerLogger.INSTANCE.i(TAG, "autoop--onMapLoaded: ");
|
||||
CallerLogger.INSTANCE.i(M_MAP+TAG, "autoop--onMapLoaded: ");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapStatusChanged(int type, int value) {
|
||||
//CallerLogger.INSTANCE.i(TAG, "mapop--onMapStatusChanged-: " + type + "," + value);
|
||||
//CallerLogger.INSTANCE.i(M_MAP+TAG, "mapop--onMapStatusChanged-: " + type + "," + value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapViewVisualAngleChange(int i) {
|
||||
CallerLogger.INSTANCE.d(TAG, " 地图自动更改视距 currentThread : " + Thread.currentThread().getName());
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, " 地图自动更改视距 currentThread : " + Thread.currentThread().getName());
|
||||
mVisualAngleMode = getVisualAngleMode(i);
|
||||
MogoMapListenerHandler.getInstance().onMapVisualAngleChanged(mVisualAngleMode);
|
||||
}
|
||||
@@ -770,12 +793,12 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void onCameraChange(int type, int value) {
|
||||
//CallerLogger.INSTANCE.i(TAG, "mapop--onCameraChange-: " + type + "," + value);
|
||||
//CallerLogger.INSTANCE.i(M_MAP+TAG, "mapop--onCameraChange-: " + type + "," + value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCameraChangeFinish(@Nullable CameraPosition cameraPosition) {
|
||||
// CallerLogger.INSTANCE.i( TAG, "mapop--onCameraChangeFinish-: " + cameraPosition + "cost:" + ( System.currentTimeMillis() - startTime ) );
|
||||
// CallerLogger.INSTANCE.i( M_MAP+TAG, "mapop--onCameraChangeFinish-: " + cameraPosition + "cost:" + ( System.currentTimeMillis() - startTime ) );
|
||||
if (cameraPosition != null) {
|
||||
Trace.beginSection("timer.onCameraChangeFinish");
|
||||
MogoMapListenerHandler.getInstance().onMapChanged(ObjectUtils.fromAMap(cameraPosition.getTarget()),
|
||||
@@ -788,8 +811,8 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void onChangeMapStyle(int styleId) {
|
||||
CallerLogger.INSTANCE.d(TAG, "currentMapStyle = " + styleId);
|
||||
CallerLogger.INSTANCE.d(TAG, Log.getStackTraceString(new Throwable()));
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "currentMapStyle = " + styleId);
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, Log.getStackTraceString(new Throwable()));
|
||||
|
||||
// 映射地图样式ID到鹰眼样式ID
|
||||
if (styleId == MapAutoApi.MAP_STYLE_DAY
|
||||
@@ -810,7 +833,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (mCurrentUI != null) {
|
||||
UiThreadHandler.post(() -> {
|
||||
try {
|
||||
CallerLogger.INSTANCE.d(TAG, "currentUI = " + mCurrentUI);
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "currentUI = " + mCurrentUI);
|
||||
MogoMapListenerHandler.getInstance().onMapModeChanged(mCurrentUI);
|
||||
CallerMapStyleListenerManager.INSTANCE.invokeMapStyleChange(styleId);
|
||||
} catch (Exception e) {
|
||||
@@ -830,7 +853,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
TipToast.shortTip(mRtkEnable ? "已开启rtk道路匹配" : "已开启gps道路匹配");
|
||||
mMapView.getLocationClient().rtkEnable(mRtkEnable);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(TAG, "rtkEnable has exception : " + e);
|
||||
CallerLogger.INSTANCE.e(M_MAP+TAG, "rtkEnable has exception : " + e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -840,7 +863,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
return;
|
||||
}
|
||||
if (data == null) {
|
||||
CallerLogger.INSTANCE.d(TAG, "停止使用rtk定位数据");
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "停止使用rtk定位数据");
|
||||
return;
|
||||
}
|
||||
double lon = data.optDouble("lon", -1);
|
||||
@@ -934,8 +957,11 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 加载3D模型
|
||||
*/
|
||||
private void loadPreVehicleModel() {
|
||||
CallerLogger.INSTANCE.d(TAG, "添加感知模型到地图中……");
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "添加感知模型到地图中……");
|
||||
addPreVehicleModelWeiZhi(TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI, "添加感知模型到地图中……preVehicleStrWeiZhi=");
|
||||
|
||||
addPreVehicleModelWeiZhi(TrafficTypeEnum.TYPE_TRAFFIC_ID_PEOPLE, "添加感知模型到地图中……preVehicleStrPeople=");
|
||||
@@ -960,7 +986,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
private void addPreVehicleModelWeiZhi(TrafficTypeEnum typeTrafficId, String logMsg) {
|
||||
String preVehicleStrWeiZhi;
|
||||
// 根据当前的地图皮肤模式动态替换
|
||||
if (isDayMold()) {
|
||||
if (isDayMode()) {
|
||||
preVehicleStrWeiZhi =
|
||||
// 添加模型到地图中
|
||||
MogoMarkerManager.getInstance(getContext())
|
||||
@@ -972,11 +998,11 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
.addPreVehicleModel(typeTrafficId.getType(), typeTrafficId.getTraffic3DNightIconId());
|
||||
}
|
||||
|
||||
CallerLogger.INSTANCE.d(TAG, logMsg + preVehicleStrWeiZhi);
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, logMsg + preVehicleStrWeiZhi);
|
||||
|
||||
if (preVehicleStrWeiZhi == null) {
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
CallerLogger.INSTANCE.w(TAG, "添加感知模型到地图中失败,尝试重复添加……");
|
||||
CallerLogger.INSTANCE.w(M_MAP+TAG, "添加感知模型到地图中失败,尝试重复添加……");
|
||||
addPreVehicleModelWeiZhi(typeTrafficId, logMsg);
|
||||
}, 1000L);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.location.ALocationClient;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
@@ -64,8 +65,8 @@ public class CustomMapApiBuilder implements IMogoMapApiBuilder {
|
||||
// .setPointToCenter( 0.734375f, 0.5f )
|
||||
//todo 2D模式下需要注意ADAS部分遮挡
|
||||
//.setPointToCenter(0.5f, 0.5f)
|
||||
// 默认地图样式
|
||||
.setStyleMode(MapParams.MAP_STYLE_NIGHT_VR);
|
||||
// 根据 FunctionBuildConfig 配置的皮肤样式设置题图的样式
|
||||
.setStyleMode(FunctionBuildConfig.skinMode == 0 ? MapParams.MAP_STYLE_NIGHT_VR : MapParams.MAP_STYLE_DAY_VR);
|
||||
|
||||
MapAutoApi.INSTANCE.init(context, mapParams);
|
||||
MapAutoView mapAutoView = new MapAutoView(context);
|
||||
|
||||
@@ -157,7 +157,19 @@ public class ObjectUtils {
|
||||
return null;
|
||||
}
|
||||
MogoLocation location = new MogoLocation();
|
||||
location.setLocType(1); // 定位类型
|
||||
|
||||
//agps 高德
|
||||
//agps_rtk 高德-高精
|
||||
if (aLocation.getProvider().isEmpty()) {
|
||||
location.setLocType(0);
|
||||
}
|
||||
if ("AGPS".equals(aLocation.getProvider())) {
|
||||
location.setLocType(1); // 定位类型为高德坐标(网路或者硬件定位)
|
||||
} else if ("AGPS_RTK".equals(aLocation.getProvider())) {
|
||||
location.setLocType(1000); // 定位类型为WGS84进行转译的坐标
|
||||
} else {
|
||||
location.setLocType(0);
|
||||
}
|
||||
location.setSatellite(4);
|
||||
location.setSpeed(aLocation.getSpeed());
|
||||
location.setLatitude(aLocation.getLat());
|
||||
|
||||