增加了单独与工控机下发站点的功能
修复了ADAS状态回调未被注册的bug
This commit is contained in:
@@ -200,6 +200,7 @@ public class OchBusFragment extends BaseOchFragment< OchBusFragment, OchBusPrese
|
||||
* 设置自动驾驶可用状态
|
||||
*/
|
||||
public void onAutopilotEnableChange( boolean isEnable ) {
|
||||
onAutopilotStatusChanged(isEnable);
|
||||
if ( isEnable ) {
|
||||
showAutopilotBiz();
|
||||
} else {
|
||||
|
||||
@@ -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<V extends IView, P extends Presenter<V>> 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<V extends IView, P extends Presenter<V>> 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<V extends IView, P extends Presenter<V>> 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);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAutopilotControl"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="模拟 站点下发工控"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnAutopilotArrive" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/groupTestPanel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="btnAutopilotArrive,btnAutopilotDisable,btnAutopilotEnable,btnAutopilotRunning"
|
||||
app:constraint_referenced_ids="btnAutopilotArrive,btnAutopilotDisable,btnAutopilotEnable,btnAutopilotRunning,btnAutopilotControl"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -173,7 +173,7 @@ public class AdasEventManager implements OnAdasListener, OnAdasMsgConnectStatusL
|
||||
|
||||
@Override
|
||||
public void autopilotStatus(AutopilotStatus autopilotStatus) {
|
||||
Logger.d(TAG,"autopilotStatus " + autopilotStatus);
|
||||
Logger.d(TAG,"autopilotStatus " + GsonUtil.jsonFromObject(autopilotStatus));
|
||||
AutopilotStatus.ValuesBean autopilotStatusValues = autopilotStatus.getValues();
|
||||
AutopilotStatus.ValuesBean mAutopilotStatus;
|
||||
|
||||
|
||||
@@ -326,9 +326,10 @@ public class MogoADASController implements IMogoADASController {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (SingletonsHolder.get(IMogoStatusManager.class).isVrMode()) {
|
||||
return;
|
||||
}
|
||||
// TODO 以前这里是考虑ADAS独立应用,现在集成ADAS-SDK到程序内了,这个判断不需要了
|
||||
// if (SingletonsHolder.get(IMogoStatusManager.class).isVrMode()) {
|
||||
// return;
|
||||
// }
|
||||
Logger.d(TAG, Log.getStackTraceString(new Throwable()));
|
||||
init(AbsMogoApplication.getApp());
|
||||
adasProvider.addAdasStatusListener(new AdasStatusListener() {
|
||||
|
||||
Reference in New Issue
Block a user