From 97175fa46cc3854b19df7b838b7bf5fa51998ba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Tue, 22 Jun 2021 17:24:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E5=8D=95=E7=8B=AC?= =?UTF-8?q?=E4=B8=8E=E5=B7=A5=E6=8E=A7=E6=9C=BA=E4=B8=8B=E5=8F=91=E7=AB=99?= =?UTF-8?q?=E7=82=B9=E7=9A=84=E5=8A=9F=E8=83=BD=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BA=86ADAS=E7=8A=B6=E6=80=81=E5=9B=9E=E8=B0=83=E6=9C=AA?= =?UTF-8?q?=E8=A2=AB=E6=B3=A8=E5=86=8C=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/och/bus/fragment/OchBusFragment.java | 1 + .../java/com/mogo/och/BaseOchFragment.java | 30 ++++++++++++++---- .../layout/module_mogo_och_base_fragment.xml | 31 +++++++++++-------- .../mogo/module/adas/AdasEventManager.java | 2 +- .../service/impl/adas/MogoADASController.java | 7 +++-- 5 files changed, 48 insertions(+), 23 deletions(-) diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java index 023888b7d8..5bc22f3044 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java @@ -200,6 +200,7 @@ public class OchBusFragment extends BaseOchFragment< OchBusFragment, OchBusPrese * 设置自动驾驶可用状态 */ public void onAutopilotEnableChange( boolean isEnable ) { + onAutopilotStatusChanged(isEnable); if ( isEnable ) { showAutopilotBiz(); } else { diff --git a/OCH/mogo-och/src/main/java/com/mogo/och/BaseOchFragment.java b/OCH/mogo-och/src/main/java/com/mogo/och/BaseOchFragment.java index eacee5b82f..8c1fab5ea4 100644 --- a/OCH/mogo-och/src/main/java/com/mogo/och/BaseOchFragment.java +++ b/OCH/mogo-och/src/main/java/com/mogo/och/BaseOchFragment.java @@ -17,6 +17,8 @@ import com.mogo.module.common.MogoApisHandler; import com.mogo.module.common.view.OnPreventFastClickListener; import com.mogo.och.view.SlidePanelView; import com.mogo.service.adas.IMogoAdasOCHCallback; +import com.mogo.service.adas.RemoteControlAutoPilotParameters; +import com.mogo.utils.logger.Logger; /** * 网约车基础Fragment,主要负责布局通用界面,处理站点面板和通话面板互斥情况 @@ -32,7 +34,7 @@ public abstract class BaseOchFragment> e protected SlidePanelView slidePanelView; private CheckedTextView ctvAutopilotStatus; protected TextView tvOperationStatus; - public boolean isOperationStatus;//false-收车,true-出车 + public boolean isOperationStatus;//false-收车,true-出车 private FrameLayout flStationPanelContainer; private Group groupTestPanel; @@ -109,12 +111,28 @@ public abstract class BaseOchFragment> e .mockOchStatus(IMogoAdasOCHCallback.STATUS_AUTOPILOT_RUNNING, "Running") ); - // 模拟 自动驾驶网约车回调数据 + // 模拟 自动驾驶站 findViewById(R.id.btnAutopilotArrive).setOnClickListener(view -> MogoApisHandler.getInstance().getApis() .getAdasControllerApi().mockOchStatus(-1, "Arrived") ); + // 模拟 站点下发工控 + findViewById(R.id.btnAutopilotControl).setOnClickListener(view -> + { + RemoteControlAutoPilotParameters currentAutopilot = new RemoteControlAutoPilotParameters(); + currentAutopilot.isSpeakVoice = true; + // 万集东门站 + currentAutopilot.startLatLon = new RemoteControlAutoPilotParameters.AutoPilotLonLat(116.74157277,40.19885549); + // 市政府前街18号 + currentAutopilot.endLatLon = new RemoteControlAutoPilotParameters.AutoPilotLonLat(116.729134342,40.1953113732); + // 订单运营类型 (9出租车,10小巴) + currentAutopilot.vehicleType = 10; + Logger.d(TAG, "模拟 订单站点下发:" + currentAutopilot); + MogoApisHandler.getInstance().getApis().getAdasControllerApi().aiCloudToAdasData(currentAutopilot); + } + ); + tvOperationStatus.setOnClickListener(view -> { onChangeOperationStatus(); }); @@ -185,14 +203,14 @@ public abstract class BaseOchFragment> e }); } - public void hidPanel(){ - getActivity().runOnUiThread(()->{ + public void hidPanel() { + getActivity().runOnUiThread(() -> { flStationPanelContainer.setVisibility(View.GONE); }); } - public void showPanel(){ - getActivity().runOnUiThread(()->{ + public void showPanel() { + getActivity().runOnUiThread(() -> { flStationPanelContainer.setVisibility(View.VISIBLE); }); } diff --git a/OCH/mogo-och/src/main/res/layout/module_mogo_och_base_fragment.xml b/OCH/mogo-och/src/main/res/layout/module_mogo_och_base_fragment.xml index c369dc9da8..3cc3070de3 100644 --- a/OCH/mogo-och/src/main/res/layout/module_mogo_och_base_fragment.xml +++ b/OCH/mogo-och/src/main/res/layout/module_mogo_och_base_fragment.xml @@ -76,9 +76,8 @@ android:id="@+id/btnAutopilotDisable" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="#f00" - android:text="Disable" - android:textSize="30sp" + android:text="模拟 不可自动驾驶" + android:textSize="20sp" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -86,9 +85,8 @@ android:id="@+id/btnAutopilotEnable" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="#0f0" - android:text="Enable" - android:textSize="30sp" + android:text="模拟 中途人工干预" + android:textSize="20sp" app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable" app:layout_constraintTop_toBottomOf="@id/btnAutopilotDisable" /> @@ -96,9 +94,8 @@ android:id="@+id/btnAutopilotRunning" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="#00f" - android:text="Running" - android:textSize="30sp" + android:text="模拟 自动驾驶途中" + android:textSize="20sp" app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable" app:layout_constraintTop_toBottomOf="@id/btnAutopilotEnable" /> @@ -106,18 +103,26 @@ android:id="@+id/btnAutopilotArrive" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="#f00" - android:text="Arrived" - android:textSize="30sp" + android:text="模拟 自动驾驶到站" + android:textSize="20sp" app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable" app:layout_constraintTop_toBottomOf="@id/btnAutopilotRunning" /> +