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" /> +