(R.id.test_bar_current_stop_md5_dpqp)
- }
- if (testBar!!.visibility == View.VISIBLE) {
- testBar!!.visibility = View.GONE
- } else {
- val result = TaxiModel.getCurTaskAndOrder()
- val order = result?.order
- testCurOrderId!!.text = "orderNo: " + order?.orderNo
- testCurLineId!!.text = "当前任务lineId: " + result?.lineId
- taskType2.text = "当前任务类型: " + result?.taskType
- taskStatus2.text = "任务状态: "+ result?.currentStatus
- taskStartSite.text = "任务开始站点: "+ result?.startSite?.siteName +
- ", siteId: " + result?.startSite?.siteId
- taskEndSite.text = "任务结束站点: "+ result?.endSite?.siteName +
- ", siteId: " + result?.endSite?.siteId
-
- orderInfo.text = "订单信息: 开始: " + order?.orderStartSite?.siteName + ", 结束: "+
- order?.orderEndSite?.siteName + ", orderStatus: "+ order?.orderStatus
-
- orderToStartLines.text = "接驾任务的lineId集合: " + GsonUtil.jsonFromObject(order?.planningLines)
-
- val curContrail = TaxiModel.getCurTaskContrail()
- testCurTrajMd5!!.text = "TMd5:" + curContrail?.csvFileMd5
- testCurStopMd5!!.text = "SMd5:" + curContrail?.txtFileMd5
- testCurTrajMd5DPQP!!.text =
- "TMd5DPQP:" + curContrail?.csvFileMd5DPQP
- testCurStopMd5DPQP!!.text =
- "SMd5DPQP:" + curContrail?.txtFileMd5DPQP
- testBar!!.visibility = View.VISIBLE
- }
- }
-
- companion object {
- const val TAG = "TaxiFragment"
- fun newInstance(): TaxiFragment {
- val args = Bundle()
- val fragment = TaxiFragment()
- fragment.arguments = args
- return fragment
- }
+ fun clickOrderDebugView() {
+ orderDebugView.updateData()
}
}
\ No newline at end of file
diff --git a/OCH/taxi/mogo-och-taxi-unmanned/src/main/java/com/mogo/och/taxi/presenter/TaxiPresenter.java b/OCH/taxi/mogo-och-taxi-unmanned/src/main/java/com/mogo/och/taxi/ui/base/TaxiPresenter.java
similarity index 82%
rename from OCH/taxi/mogo-och-taxi-unmanned/src/main/java/com/mogo/och/taxi/presenter/TaxiPresenter.java
rename to OCH/taxi/mogo-och-taxi-unmanned/src/main/java/com/mogo/och/taxi/ui/base/TaxiPresenter.java
index 8c69e52120..9affbd1801 100644
--- a/OCH/taxi/mogo-och-taxi-unmanned/src/main/java/com/mogo/och/taxi/presenter/TaxiPresenter.java
+++ b/OCH/taxi/mogo-och-taxi-unmanned/src/main/java/com/mogo/och/taxi/ui/base/TaxiPresenter.java
@@ -1,6 +1,4 @@
-package com.mogo.och.taxi.presenter;
-
-import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI;
+package com.mogo.och.taxi.ui.base;
import android.os.Looper;
@@ -11,7 +9,6 @@ import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
-import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.och.common.module.biz.bean.DriverStatusQueryRespBean;
import com.mogo.och.common.module.biz.callback.ILoginCallback;
@@ -19,17 +16,16 @@ import com.mogo.och.common.module.manager.OCHAdasAbilityManager;
import com.mogo.och.taxi.callback.ITaxiADASStatusCallback;
import com.mogo.och.taxi.callback.ITaxiControllerStatusCallback;
import com.mogo.och.taxi.callback.ITaxiOrderStatusCallback;
-import com.mogo.och.taxi.constant.TaxiUnmannedConst;
import com.mogo.och.taxi.constant.TaxiDriverRoleEnum;
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum;
+import com.mogo.och.taxi.constant.TaxiUnmannedConst;
import com.mogo.och.taxi.constant.TaxtServingStatusManager;
import com.mogo.och.taxi.model.TaxiModel;
-import com.mogo.och.taxi.ui.TaxiFragment;
/**
* @author congtaowang
* @since 2021/1/18
- *
+ *
* 描述
*/
public class TaxiPresenter extends Presenter implements ITaxiADASStatusCallback,
@@ -47,17 +43,10 @@ public class TaxiPresenter extends Presenter implements ITaxiADASS
}
@Override
- public void onCreate( @NonNull LifecycleOwner owner ) {
- super.onCreate( owner );
- CallerLogger.INSTANCE.d( M_TAXI + TAG, "网约车-出租车拿到订单" );
- }
-
- @Override
- public void onDestroy( @NonNull LifecycleOwner owner ) {
- super.onDestroy( owner );
-
+ public void onDestroy(@NonNull LifecycleOwner owner) {
releaseListeners();
TaxiModel.INSTANCE.release();
+ super.onDestroy(owner);
}
private void initListeners() {
@@ -74,12 +63,12 @@ public class TaxiPresenter extends Presenter implements ITaxiADASS
TaxiModel.INSTANCE.setMoGoAutopilotPlanningListener(null);
}
- private void runOnUIThread( Runnable executor ) {
- if ( executor == null ) {
+ private void runOnUIThread(Runnable executor) {
+ if (executor == null) {
return;
}
- if ( Looper.myLooper() != Looper.getMainLooper() ) {
- UiThreadHandler.post( executor );
+ if (Looper.myLooper() != Looper.getMainLooper()) {
+ UiThreadHandler.post(executor);
} else {
executor.run();
}
@@ -103,17 +92,16 @@ public class TaxiPresenter extends Presenter implements ITaxiADASS
}
//导航去订单目的地
- public void startNaviToEndStation(boolean isShow){
- TaxiModel.INSTANCE.startNaviToEndStation(isShow);
+ public void startNaviToEndStation(boolean isShow) {
+ TaxiModel.INSTANCE.startNaviToEndStation(isShow);
}
- public void reportToEndDisAndTime(long lastSumLength, long duration){//米/秒
+ public void reportToEndDisAndTime(long lastSumLength, long duration) {//米/秒
// TaxiModel.INSTANCE.reportOrderRemain(lastSumLength,duration);
}
@Override
public void onAutopilotArriveEnd() {
-
}
@Override
@@ -132,17 +120,16 @@ public class TaxiPresenter extends Presenter implements ITaxiADASS
@Override
public void onAutopilotRunning() {
- if (preAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
+ if (preAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
runOnUIThread(() -> mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING));
}
preAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING;
}
-
@Override
- public void onManMachineCoDriving() {
- runOnUIThread(() -> mView.onManMachineCoDriving(IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING));
+ public void onParallelDrivingStatus() {
+ runOnUIThread(() -> mView.onParallelDrivingStatus(IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING));
preAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING;
}
@@ -153,12 +140,12 @@ public class TaxiPresenter extends Presenter implements ITaxiADASS
@Override
public void onNaviToEnd(boolean isAmap, boolean isShow) {
- runOnUIThread( () -> mView.onNaviToEnd(isAmap,isShow));
+ runOnUIThread(() -> mView.onNaviToEnd(isAmap, isShow));
}
@Override
public void onCurrentOrderDistToEndChanged(long meters, long timeInSecond) {
- runOnUIThread(() -> mView.onCurrentOrderDistToEndChanged(meters,timeInSecond));
+ runOnUIThread(() -> mView.onCurrentOrderDistToEndChanged(meters, timeInSecond));
}
@Override
@@ -168,7 +155,7 @@ public class TaxiPresenter extends Presenter implements ITaxiADASS
@Override
public void onCarLocationChanged(MogoLocation location) {
- if (null != location){
+ if (null != location) {
runOnUIThread(() -> {
mView.updateSpeedView((float) location.getGnssSpeed());
});
@@ -207,13 +194,12 @@ public class TaxiPresenter extends Presenter implements ITaxiADASS
mView.updateOperationStatus(TaxtServingStatusManager.isOpeningOrderStatus(), finalRole);
});
- if (!TaxiModel.INSTANCE.checkCurrentTask()){
- mView.showPanel();
+ if (!TaxiModel.INSTANCE.checkCurrentTask()) {
+ mView.showDebugPanel();
}
}
@Override
public void loginFail(boolean isLogin) {
-
}
}
diff --git a/OCH/taxi/mogo-och-taxi-unmanned/src/main/java/com/mogo/och/taxi/ui/debug/OrderDebugView.kt b/OCH/taxi/mogo-och-taxi-unmanned/src/main/java/com/mogo/och/taxi/ui/debug/OrderDebugView.kt
new file mode 100644
index 0000000000..e3d07b077d
--- /dev/null
+++ b/OCH/taxi/mogo-och-taxi-unmanned/src/main/java/com/mogo/och/taxi/ui/debug/OrderDebugView.kt
@@ -0,0 +1,76 @@
+package com.mogo.och.taxi.ui.debug
+
+import android.content.Context
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.view.View
+import android.widget.LinearLayout
+import com.mogo.eagle.core.network.utils.GsonUtil
+import com.mogo.och.taxi.R
+import com.mogo.och.taxi.model.TaxiModel
+import kotlinx.android.synthetic.main.taxi_debug_order.view.orderDebugContainer
+import kotlinx.android.synthetic.main.taxi_debug_order.view.orderInfo
+import kotlinx.android.synthetic.main.taxi_debug_order.view.orderToStartLines
+import kotlinx.android.synthetic.main.taxi_debug_order.view.taskEndSite
+import kotlinx.android.synthetic.main.taxi_debug_order.view.taskStartSite
+import kotlinx.android.synthetic.main.taxi_debug_order.view.taskStatus2
+import kotlinx.android.synthetic.main.taxi_debug_order.view.taskType2
+import kotlinx.android.synthetic.main.taxi_debug_order.view.test_bar_current_line_id
+import kotlinx.android.synthetic.main.taxi_debug_order.view.test_bar_current_order_id
+import kotlinx.android.synthetic.main.taxi_debug_order.view.test_bar_current_stop_md5
+import kotlinx.android.synthetic.main.taxi_debug_order.view.test_bar_current_stop_md5_dpqp
+import kotlinx.android.synthetic.main.taxi_debug_order.view.test_bar_current_traj_md5
+import kotlinx.android.synthetic.main.taxi_debug_order.view.test_bar_current_traj_md5_dpqp
+
+class OrderDebugView @JvmOverloads constructor(
+ context: Context,
+ attrs: AttributeSet? = null,
+ defStyleAttr: Int = 0,
+ defStyleRes: Int = 0
+) : LinearLayout(context, attrs, defStyleAttr, defStyleRes) {
+ companion object {
+ const val TAG = "OrderDebugView"
+ }
+
+ init {
+ LayoutInflater.from(context)
+ .inflate(R.layout.taxi_debug_order, this, true)
+ visibility = GONE
+ }
+
+ fun updateData() {
+ val data = TaxiModel.getCurTaskAndOrder()
+ if (data == null) {
+ orderDebugContainer?.visibility = View.GONE
+ return
+
+ }
+ orderDebugContainer.visibility =
+ if (orderDebugContainer?.visibility == View.VISIBLE)
+ View.GONE
+ else
+ View.VISIBLE
+ data.order?.also {
+ test_bar_current_order_id.text = "orderNo: $it.orderNo"
+ test_bar_current_line_id!!.text = "当前任务lineId: $it.lineId"
+ taskType2.text = "当前任务类型: $it.taskType"
+ taskStatus2.text = "任务状态: $it.currentStatus"
+ taskStartSite.text =
+ "任务开始站点: ${data.startSite?.siteName} , siteId: ${data.startSite?.siteId}"
+ taskEndSite.text =
+ "任务结束站点: ${data.endSite?.siteName}, siteId: ${data?.endSite?.siteId}"
+ orderInfo.text =
+ "订单信息: 开始: ${it.orderStartSite?.siteName}, 结束: ${it.orderEndSite?.siteName}, orderStatus: ${it.orderStatus}"
+ orderToStartLines.text =
+ "接驾任务的lineId集合: " + GsonUtil.jsonFromObject(it.planningLines)
+
+ val curContrail = TaxiModel.getCurTaskContrail()
+ curContrail?.also {
+ test_bar_current_traj_md5.text = "TrajMd5: ${curContrail?.csvFileMd5}"
+ test_bar_current_stop_md5.text = "StopMd5: ${curContrail?.txtFileMd5}"
+ test_bar_current_traj_md5_dpqp.text = "TrajMd5DPQP: ${curContrail?.csvFileMd5DPQP}"
+ test_bar_current_stop_md5_dpqp.text = "StopMd5DPQP: ${curContrail?.txtFileMd5DPQP}"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/OCH/taxi/mogo-och-taxi-unmanned/src/main/res/layout/taxi_base_fragment.xml b/OCH/taxi/mogo-och-taxi-unmanned/src/main/res/layout/taxi_base_fragment.xml
index 9cb230ae7a..dfb68b252f 100644
--- a/OCH/taxi/mogo-och-taxi-unmanned/src/main/res/layout/taxi_base_fragment.xml
+++ b/OCH/taxi/mogo-och-taxi-unmanned/src/main/res/layout/taxi_base_fragment.xml
@@ -246,7 +246,6 @@
android:textColor="@color/taxi_autopilot_text_color_selector"
android:textSize="@dimen/dp_40"
android:textStyle="bold"
-
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" />
diff --git a/OCH/taxi/mogo-och-taxi-unmanned/src/main/res/layout/taxi_debug_order.xml b/OCH/taxi/mogo-och-taxi-unmanned/src/main/res/layout/taxi_debug_order.xml
new file mode 100644
index 0000000000..cd75e6d17f
--- /dev/null
+++ b/OCH/taxi/mogo-och-taxi-unmanned/src/main/res/layout/taxi_debug_order.xml
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/taxi/mogo-och-taxi-unmanned/src/main/res/layout/taxi_panel.xml b/OCH/taxi/mogo-och-taxi-unmanned/src/main/res/layout/taxi_panel.xml
index 1fab3da2d9..871a362fc3 100644
--- a/OCH/taxi/mogo-och-taxi-unmanned/src/main/res/layout/taxi_panel.xml
+++ b/OCH/taxi/mogo-och-taxi-unmanned/src/main/res/layout/taxi_panel.xml
@@ -15,133 +15,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
-
+ app:layout_constraintLeft_toLeftOf="parent" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file