[pnc-计算站点间距离提前]
This commit is contained in:
yangyakun
2023-07-21 19:17:01 +08:00
parent 5fdd56c7e0
commit d654e49679
4 changed files with 21 additions and 19 deletions

View File

@@ -278,6 +278,22 @@ object TrajectoryAndDistanceManager: IMoGoPlanningRottingListener{
writeLog(calculateData, locationInfo)
}
try {
if (endStationInfo.stationPoint != null
&& endStationInfo.isNext!= null
&& endStationInfo.index != null
&& endStationInfo.distance != null
&& startStationInfo.stationPoint != null
&& startStationInfo.isNext != null
&& startStationInfo.index != null
&& startStationInfo.distance != null
) {
calculateStationDistance()
}
}catch (e:Exception){
e(M_OCHCOMMON+ TAG,"计算两个站点间的距离")
}
val carLocationInfo:Triple<Int,Boolean?,Float>
if(endStationInfo.isNext==true){
// 计算车的位置在轨迹中的信息 这个是一个变量可以缓存
@@ -312,22 +328,6 @@ object TrajectoryAndDistanceManager: IMoGoPlanningRottingListener{
preCarLocationIndexInTrajectory = carLocationInfo.first
try {
if (endStationInfo.stationPoint != null
&& endStationInfo.isNext!= null
&& endStationInfo.index != null
&& endStationInfo.distance != null
&& startStationInfo.stationPoint != null
&& startStationInfo.isNext != null
&& startStationInfo.index != null
&& startStationInfo.distance != null
) {
calculateStationDistance()
}
}catch (e:Exception){
e(M_OCHCOMMON+ TAG,"计算两个站点间的距离")
}
// 距离回调
try {
if(distanceListeners.size>0) {

View File

@@ -260,8 +260,7 @@ object TaxiPassengerModel {
override fun onSuccess(data: TaxiPassengerOrderQueryRemainingResp) {
if (data.data != null) {
e(M_TAXI_P + TAG, "distance = " + data.data.distance + " ,duration = " + data.data.duration)
val stationDistance = SharedPrefsMgr.getInstance(mContext!!)
.getInt(TaxiPassengerConst.SP_KEY_ORDER_SUM_DIS, 0)
val stationDistance = SharedPrefsMgr.getInstance(mContext!!).getInt(TaxiPassengerConst.SP_KEY_ORDER_SUM_DIS, 0)
for (callback in mOrderStatusCallbackMap.values) {
callback.onCurrentOrderDistToEndChanged(data.data.distance, data.data.duration,stationDistance)
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

View File

@@ -33,7 +33,10 @@
android:id="@+id/pcnActionView"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_100"
android:layout_marginBottom="@dimen/dp_110"
android:layout_marginBottom="@dimen/dp_255"
app:pnc_size="@dimen/dp_44"
app:pnc_top_margin="@dimen/dp_20"
app:background_resource="@drawable/taxi_p_pnc_bg"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />