diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/WeltMapOverView.kt b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/WeltMapOverView.kt index 22e0e73042..6552a1ff1a 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/WeltMapOverView.kt +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/WeltMapOverView.kt @@ -36,6 +36,8 @@ class WeltMapOverView : ConstraintLayout, IMoGoChassisLocationGCJ02Listener { private var mRoutePolylines: Polyline?=null // private val mLineMarkers: MutableList = mutableListOf() private var mEndStationMarker: Marker? = null + private var mogoDistanceLocationMax: LatLng?=null + private var aPointDistanceMax = 0.0F private var mFirst: Boolean = false //清扫车任务地图 @@ -129,11 +131,11 @@ class WeltMapOverView : ConstraintLayout, IMoGoChassisLocationGCJ02Listener { colorList.add(ContextCompat.getColor(context,R.color.sweeper_236299)) } else if (weltDataBean.weltDistance < 0) { colorList.add(ContextCompat.getColor(context,R.color.sweeper_c22101)) - } else if (weltDataBean.weltDistance >= 0 && weltDataBean.weltDistance < 0.01) { + } else if (weltDataBean.weltDistance >= 0 && weltDataBean.weltDistance < 0.1) { colorList.add(ContextCompat.getColor(context,R.color.sweeper_4dffa4)) - } else if (weltDataBean.weltDistance >= 0.010 && weltDataBean.weltDistance < 0.020) { + } else if (weltDataBean.weltDistance >= 0.1 && weltDataBean.weltDistance < 0.2) { colorList.add(ContextCompat.getColor(context,R.color.sweeper_ffdd4d)) - } else if (weltDataBean.weltDistance >= 0.020) { + } else if (weltDataBean.weltDistance >= 0.2) { colorList.add(ContextCompat.getColor(context,R.color.sweeper_ff912b)) } } @@ -153,9 +155,27 @@ class WeltMapOverView : ConstraintLayout, IMoGoChassisLocationGCJ02Listener { if (mTaskCoordinatesLatLng.size > 0) { //存放经纬度 for (i in mTaskCoordinatesLatLng.indices) { - boundsBuilder.include(mTaskCoordinatesLatLng[i]) + val latLng = mTaskCoordinatesLatLng[i] + boundsBuilder.include(latLng) + try { + val calculateLineDistance = CoordinateUtils.calculateLineDistance( + latLng.longitude, + latLng.latitude, + currentLatLng.latitude, + currentLatLng.longitude + ) + if(calculateLineDistance>aPointDistanceMax){ + aPointDistanceMax = calculateLineDistance + mogoDistanceLocationMax = currentLatLng + } + }catch (e:Exception){ + CallerLogger.e(TAG,e.stackTrace) + } } } + mogoDistanceLocationMax?.let { + boundsBuilder.include(it) + } boundsBuilder.include(currentLatLng) mAMap?.moveCamera(CameraUpdateFactory.newLatLngBoundsRect(boundsBuilder.build(), 100, 100, 100, 100)) diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/WeltSmallMapView.kt b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/WeltSmallMapView.kt index bf9b0a4309..b69e669558 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/WeltSmallMapView.kt +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/WeltSmallMapView.kt @@ -185,11 +185,11 @@ class WeltSmallMapView : ConstraintLayout, IMoGoChassisLocationGCJ02Listener { colorList.add(ContextCompat.getColor(context,R.color.sweeper_236299)) } else if (weltDataBean.weltDistance < 0) { colorList.add(ContextCompat.getColor(context,R.color.sweeper_c22101)) - } else if (weltDataBean.weltDistance >= 0 && weltDataBean.weltDistance < 0.010) { + } else if (weltDataBean.weltDistance >= 0 && weltDataBean.weltDistance < 0.1) { colorList.add(ContextCompat.getColor(context,R.color.sweeper_4dffa4)) - } else if (weltDataBean.weltDistance >= 0.010 && weltDataBean.weltDistance < 0.020) { + } else if (weltDataBean.weltDistance >= 0.1 && weltDataBean.weltDistance < 0.2) { colorList.add(ContextCompat.getColor(context,R.color.sweeper_ffdd4d)) - } else if (weltDataBean.weltDistance >= 0.020) { + } else if (weltDataBean.weltDistance >= 0.2) { colorList.add(ContextCompat.getColor(context,R.color.sweeper_ff912b)) } } @@ -291,7 +291,9 @@ class WeltSmallMapView : ConstraintLayout, IMoGoChassisLocationGCJ02Listener { for (i in routeList.indices) { routeCoordinatesLatLngs.add(LatLng(routeList[i].latitude, routeList[i].longitude)) } - drawRouteListPolyline(routeCoordinatesLatLngs) + ThreadUtils.runOnUiThread { + drawRouteListPolyline(routeCoordinatesLatLngs) + } } private fun drawRouteListPolyline(routeList: MutableList) { diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerServingOrderFragment.java b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerServingOrderFragment.java index 0ddf08b2b7..b51e6b82aa 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerServingOrderFragment.java +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerServingOrderFragment.java @@ -367,19 +367,19 @@ public class TaxiPassengerServingOrderFragment extends private void updateSpeedView(float newSpeed) { int speed = (int) (Math.abs(newSpeed) * 3.6F); // 倒车时工控机反馈定位信息中speed为负值 CallerLogger.INSTANCE.d(M_TAXI_P + TAG,"mLimitingVelocity = "+mLimitingVelocity); - if (mLimitingVelocity > 0 && speed >= mLimitingVelocity) { - mTPSpeedTv.setmColorList(new int[]{getResources().getColor(R.color.taxi_p_speed_warn_color1),getResources().getColor(R.color.taxi_p_speed_warn_color2)}); - mTPSpeedTv.setText(String.valueOf(speed)); - mTPSpeedTvShadowBg.setText(String.valueOf(speed)); - - mSpeedLayoutBg.setImageResource(R.drawable.taxi_p_speed_light_red_bg); - } else { +// if (mLimitingVelocity > 0 && speed >= mLimitingVelocity) { +// mTPSpeedTv.setmColorList(new int[]{getResources().getColor(R.color.taxi_p_speed_warn_color1),getResources().getColor(R.color.taxi_p_speed_warn_color2)}); +// mTPSpeedTv.setText(String.valueOf(speed)); +// mTPSpeedTvShadowBg.setText(String.valueOf(speed)); +// +// mSpeedLayoutBg.setImageResource(R.drawable.taxi_p_speed_light_red_bg); +// } else { mTPSpeedTv.setmColorList(new int[]{getResources().getColor(R.color.taxi_p_speed_normal_color1),getResources().getColor(R.color.taxi_p_speed_normal_color2)}); mTPSpeedTv.setText(String.valueOf(speed)); mTPSpeedTvShadowBg.setText(String.valueOf(speed)); mSpeedLayoutBg.setImageResource(R.drawable.taxi_p_speed_light_green_bg); - } +// } } private void runOnUIThread(Runnable executor) {