Merge branch 'dev_robotaxi-d-app-module_270_220510_2.7.0' into dev_robotaxi-d-app-module_270_passenger

This commit is contained in:
yangyakun
2022-05-16 14:56:32 +08:00
110 changed files with 2866 additions and 1650 deletions

View File

@@ -6,12 +6,13 @@
<com.mogo.eagle.core.function.hmi.ui.widget.SteeringWheelView
android:id="@+id/steering_wheel"
android:layout_width="@dimen/dp_432"
android:layout_height="@dimen/dp_432"
android:layout_width="@dimen/dp_300"
android:layout_height="@dimen/dp_300"
android:layout_marginLeft="@dimen/dp_90"
android:layout_marginTop="@dimen/dp_112"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/bus_p_autopilot_iv"
android:layout_width="wrap_content"
@@ -19,7 +20,7 @@
android:layout_marginLeft="@dimen/bus_p_curent_station_panel_margin"
android:layout_marginTop="@dimen/dp_112"
android:scaleType="fitXY"
android:visibility="gone"
android:visibility="invisible"
android:layout_gravity="center_horizontal"
android:src="@drawable/bus_p_un_auto_nor"
app:layout_constraintLeft_toLeftOf="parent"

View File

@@ -63,5 +63,7 @@ class BusConst {
* 订单起终点Marker类型
*/
const val TYPE_MARKER_BUS_ORDER = "TYPE_MARKER_BUS_ORDER"
const val TIMER_START_AUTOPILOT_INTERVAL = 10 * 1000L
}
}

View File

@@ -1,6 +1,7 @@
package com.mogo.och.bus.fragment;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
import static com.mogo.och.bus.constant.BusConst.TIMER_START_AUTOPILOT_INTERVAL;
import android.animation.ObjectAnimator;
import android.content.Intent;
@@ -23,7 +24,6 @@ import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.mvp.Presenter;
import com.mogo.commons.voice.AIAssist;
import com.mogo.eagle.core.data.config.HmiBuildConfig;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
@@ -31,6 +31,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListener
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.MogoMapUIController;
import com.mogo.map.MogoMarkerManager;
@@ -40,12 +41,10 @@ import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.constants.DataTypes;
import com.mogo.module.common.view.OnPreventFastClickListener;
import com.mogo.och.bus.R;
import com.mogo.och.bus.ui.BusTrafficLightView;
import com.mogo.och.bus.util.BDRouteDataTestUtils;
import com.mogo.och.bus.view.BusArcView;
import com.mogo.och.bus.view.SlidePanelView;
import mogo.telematics.pad.MessagePad;
import record_cache.RecordPanelOuterClass;
/**
@@ -83,6 +82,8 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
private ObjectAnimator autopilotLoadingAnimator;
public boolean isAnimateRunning = false;
/**
* 滑动按钮触发的事件
*/
@@ -156,47 +157,33 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
@Override
public void onClickImpl(View v) {
restartAutopilot();
if (CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState() != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE){
restartAutopilot();
}else {
TipToast.shortTip(getResources().getString(R.string.bus_auto_disable_tip));
}
}
});
// debug下调用测试面板 2022.2.25修改到 长按当前站点名字
// if (DebugConfig.isDebug()) {
// ctvAutopilotStatus.setOnLongClickListener(v -> {
// debugTestBar();
// return true;
// });
// }
onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState(), false);
setAutopilotBtnStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState());
// 模拟 不可自动驾驶目前场景是刚开机adas还未和工控机连接
findViewById(R.id.btnAutopilotDisable).setOnClickListener(view ->
// MogoApisHandler.getInstance().getApis()
// .getAdasControllerApi()
// .mockOchStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE, "不能使用")
debugAutoPilotStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE)
debugAutoPilotStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE)
);
// 模拟 可自动驾驶,工控机连接正常,且处于人工干预状态
findViewById(R.id.btnAutopilotEnable).setOnClickListener(view ->
// MogoApisHandler.getInstance().getApis()
// .getAdasControllerApi()
// .mockOchStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE, "能使用")
debugAutoPilotStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE)
debugAutoPilotStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE)
);
// 模拟 自动驾驶能力,自动驾驶中,可能是停车,可能是行进,但是是机器在处理车的前进后退,不是人
findViewById(R.id.btnAutopilotRunning).setOnClickListener(view ->
// MogoApisHandler.getInstance().getApis()
// .getAdasControllerApi()
// .mockOchStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING, "Running")
debugAutoPilotStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING)
debugAutoPilotStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING)
);
// 模拟 自动驾驶网约车回调数据
findViewById(R.id.btnAutopilotArrive).setOnClickListener(view ->
// MogoApisHandler.getInstance().getApis()
// .getAdasControllerApi().mockOchStatus(-1, "Arrived")
debugArrivedStation()
debugArrivedStation()
);
findViewById(R.id.btnAutopilotRoute).setOnClickListener(view -> debugArrivedRoute());
@@ -298,70 +285,70 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
*
* @param autopilotStatus 0:不可用 1:可用状态 2:自动驾驶中
*/
public void onAutopilotStatusChanged(int autopilotStatus, boolean isAnimateRunning) {
public void onAutopilotStatusChanged(int autopilotStatus) {
getActivity().runOnUiThread(() -> {
// ctvAutopilotStatus.setChecked(isInAutopilot);
changeAutopilotBtnView(autopilotStatus, isAnimateRunning);
});
}
private void changeAutopilotBtnView(int autopilotStatus, boolean isAnimateRunning) {
CallerLogger.INSTANCE.d(M_BUS + TAG, "onStateChangeChangeAutopilotBtnView: " + autopilotStatus + "isAnimateRunning = " + isAnimateRunning);
public void setAutopilotBtnStatus(int autopilotStatus) {
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE
== autopilotStatus) {//0不可用
if (isAnimateRunning) {
stopAutopilotAnimation();
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_wrong_autopilot_icon);
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_failure_tv));
ctvAutopilotStatus.setFocusableInTouchMode(false);
ctvAutopilotStatus.setSelected(false);
}
UiThreadHandler.postDelayed(new Runnable() {
@Override
public void run() {
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_disable));
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_runnig_tv));
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_disable_autopilot_icon);
ctvAutopilotStatus.setSelected(false);
ctvAutopilotStatus.setFocusableInTouchMode(true);
// ctvAutopilotStatus.setPressed(false);
}
}, 1000);
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_disable));
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_runnig_tv));
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_disable_autopilot_icon);
ctvAutopilotStatus.setSelected(false);
ctvAutopilotStatus.setFocusableInTouchMode(true);
} else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE
} else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == autopilotStatus
|| IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
== autopilotStatus) {//1可用
if (isAnimateRunning) {
return;
}
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_runnig_tv));
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_ic_autopilot);
ctvAutopilotStatus.setSelected(false);
ctvAutopilotStatus.setSelected(true);
ctvAutopilotStatus.setFocusableInTouchMode(true);
// ctvAutopilotStatus.setPressed(true);
} else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
}
}
public void updateAutopilotStatus(int autopilotStatus){
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
== autopilotStatus) {//2 running
if (isAnimateRunning) {
stopAutopilotAnimation();
}
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_right_autopilot_icon);
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_success_tv));
ctvAutopilotStatus.setSelected(false);
ctvAutopilotStatus.setFocusableInTouchMode(false);
UiThreadHandler.postDelayed(new Runnable() {
@Override
public void run() {
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_ic_autopilot);
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_runnig_tv));
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatus.setSelected(true);
ctvAutopilotStatus.setFocusableInTouchMode(true);
// ctvAutopilotStatus.setPressed(false);
}
}, 1000);
}else {
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_wrong_autopilot_icon);
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_failure_tv));
ctvAutopilotStatus.setFocusableInTouchMode(false);
ctvAutopilotStatus.setSelected(false);
}
UiThreadHandler.postDelayed(new Runnable() {
@Override
public void run() {
setAutopilotBtnStatus(autopilotStatus);
}
},1000);
}
private void changeAutopilotBtnView(int autopilotStatus, boolean isAnimateRunning) {
CallerLogger.INSTANCE.d(M_BUS + TAG, "onStateChangeChangeAutopilotBtnView: "
+ autopilotStatus + "isAnimateRunning = " + isAnimateRunning);
if (isAnimateRunning && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
!= autopilotStatus) {
// 主动开启自动驾驶中不为2为0、1则继续loading
return;
}
if (isAnimateRunning){
stopAutopilotAnimation();
updateAutopilotStatus(autopilotStatus);
}else {
setAutopilotBtnStatus(autopilotStatus);
}
}
/**
@@ -426,7 +413,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
* 开启自动驾驶中间动画
*/
public void startAutopilotAnimation() {
// if (CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState() == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE){
isAnimateRunning = true;
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_tv));
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatus.setSelected(false);
@@ -439,17 +426,34 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
autopilotLoadingAnimator.setDuration(1000);//设置持续时间
}
autopilotLoadingAnimator.start();//动画开始
// }
startingAutoApilotCountDown();
}
private void startingAutoApilotCountDown(){
//10s 若自动驾驶没有开启,则结束动画
UiThreadHandler.postDelayed(new Runnable() {
@Override
public void run() { //未启动成功做处理
if (CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()
!= IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING && isAnimateRunning){
stopAutopilotAnimation();
updateAutopilotStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState());
}
}
},TIMER_START_AUTOPILOT_INTERVAL);
}
/**
* 停止自动驾驶中间动画
*/
public void stopAutopilotAnimation() {
private void stopAutopilotAnimation() {
if (autopilotLoadingAnimator != null) {
autopilotLoadingAnimator.end();
ctvAutopilotStatusIv.clearAnimation();
autopilotLoadingAnimator = null;
isAnimateRunning = false;
}
}

View File

@@ -94,11 +94,11 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
break;
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE:
showAutopilotBiz();
onAutopilotStatusChanged(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE, false);
onAutopilotStatusChanged(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE);
break;
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING:
showAutopilotBiz();
onAutopilotStatusChanged(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING, false);
onAutopilotStatusChanged(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING);
break;
default:
break;
@@ -239,7 +239,9 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
@Override
public void restartAutopilot() {
mPresenter.restartAutopilot();
if (!isAnimateRunning) {
mPresenter.restartAutopilot();
}
}
@Override

View File

@@ -1,5 +1,9 @@
package com.mogo.och.bus.model;
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_ALIAS_CODE_ADAS_MESSAGE_CAR_STATE;
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_ALIAS_CODE_OCH_BUS_START_AUTOPILOT;
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_ADAS;
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
import static com.mogo.och.bus.constant.BusConst.STATION_STATUS_STOPPED;
@@ -50,6 +54,8 @@ import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
import com.mogo.och.common.module.utils.PinYinUtil;
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.StatusDescriptor;
import com.zhjt.service.chain.ChainLog;
import com.zhjt.service.chain.TracingConstants;
import java.io.IOException;
import java.util.ArrayList;
@@ -465,6 +471,14 @@ public class BusOrderModel {
* 服务端返回的OchBusRoutesResult逻辑 离开站为当前站, 到达下一站后才会将下一站置为当前站,
* 车机端展示是离开当前站,下一站设置为当前站, 所以服务端数据回来要做处理,不能直接渲染
*/
@ChainLog(
linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT,
linkCode = CHAIN_LINK_ADAS,
endpoint = TracingConstants.Endpoint.PAD,
nodeAliasCode = CHAIN_ALIAS_CODE_OCH_BUS_START_AUTOPILOT,
paramIndexes = {0},
clientPkFileName = "sn"
)
private void RenderLeaveStationSuccess(BusRoutesResult result, boolean isRestart) {
renderBusStationsStatus(result);
if (slidePannelHideCallback != null) {
@@ -771,9 +785,7 @@ public class BusOrderModel {
*/
public void restartAutopilot() {
CallerLogger.INSTANCE.d( M_BUS + TAG, "重启自动驾驶===" + isGoingToNextStation );
if ( isGoingToNextStation ) {
autoDriveToNextStation( true );
}
autoDriveToNextStation( true );
}
/**
@@ -859,7 +871,7 @@ public class BusOrderModel {
CallerLogger.INSTANCE.e( M_BUS + TAG, "到站异常,取消后续操作结束" );
return;
}
if (FunctionBuildConfig.isDemoMode && currentStationIndex == stationList.size() - 1){//到达最后一站结束美化
if (FunctionBuildConfig.isDemoMode && currentStationIndex == stationList.size() - 1) {//到达最后一站结束美化
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false;
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore置为false到最后一站");
}

View File

@@ -43,7 +43,6 @@ public class BusPresenter extends Presenter<BusFragment>
private static final String TAG = "BusPresenter";
private int currentAutopilotStatus = -1;
private boolean isAnimateRunning = false;
private List<BusStationBean> mStationList = new ArrayList<>();
private int mCurrentStation = 0;
@@ -83,6 +82,14 @@ public class BusPresenter extends Presenter<BusFragment>
BusOrderModel.getInstance().setControllerStatusCallback(null);
}
// public void setIsAnimateRunning(boolean isAnimateRunning){
// this.isAnimateRunning = isAnimateRunning;
// }
// public boolean getIsAnimateRunning(){
// return isAnimateRunning;
// }
public void queryBusRoutes() {
BusOrderModel.getInstance().queryBusRoutes();
}
@@ -97,8 +104,10 @@ public class BusPresenter extends Presenter<BusFragment>
}
public void restartAutopilot() {
currentAutopilotStatus = -1;
BusOrderModel.getInstance().restartAutopilot();
if (BusOrderModel.getInstance().isGoingToNextStation()){
currentAutopilotStatus = -1;
BusOrderModel.getInstance().restartAutopilot();
}
}
public void onChangeOperationStatus() {
@@ -117,7 +126,7 @@ public class BusPresenter extends Presenter<BusFragment>
mStationList.clear();
mStationList.addAll(stationList);
mCurrentStation = currentStation;
functionDemoModeChange();
// functionDemoModeChange();
CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel =", " mCurrentStation =" + mCurrentStation);
if (mView != null) {
runOnUIThread(() -> mView.refreshBusStations(
@@ -132,7 +141,7 @@ public class BusPresenter extends Presenter<BusFragment>
|| ((mCurrentStation == 0 || mCurrentStation == mStationList.size() - 1)
&& BusOrderModel.getInstance().isGoingToNextStation()))) {
runOnUIThread(() -> mView.onAutopilotStatusChanged(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING, false));
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING));
}
}
@@ -183,18 +192,16 @@ public class BusPresenter extends Presenter<BusFragment>
return;
}
// 改变UI自动驾驶状态
runOnUIThread(() -> mView.onAutopilotStatusChanged(currentAutopilotStatus, isAnimateRunning));
runOnUIThread(() -> mView.onAutopilotStatusChanged(currentAutopilotStatus));
}
break;
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING:
runOnUIThread(() -> mView.stopAutopilotAnimation());
if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
currentAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING;
// 改变UI自动驾驶状态
runOnUIThread(() -> mView.onAutopilotStatusChanged(currentAutopilotStatus, isAnimateRunning));
runOnUIThread(() -> mView.onAutopilotStatusChanged(currentAutopilotStatus));
BusOrderModel.getInstance().triggerStartServiceEvent(true);
}
isAnimateRunning = false;
break;
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE:
if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) {
@@ -215,11 +222,9 @@ public class BusPresenter extends Presenter<BusFragment>
return;
}
runOnUIThread(() -> {
mView.onAutopilotEnableChange(false);
mView.onAutopilotStatusChanged(currentAutopilotStatus, isAnimateRunning);
mView.onAutopilotStatusChanged(currentAutopilotStatus);
});
}
isAnimateRunning = false;
break;
default:
runOnUIThread(() -> mView.onAutopilotEnableChange(false));
@@ -241,15 +246,8 @@ public class BusPresenter extends Presenter<BusFragment>
@Override
public void startOpenAutopilot() {
isAnimateRunning = true;
//非美化模式下启动动画
runOnUIThread(() -> mView.startAutopilotAnimation());
// TODO: 2021/8/20 无工控机环境, 手动调起自动驾驶开启返回结果,有工控机环境要删除
// UiThreadHandler.postDelayed(new Runnable() {
// @Override
// public void run() {
// debugAutoPilotStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING);
// }
// },2300);
}
private void runOnUIThread(Runnable executor) {

View File

@@ -23,4 +23,5 @@
<!-- <string name="bus_arrive_to_end_start1">上车</string>-->
<string name="bus_arrive_to_end_end"></string>
<!-- <string name="bus_arrive_to_end_end1">下车</string>-->
<string name="bus_auto_disable_tip">自动驾驶状态为0不可用</string>
</resources>

View File

@@ -6,28 +6,40 @@
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_72">
<ImageView
android:id="@+id/module_och_autopilot_iv"
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
android:layout_marginLeft="40px"
android:layout_marginTop="48px"
android:scaleType="fitXY"
android:layout_gravity="center_horizontal"
android:src="@drawable/taxi_p_un_auto_nor"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<com.mogo.eagle.core.function.hmi.ui.widget.SteeringWheelView
android:id="@+id/steering_wheel"
android:layout_width="@dimen/dp_630"
android:layout_height="@dimen/dp_630"
android:layout_marginLeft="-59px"
android:layout_marginTop="@dimen/dp_20"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/module_och_taxi_swich_map_iv"
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
android:layout_marginTop="40px"
android:layout_gravity="center"
android:scaleType="fitXY"
app:layout_constraintTop_toBottomOf="@+id/module_och_autopilot_iv"
app:layout_constraintLeft_toLeftOf="@+id/module_och_autopilot_iv"
android:background="@drawable/taxi_p_switch_map_bg" />
<ImageView
android:id="@+id/module_och_autopilot_iv"
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="40px"
android:layout_marginTop="48px"
android:scaleType="fitXY"
android:src="@drawable/taxi_p_un_auto_nor"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/module_och_taxi_swich_map_iv"
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
android:layout_gravity="center"
android:layout_marginLeft="40px"
android:layout_marginTop="40px"
android:layout_marginBottom="@dimen/dp_50"
android:background="@drawable/taxi_p_switch_map_bg"
android:scaleType="fitXY"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" />
<ImageView
android:id="@+id/iv_temp"
@@ -37,8 +49,9 @@
android:layout_marginLeft="@dimen/dp_40"
android:layout_marginBottom="@dimen/dp_40"
android:background="@drawable/taxi_p_mogologo_nor"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"/>
app:layout_constraintLeft_toLeftOf="parent" />
<Button
android:id="@+id/btnAutopilotDisable"
@@ -97,6 +110,7 @@
android:visibility="gone"
app:constraint_referenced_ids="btnAutopilotArrive,btnAutopilotDisable,btnAutopilotEnable,btnAutopilotRunning,btnAutopilotControl"
tools:visibility="gone" />
<FrameLayout
android:id="@+id/module_mogo_och_navi_panel_container"
android:layout_width="wrap_content"
@@ -104,16 +118,16 @@
android:layout_marginTop="@dimen/dp_120"
android:layout_marginRight="@dimen/dp_10"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
app:layout_constraintTop_toTopOf="parent" />
<com.mogo.och.taxi.passenger.ui.TaxiPassengerTrafficLightView
android:id="@+id/traffic_light_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginRight="@dimen/taxi_p_traffic_light_layout_margin_right"
android:layout_marginTop="@dimen/taxi_p_traffic_light_layout_margin_top"
android:visibility="gone"/>
android:layout_marginRight="@dimen/taxi_p_traffic_light_layout_margin_right"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -71,5 +71,7 @@ class TaxiConst {
* 订单起终点Marker类型
*/
const val TYPE_MARKER_TAXI_ORDER = "TYPE_MARKER_TAXI_ORDER"
const val TIMER_START_AUTOPILOT_INTERVAL = 10 * 1000L
}
}

View File

@@ -1,5 +1,9 @@
package com.mogo.och.taxi.model;
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_ALIAS_CODE_OCH_BUS_START_AUTOPILOT;
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_ALIAS_CODE_OCH_TAXI_START_AUTOPILOT;
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_ADAS;
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI;
import android.content.Context;
@@ -60,6 +64,8 @@ import com.mogo.aicloud.services.socket.IMogoLifecycleListener;
import com.mogo.service.intent.IMogoIntentListener;
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.StatusDescriptor;
import com.zhjt.service.chain.ChainLog;
import com.zhjt.service.chain.TracingConstants;
import org.jetbrains.annotations.NotNull;
@@ -763,7 +769,7 @@ public class TaxiModel {
if (FunctionBuildConfig.isDemoMode) {
// 当美化模式(演示模式)开启时: 取消或订单已完成时置false
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false;
CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore置为false清除当前订单");
CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore置为false已完成or清除当前订单)");
}
}
@@ -778,6 +784,14 @@ public class TaxiModel {
}
//以当前订单为基础,开启自动驾驶
@ChainLog(
linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT,
linkCode = CHAIN_LINK_ADAS,
endpoint = TracingConstants.Endpoint.PAD,
nodeAliasCode = CHAIN_ALIAS_CODE_OCH_TAXI_START_AUTOPILOT,
paramIndexes = {0},
clientPkFileName = "sn"
)
public void startAutoPilot() {
if (!checkCurrentOCHOrder()) {
CallerLogger.INSTANCE.e(M_TAXI + TAG, "no order or order is empty.");
@@ -966,7 +980,7 @@ public class TaxiModel {
* 测试开始服务
*/
public void setOnTheWayToEndStation() {
if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotRunning();
// if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotRunning();
if (mCurrentOCHOrder == null
|| mCurrentOCHOrder.orderStatus != TaxiOrderStatusEnum.ArriveAtStart.getCode()) {
TipToast.shortTip("订单状态不匹配该操作!");
@@ -1042,6 +1056,11 @@ public class TaxiModel {
// TipToast.shortTip("到达目的地");
}
updateOCHOrderStatus(TaxiOrderStatusEnum.ArriveAtEnd);
if (FunctionBuildConfig.isDemoMode) {
// 当美化模式(演示模式)开启时: 到达目的地置false
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false;
CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore置为false到达目的地");
}
}
};
private final IMoGoAutopilotPlanningListener moGoAutopilotPlanningListener = new IMoGoAutopilotPlanningListener() {

View File

@@ -1,9 +1,9 @@
package com.mogo.och.taxi.ui;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI;
import static com.mogo.och.taxi.constant.TaxiConst.TIMER_START_AUTOPILOT_INTERVAL;
import android.animation.ObjectAnimator;
import android.content.Intent;
import android.graphics.drawable.AnimationDrawable;
import android.os.Handler;
import android.os.Looper;
@@ -26,22 +26,20 @@ import com.mogo.commons.mvp.IView;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.mvp.Presenter;
import com.mogo.commons.voice.AIAssist;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.data.config.HmiBuildConfig;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.MogoMapUIController;
import com.mogo.map.MogoMarkerManager;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.constants.DataTypes;
import com.mogo.module.common.view.OnPreventFastClickListener;
import com.mogo.och.taxi.R;
@@ -109,13 +107,13 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
// mSpeedView.setOnClickListener(v -> {
// onAutopilotStatusChanged(false);
// });
mSpeedView.setOnLongClickListener(v -> {
CallerLogger.INSTANCE.d(M_TAXI + TAG, "长按显示状态工具栏");
Intent intent = new Intent();
intent.putExtra("oper", 52);
MogoApisHandler.getInstance().getApis().getIntentManagerApi().invoke("com.mogo.mock", intent);
return true;
});
// mSpeedView.setOnLongClickListener(v -> {
// CallerLogger.INSTANCE.d(M_TAXI + TAG, "长按显示状态工具栏");
// Intent intent = new Intent();
// intent.putExtra("oper", 52);
// MogoApisHandler.getInstance().getApis().getIntentManagerApi().invoke("com.mogo.mock", intent);
// return true;
// });
}
tvOperationStatus = findViewById(R.id.module_mogo_och_operation_status);
@@ -171,82 +169,46 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
@Override
public void onClickImpl(View v) {
// 如果能自动驾驶,就自动驾驶,不能就提示
restartAutopilot();
if (CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState() != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) {
restartAutopilot();
}else {
TipToast.shortTip(getResources().getString(R.string.module_och_taxi_auto_disable_tip));
}
// TODO: 2021/11/27 通过开启结果更新ui
// onAutopilotStatusChanged(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING);
}
});
// debug下调用测试面板
// if (DebugConfig.isDebug()) {
// ctvAutopilotStatus.setOnLongClickListener(v -> {
// if (groupTestPanel.getVisibility() == View.VISIBLE) {
groupTestPanel.setVisibility(View.GONE);
// } else {
// groupTestPanel.setVisibility(View.VISIBLE);
// }
// return false;
// });
// }
// debug下调用测试面板 长按速度值
if (DebugConfig.isDebug()) {
mSpeedView.setOnLongClickListener(v -> {
if (groupTestPanel.getVisibility() == View.VISIBLE) {
groupTestPanel.setVisibility(View.GONE);
} else {
groupTestPanel.setVisibility(View.VISIBLE);
}
return false;
});
}
onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState());
// 模拟 不可自动驾驶目前场景是刚开机adas还未和工控机连接
// findViewById(R.id.btnAutopilotDisable).setOnClickListener(view ->
// {
// MogoApisHandler.getInstance().getApis()
// .getAdasControllerApi()
// .mockOchStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE, "不能使用");
//// CallerLogger.INSTANCE.d(M_TAXI + "lianglihui","模拟 不可自动驾驶");
// }
// );
findViewById(R.id.btnAutopilotDisable).setOnClickListener(view ->
onAutopilotStatusChanged(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE)
);
// 模拟 可自动驾驶,工控机连接正常,且处于人工干预状态
// findViewById(R.id.btnAutopilotEnable).setOnClickListener(view ->
// {
// MogoApisHandler.getInstance().getApis()
// .getAdasControllerApi()
// .mockOchStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE, "能使用");
//
//// CallerLogger.INSTANCE.d(M_TAXI + "lianglihui","模拟 可自动驾驶");
// }
// );
findViewById(R.id.btnAutopilotEnable).setOnClickListener(view ->
onAutopilotStatusChanged(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE)
);
// 模拟 自动驾驶能力,自动驾驶中,可能是停车,可能是行进,但是是机器在处理车的前进后退,不是人
// findViewById(R.id.btnAutopilotRunning).setOnClickListener(view ->
// {
// MogoApisHandler.getInstance().getApis()
// .getAdasControllerApi()
// .mockOchStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING, "Running");
//// CallerLogger.INSTANCE.d(M_TAXI + "lianglihui","模拟 自动驾驶能力");
// }
// );
findViewById(R.id.btnAutopilotRunning).setOnClickListener(view ->
onAutopilotStatusChanged(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING)
// 模拟 自动驾驶站
// findViewById(R.id.btnAutopilotArrive).setOnClickListener(view ->
// {
// MogoApisHandler.getInstance().getApis()
// .getAdasControllerApi().mockOchStatus(-1, "Arrived");
//
//// CallerLogger.INSTANCE.d(M_TAXI + "lianglihui","模拟 自动驾驶站");
// }
// );
// 模拟 站点下发工控
findViewById(R.id.btnAutopilotControl).setOnClickListener(view ->
{
// CallerLogger.INSTANCE.d(M_TAXI + "lianglihui","模拟 站点下发工控");
AutopilotControlParameters currentAutopilot = new AutopilotControlParameters();
currentAutopilot.isSpeakVoice = true;
// 万集东门站
currentAutopilot.startLatLon = new AutopilotControlParameters.AutoPilotLonLat(40.194795425, 116.724476409);
// 市政府前街18号
currentAutopilot.endLatLon = new AutopilotControlParameters.AutoPilotLonLat(40.1939540844, 116.720067);
// 订单运营类型 9出租车10小巴
currentAutopilot.vehicleType = 10;
CallerLogger.INSTANCE.d(M_TAXI + TAG, "模拟 订单站点下发:" + currentAutopilot);
CallerAutoPilotManager.INSTANCE.startAutoPilot(currentAutopilot);
}
);
tvOperationStatus.setOnClickListener(view -> {
@@ -326,7 +288,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
public void AutopilotStatusAnimchanged(int status) {
// mAutopilotTv.setText(isInAutopilot?"自动驾驶":"开启自动驾驶");
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status) {
ctvAutopilotStatus.setClickable(true);
// ctvAutopilotStatus.setClickable(true);
mAutopilotTv.setText("自动驾驶");
mAutopilotTv.setTextColor(getResources().getColor(R.color.taxi_autopilot_text_color_normal));
mAutopilotImage.setImageResource(R.drawable.taxi_ic_autopilot);
@@ -340,7 +302,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
animationDrawable.selectDrawable(0);
animationDrawable.start();
} else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == status) {
ctvAutopilotStatus.setClickable(true);
// ctvAutopilotStatus.setClickable(true);
mAutopilotTv.setText("自动驾驶");
mAutopilotTv.setTextColor(getResources().getColor(R.color.taxi_autopilot_text_color_normal));
mAutopilotImage.setImageResource(R.drawable.taxi_ic_autopilot);
@@ -351,7 +313,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
ctvAutopilotStatus.setBackground(getResources().getDrawable(R.drawable.taxi_autopilot_bg_selector));
animationDrawable = null;
} else {
ctvAutopilotStatus.setClickable(false);
// ctvAutopilotStatus.setClickable(false);
mAutopilotTv.setText("自动驾驶");
mAutopilotTv.setTextColor(getResources().getColor(R.color.taxi_autopilot_text_color_disable));
mAutopilotImage.setImageResource(R.drawable.taxi_ic_autopilot_disable);
@@ -389,7 +351,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
}, 1000L);
}
private boolean isStarting = false;
public boolean isStarting = false;
private ObjectAnimator autopilotLoadingAnimator;
public void startOrStopLoadingAnim(boolean start) {
@@ -407,6 +369,9 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
autopilotLoadingAnimator.setStartDelay(100);
autopilotLoadingAnimator.setDuration(1000);//设置持续时间
autopilotLoadingAnimator.start();//动画开始
startingAutoApilotCountDown();
} else {
isStarting = false;
if (autopilotLoadingAnimator != null) {
@@ -417,6 +382,18 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
}
}
private void startingAutoApilotCountDown() {
UiThreadHandler.postDelayed(new Runnable() {
@Override
public void run() { //未启动成功10s后做处理
if (CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()
!= IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING && isStarting){
startAutopilotDone(false);
}
}
},TIMER_START_AUTOPILOT_INTERVAL);
}
/**
* 隐藏【自动驾驶】按钮
*/

View File

@@ -190,8 +190,59 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
mTitleTV2.setText("送乘客至");
mStationTv2.setText(order.endSiteAddr);
} else if (TaxiOrderStatusEnum.ArriveAtStart.getCode() == order.orderStatus) {
CallerLogger.INSTANCE.d(M_TAXI + TAG, "已经达到起点");
} else if (TaxiOrderStatusEnum.UserArriveAtStart.getCode() == order.orderStatus
|| TaxiOrderStatusEnum.ArriveAtStart.getCode() == order.orderStatus){
mContentModule2.setVisibility(View.GONE);
mContentModule3.setVisibility(View.VISIBLE);
mArrivedStartTimeTv32.setVisibility(View.VISIBLE);
mContentModule32.setVisibility(View.VISIBLE);
mContentModule31.setVisibility(View.GONE);
mOrderOtherContent3.setVisibility(View.GONE);
Calendar currentCale = DateTimeUtils.getCurrentDateTime();
String currentHM = DateTimeUtil.formatCalendarToString(currentCale, DateTimeUtil.TAXI_HH_mm);
String currentDay = DateTimeUtil.formatCalendarToString(currentCale, DateTimeUtil.TAXI_yyyy_MM_dd);
String strHtml11 = "<font color=\"#CAD6FF\">已于</font><br>"
+ "<b><font color=\"#FFFFFF\"><big><big>" + currentHM + "</big></big></font></b>"
+ "<font color=\"#CAD6FF\">" + " " + "到达乘客上车地点</font>";
mArrivedStartTimeTv32.setLineHeight(60);
mArrivedStartTimeTv32.setText(Html.fromHtml(strHtml11));
mArrivedStationTitleTv32.setText("送乘客至");
mStationTv32.setText(order.endSiteAddr);
currentCale.add(Calendar.MINUTE, 10);
String strHtml13 = "";
if (currentDay.equals(DateTimeUtil.formatCalendarToString(currentCale, DateTimeUtil.TAXI_yyyy_MM_dd))) {
strHtml13 = "<font color=\"#CAD6FF\">免费等待至 </font>"
+ "<b><font color=\"#FFFFFF\"><big>" + DateTimeUtil.formatCalendarToString(currentCale, DateTimeUtil.TAXI_HH_mm) + "</big></b></font>";
} else {
strHtml13 = "<font color=\"#CAD6FF\">免费等待至</font>"
+ "<font color=\"#FFFFFF\"><big>" + DateTimeUtil.formatCalendarToString(currentCale, DateTimeUtil.TAXI_MM_dd_HH_mm) + "</big></font>";
}
mDistanceAndTime3.setText(Html.fromHtml(strHtml13));
if (TaxiOrderStatusEnum.ArriveAtStart.getCode() == order.orderStatus){
CallerLogger.INSTANCE.d(M_TAXI + TAG, "车辆已经达到起点");
mOrderStatus.setText(R.string.module_och_taxi_waiting);
mOrderServerStatus.setText(R.string.module_och_taxi_order_server_start_wait_check);
mOrderServerStatus.setTextColor(Color.parseColor("#4DFFFFFF"));
GradientDrawable background = (GradientDrawable) mOrderServerStatus.getBackground();//GradientDrawable是Drawable的子类
background.setColor(Color.parseColor("#4D1D5EF3"));
mOrderServerStatus.setClickable(false);
}else if (TaxiOrderStatusEnum.UserArriveAtStart.getCode() == order.orderStatus ){
CallerLogger.INSTANCE.d(M_TAXI + TAG, "乘客已上车验证成功");
mOrderStatus.setText(R.string.module_och_taxi_user_check_success);
mOrderServerStatus.setText(R.string.module_och_taxi_order_server_start);
GradientDrawable background = (GradientDrawable) mOrderServerStatus.getBackground();//GradientDrawable是Drawable的子类
background.setColor(Color.parseColor("#FF1D5EF3"));
mOrderServerStatus.setTextColor(Color.parseColor("#FFFFFF"));
mOrderServerStatus.setClickable(true);
}
}else if (TaxiOrderStatusEnum.ArriveAtStart.getCode() == order.orderStatus) {
mContentModule2.setVisibility(View.GONE);
mContentModule3.setVisibility(View.VISIBLE);
mArrivedStartTimeTv32.setVisibility(View.VISIBLE);
@@ -397,9 +448,14 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
setOrRemoveMapMaker(false, TaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint,R.raw.end_marker);
break;
case ArriveAtStart:
case UserArriveAtStart:
mTtsLessThan200Tip = 0;
mOrderCancel.setVisibility(View.VISIBLE);
showNotice(mActivity.getString(R.string.module_och_taxi_order_status_ph_text));
if (TaxiOrderStatusEnum.UserArriveAtStart.getCode() == ochStatus.getCode()){
showNotice(mActivity.getString(R.string.module_och_taxi_order_status_ph_text_check_success));
}else {
showNotice(mActivity.getString(R.string.module_och_taxi_order_status_ph_text));
}
showOrHideNavi(false);
setOrRemoveMapMaker(true, TaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint,R.raw.star_marker);
setOrRemoveMapMaker(true, TaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint,R.raw.end_marker);

View File

@@ -60,7 +60,7 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
@Override
public void restartAutopilot() {
// 在自动驾驶中,才会有重新开启自动驾驶的操作
if (mPresenter.getCurOrderStatus() == TaxiOrderStatusEnum.OnTheWayToEnd) {
if (mPresenter.getCurOrderStatus() == TaxiOrderStatusEnum.OnTheWayToEnd && !isStarting) {
CallerLogger.INSTANCE.d(M_TAXI + TAG, "restartAutopilot");
mPresenter.startAutoPilot();
startOrStopLoadingAnim(true);
@@ -219,8 +219,10 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
}
public void startAutoPilot() {
mPresenter.startAutoPilot();
startOrStopLoadingAnim(true);
if (!isStarting){
mPresenter.startAutoPilot();
startOrStopLoadingAnim(true);
}
}
public void completeOrderService(TaxiOrderStatusEnum status) {
@@ -347,207 +349,16 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
});
findViewById(R.id.test_bar_on_the_way_to_end).setOnClickListener(v -> {
showNotice("自动驾驶已启动,请系好安全带");
if (!isStarting){
mPresenter.startAutoPilot();
startOrStopLoadingAnim(true);
}
TaxiModel.getInstance().setOnTheWayToEndStation();
// testRouteInfoUpload();
});
}
private void testRouteInfoUpload() {
TPRouteDataTestUtils.converToRouteData();
// String listStr = "{\"models\":[{\n" +
// "\t\t\"lat\": 40.19927810144466,\n" +
// "\t\t\"lon\": 116.73527259387767\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19927836356079,\n" +
// "\t\t\"lon\": 116.73513114732762\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19927759500293,\n" +
// "\t\t\"lon\": 116.73497660879111\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.199264819842284,\n" +
// "\t\t\"lon\": 116.73480063747202\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.1992510141554,\n" +
// "\t\t\"lon\": 116.73463922037767\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.199245872804,\n" +
// "\t\t\"lon\": 116.73445960685193\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19924673374912,\n" +
// "\t\t\"lon\": 116.73427704009703\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19924747108264,\n" +
// "\t\t\"lon\": 116.7340707102972\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19924828745573,\n" +
// "\t\t\"lon\": 116.73385916927226\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19924941093133,\n" +
// "\t\t\"lon\": 116.73364048294795\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19924939253381,\n" +
// "\t\t\"lon\": 116.73340837408566\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19924949105934,\n" +
// "\t\t\"lon\": 116.73317368725336\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19925040039033,\n" +
// "\t\t\"lon\": 116.73296532811216\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.1992515355653,\n" +
// "\t\t\"lon\": 116.73277787366743\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.1992512720328,\n" +
// "\t\t\"lon\": 116.73263377253741\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.199205174954606,\n" +
// "\t\t\"lon\": 116.73249773114644\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.1991015743076,\n" +
// "\t\t\"lon\": 116.7324219601283\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.198971862686285,\n" +
// "\t\t\"lon\": 116.73239393296355\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19883883071582,\n" +
// "\t\t\"lon\": 116.73237676435652\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19870171355796,\n" +
// "\t\t\"lon\": 116.73236052150362\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.1985491853193,\n" +
// "\t\t\"lon\": 116.73234157857011\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.1983890047355,\n" +
// "\t\t\"lon\": 116.73232167996464\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.1982209877466,\n" +
// "\t\t\"lon\": 116.73230101645792\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.198037574138326,\n" +
// "\t\t\"lon\": 116.73227735486083\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19787327856243,\n" +
// "\t\t\"lon\": 116.73225676816314\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19771917207499,\n" +
// "\t\t\"lon\": 116.73223814728027\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.197548305175935,\n" +
// "\t\t\"lon\": 116.73221624705808\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19739568979691,\n" +
// "\t\t\"lon\": 116.73219618210774\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19724703821575,\n" +
// "\t\t\"lon\": 116.73217598293311\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.1970956560885,\n" +
// "\t\t\"lon\": 116.73215773721505\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19697703483188,\n" +
// "\t\t\"lon\": 116.73214337172284\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19687000725696,\n" +
// "\t\t\"lon\": 116.73210037067965\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.196833449601726,\n" +
// "\t\t\"lon\": 116.73196646708011\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19685833847804,\n" +
// "\t\t\"lon\": 116.73181315361103\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.196889170203264,\n" +
// "\t\t\"lon\": 116.73164355747393\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19692242860347,\n" +
// "\t\t\"lon\": 116.7314555399657\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19696431701069,\n" +
// "\t\t\"lon\": 116.7312261834129\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19700025925464,\n" +
// "\t\t\"lon\": 116.73102774016093\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19703414798773,\n" +
// "\t\t\"lon\": 116.73084270562073\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19707287604138,\n" +
// "\t\t\"lon\": 116.73062835248406\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19710951629977,\n" +
// "\t\t\"lon\": 116.73041744082339\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19714593807105,\n" +
// "\t\t\"lon\": 116.73021414314803\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.197183297026285,\n" +
// "\t\t\"lon\": 116.7300057066447\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.1972247359487,\n" +
// "\t\t\"lon\": 116.7297751515664\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19726518822745,\n" +
// "\t\t\"lon\": 116.72954958923812\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19730538240706,\n" +
// "\t\t\"lon\": 116.72932440756041\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19734272112662,\n" +
// "\t\t\"lon\": 116.72911631453036\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.197379191549075,\n" +
// "\t\t\"lon\": 116.72890982812105\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.197417565369314,\n" +
// "\t\t\"lon\": 116.72869447869044\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19746052080799,\n" +
// "\t\t\"lon\": 116.72845641541247\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19750040582118,\n" +
// "\t\t\"lon\": 116.72823569991117\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19753999704064,\n" +
// "\t\t\"lon\": 116.72801998373052\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19757796882569,\n" +
// "\t\t\"lon\": 116.72781280504363\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.197617062364586,\n" +
// "\t\t\"lon\": 116.72759949431683\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19765391602761,\n" +
// "\t\t\"lon\": 116.72739776789756\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19768973009218,\n" +
// "\t\t\"lon\": 116.72719980764646\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.197726191028785,\n" +
// "\t\t\"lon\": 116.72699719861669\n" +
// "\t}, {\n" +
// "\t\t\"lat\": 40.19776233489642,\n" +
// "\t\t\"lon\": 116.72679516155276\n" +
// "\t}]}\n";
//
//
// List<MessagePad.Location> list = new ArrayList<>();
//
// try {
// JSONObject jsonObject = new JSONObject(listStr);
// JSONArray jsonElements = jsonObject.getJSONArray("models");
// for (int i = 0; i < jsonElements.length(); i++) {
// JSONObject s = jsonElements.getJSONObject(i);
// MessagePad.Location.Builder builder = MessagePad.Location.newBuilder();
// builder.setLatitude(s.getDouble("lat"));
// builder.setLongitude(s.getDouble("lon"));
// list.add(builder.build());
// }
// TaxiModel.getInstance().updateOrderRoute(list);
// TaxiModel.getInstance().updateOrderRouteInfo(list);
// } catch (JSONException e) {
// e.printStackTrace();
// }
}
public void clickTestBar() {

View File

@@ -199,7 +199,7 @@
android:id="@+id/btnAutopilotDisable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="模拟 不可自动驾驶"
android:text="模拟 自动驾驶Disable"
android:textSize="20sp"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
@@ -209,7 +209,7 @@
android:id="@+id/btnAutopilotEnable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="模拟 中途人工干预"
android:text="模拟 自动驾驶Enable"
android:textSize="20sp"
android:visibility="gone"
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
@@ -219,38 +219,18 @@
android:id="@+id/btnAutopilotRunning"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="模拟 自动驾驶途中"
android:text="模拟 自动驾驶Running"
android:textSize="20sp"
android:visibility="gone"
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
app:layout_constraintTop_toBottomOf="@id/btnAutopilotEnable" />
<Button
android:id="@+id/btnAutopilotArrive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="模拟 自动驾驶到站"
android:textSize="20sp"
android:visibility="gone"
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"
android:visibility="gone"
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,btnAutopilotControl"
app:constraint_referenced_ids="btnAutopilotDisable,btnAutopilotEnable,btnAutopilotRunning"
tools:visibility="gone" />
<FrameLayout
android:id="@+id/module_mogo_och_navi_panel_container"

View File

@@ -3,12 +3,14 @@
<string name="module_och_taxi_arrive_at_start_station">确认上车,行程开始</string>
<string name="module_och_taxi_arrive_at_end_station">到达站点,乘客已下车</string>
<string name="module_och_taxi_order_status_ph_text">已到达上车站点,等待乘客上车</string>
<string name="module_och_taxi_order_status_ph_text_check_success">乘客验证成功,请开始行程</string>
<string name="module_och_taxi_order_distance_anchor_text">预计里程</string>
<string name="module_och_taxi_order_distance_text_ph">3.2 km</string>
<string name="module_och_taxi_order_complete">请携带好随身物品,注意侧后\n方来车感谢体验蘑菇智行自\n动驾驶车</string>
<string name="module_och_taxi_order_complete_1">即将到达目的地,请您携带好随身物品,安全下车。</string>
<string name="module_och_taxi_on_the_way_2_end_station">送乘客至目的地</string>
<string name="module_och_taxi_waiting">等待乘客上车</string>
<string name="module_och_taxi_user_check_success">乘客已上车</string>
<string name="module_och_taxi_new_order">前往乘客上车地点</string>
<string name="module_och_taxi_arrive_at_end_station2">已到达乘客下车点</string>
<string name="module_och_taxi_order_completed">订单已完成</string>
@@ -17,9 +19,12 @@
<string name="module_och_taxi_order_cancel_tip">出现异常情况时,可选择原因无责取消订单:</string>
<string name="module_och_taxi_order_cancel_commit">确认</string>
<string name="module_och_taxi_order_server_start">开始服务</string>
<string name="module_och_taxi_order_server_start_wait_check">等待乘客验证</string>
<string name="module_och_taxi_order_server_end">服务完成</string>
<string name="module_och_taxi_order_server_completed_tip">车辆已停稳,请携带好随身物品,下车请注意安全</string>
<string name="module_och_taxi_order_server_start_auto_tip">无人驾驶已启动,请您系好安全带</string>
<string name="module_och_taxi_order_arrive_end_200m_tip">即将到达目的地,请拿好随身物品,准备下车</string>
<string name="module_och_taxi_order_auto_arrive_end_tip">已到达目的地,感谢乘坐\'蘑菇车联\'无人驾驶车,期待下次相遇</string>
<string name="module_och_taxi_auto_disable_tip">自动驾驶状态为0不可用</string>
</resources>

View File

@@ -238,7 +238,7 @@ dependencies {
debugImplementation rootProject.ext.dependencies.debugleakcanary
releaseImplementation rootProject.ext.dependencies.releaseleakcanary
implementation rootProject.ext.dependencies.android_start_up
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
implementation rootProject.ext.dependencies.ttspad
implementation rootProject.ext.dependencies.mogo_core_function_hmi

View File

@@ -19,6 +19,18 @@
android:usesCleartextTraffic="true"
tools:replace="android:label">
<provider
android:name="com.rousetime.android_startup.provider.StartupProvider"
android:authorities="${applicationId}.android_startup"
android:exported="false" >
<meta-data
android:name="com.mogo.launcher.stageone.HttpDnsStartUp"
android:value="android.startup" />
<meta-data
android:name="com.mogo.launcher.stageone.MogoStartupProviderConfig"
android:value="android.startup.provider.config" />
</provider>
<!-- 配置APP ID -->
<meta-data
android:name="BUGLY_APPID"

View File

@@ -1,20 +1,9 @@
package com.mogo.launcher;
import com.auto.zhidao.logsdk.CrashSystem;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.data.app.AppConfigInfo;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.config.HdMapBuildConfig;
import com.mogo.eagle.core.data.config.HmiBuildConfig;
import com.mogo.eagle.core.data.constants.MoGoConfig;
import com.mogo.eagle.core.function.call.analytics.AnalyticsManager;
import com.mogo.eagle.core.function.main.MainMoGoApplication;
import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.module.common.MogoModule;
import com.mogo.module.common.MogoModulePaths;
import com.mogo.test.crashreport.CrashReportConstants;
/**
* @author congtaowang
@@ -33,113 +22,9 @@ public class MogoApplication extends MainMoGoApplication {
crashSystem.setDebug(BuildConfig.DEBUG);
}
@Override
protected void initAnalyticsConfig() {
// 初始化埋点
AnalyticsManager.INSTANCE.init(this, DebugConfig.isDebug());
}
@Override
protected void initLogConfig() {
super.initLogConfig();
Logger.init(BuildConfig.DEBUG ? LogLevel.DEBUG : LogLevel.OFF);
}
@Override
protected void initCloudClientConfig() {
// 使用旧Socket链路 true = 旧链路false = 新链路
if (DebugConfig.getProductFlavor().equals("fPadLenovoOchTaxi")
|| DebugConfig.getProductFlavor().equals("fPadLenovoOchBus")
|| DebugConfig.getProductFlavor().equals("fPadLenovoOchTaxiPassenger")
|| DebugConfig.getProductFlavor().equals("fPadLenovoOchBusPassenger")) {
clientConfig.setUseOriginSocket(true);
}
}
@Override
protected void initBuildConfig() {
DebugConfig.setNetMode(BuildConfig.NET_ENV);
DebugConfig.setDebug(BuildConfig.DEBUG);
DebugConfig.setLaunchLocationService(BuildConfig.LAUNCH_LOCATION_SERVICE);
DebugConfig.setLauncher(BuildConfig.IS_LAUNCHER);
DebugConfig.setUseMockObuData(false);
DebugConfig.setCarMachineType(BuildConfig.CAR_MACHINE_TYPE);
DebugConfig.setProductFlavor(BuildConfig.FLAVOR_product);
DebugConfig.setSocketAppId(BuildConfig.SOCKET_APP_ID);
DebugConfig.setScheduleCalculateNotHomeCompanyDistanceForPush(BuildConfig.IS_SUPPORT_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH);
DebugConfig.setNeedUploadCoordinatesInTime(BuildConfig.IS_NEED_UPLOAD_COORDINATES_IN_TIME);
DebugConfig.setObuType(SharedPrefsMgr.getInstance(this).getInt("OBU_TYPE", DebugConfig.OBU_TYPE_CIDI));
// 初始化构建APP的时候的分支及提交HASH用于辅助定位问题
AppConfigInfo.INSTANCE.setWorkingBranchName(BuildConfig.WORKING_BRANCH_NAME);
AppConfigInfo.INSTANCE.setWorkingBranchHash(BuildConfig.WORKING_BRANCH_HASH);
AppConfigInfo.INSTANCE.setAppBuildTime(BuildConfig.APP_BUILD_TIME);
// 使用与渠道配置一样的gps提供者提供的数据,app/productFlavors/fPadLenovo.gradle GPS_PROVIDER 0-Android系统1-工控机2-OBU
FunctionBuildConfig.gpsProvider = BuildConfig.GPS_PROVIDER;
// 演示模式,上一次勾选的数据
FunctionBuildConfig.isDemoMode = BuildConfig.IS_DEMO_MODE;
// app安装的身份信息
FunctionBuildConfig.appIdentityMode = BuildConfig.APP_IDENTITY_MODE;
// 不同身份对应不同的IP地址
FunctionBuildConfig.adasConnectIP = BuildConfig.ADAS_CONNECT_IP;
// 配置BuglyAppIDMoGoEagleEye
CrashReportConstants.buglyAppID = "ac71228f85";
if (DebugConfig.getProductFlavor().equals("fPadLenovoOchTaxi")
|| DebugConfig.getProductFlavor().equals("fPadLenovoOchBus")
|| DebugConfig.getProductFlavor().equals("fPadLenovoOchTaxiPassenger")
|| DebugConfig.getProductFlavor().equals("fPadLenovoOchBusPassenger")) {
//控制HMI展示元素 将不用手动调用setXXXXXViewVisibility
HmiBuildConfig.isShowSpeedView = false;
HmiBuildConfig.isShowAutopilotStatusView = false;
HmiBuildConfig.isShowPerspectiveSwitchView = false;
HmiBuildConfig.isShowToolsView = false;
HmiBuildConfig.isShowBadCaseView = false;
HmiBuildConfig.isShowUpgradeTipsView = false;
//业务端可以根据需要控制是否展示刹车和转向灯的ui
// HmiBuildConfig.isShowBrakeLightView = false;
// HmiBuildConfig.isShowTurnLightView = false;
}
if (DebugConfig.getProductFlavor().equals("fPadLenovoOchTaxi")
|| DebugConfig.getProductFlavor().equals("fPadLenovoOchTaxiPassenger")) {
HdMapBuildConfig.currentCarVrIconRes = R.raw.chuzuche;
} else if (DebugConfig.getProductFlavor().equals("fPadLenovoOchBus")
|| DebugConfig.getProductFlavor().equals("fPadLenovoOchBusPassenger")) {
HdMapBuildConfig.currentCarVrIconRes = R.raw.xiaobache;
HmiBuildConfig.isShowBrakeLightView = false;
HmiBuildConfig.isShowTurnLightView = false;
}
if (DebugConfig.getProductFlavor().equals("fPadLenovoOchTaxiPassenger")) {
//是否显示 红绿等
HmiBuildConfig.isShowTrafficLightView = false;
//是否显示 限速UI
HmiBuildConfig.isShowLimitingVelocityView = false;
//是否显示 路侧监控
HmiBuildConfig.isShowCameraView = false;
} else if (DebugConfig.getProductFlavor().equals("fPadLenovoOchBusPassenger")) {
//是否显示 红绿等
HmiBuildConfig.isShowTrafficLightView = false;
//是否显示 限速UI
HmiBuildConfig.isShowLimitingVelocityView = false;
//是否显示 路侧监控
HmiBuildConfig.isShowCameraView = false;
//白天模式
FunctionBuildConfig.skinMode = 1;
}
//och模块
MogoModulePaths.addModuleFunction(new MogoModule("/och/api", "IMoGoFunctionProvider"));
}
@Override
protected void initConfigWithSP() {
// 是否是演示美化模式会存在SP中方便做现场恢复
FunctionBuildConfig.isDemoMode = SharedPrefsMgr.getInstance(this).getBoolean(MoGoConfig.IS_DEMO_MODE, false);
}
}

View File

@@ -0,0 +1,34 @@
package com.mogo.launcher.stageone
import android.app.Application
import android.content.Context
import com.alibaba.android.arouter.launcher.ARouter
import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.utilcode.util.AppUtils
import com.mogo.eagle.core.utilcode.util.CleanUtils
import com.rousetime.android_startup.AndroidStartup
import java.lang.Exception
class ARouterStartUp : AndroidStartup<String>() {
override fun callCreateOnMainThread() = true
override fun create(context: Context): String {
try {
if (DebugConfig.isDebug()) {
ARouter.openDebug()
ARouter.openLog()
}
// 初始化 arouter
ARouter.init(context as Application?)
} catch (e: Exception) {
e.printStackTrace()
// 由于ARouter会在SP_AROUTER_CACHE.xml缓存路由表如果出现了被删除的情况会报错这里清除下就好了
CleanUtils.cleanInternalSp()
// 重启应用
AppUtils.relaunchApp()
}
return this.javaClass.simpleName
}
override fun waitOnMainThread() = false
}

View File

@@ -0,0 +1,106 @@
package com.mogo.launcher.stageone
import android.content.Context
import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.data.app.AppConfigInfo.appBuildTime
import com.mogo.eagle.core.data.app.AppConfigInfo.workingBranchHash
import com.mogo.eagle.core.data.app.AppConfigInfo.workingBranchName
import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.rousetime.android_startup.AndroidStartup
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.config.HdMapBuildConfig
import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.test.crashreport.CrashReportConstants
import com.mogo.launcher.BuildConfig
import com.mogo.launcher.R
class ConfigStartUp : AndroidStartup<Boolean>() {
override fun callCreateOnMainThread() = true
override fun waitOnMainThread() = false
override fun create(context: Context): Boolean {
initDebugConfig(context)
initBuildConfig()
initOtherConfig(context)
return true
}
private fun initBuildConfig() {
// 初始化构建APP的时候的分支及提交HASH用于辅助定位问题
workingBranchName = BuildConfig.WORKING_BRANCH_NAME
workingBranchHash = BuildConfig.WORKING_BRANCH_HASH
appBuildTime = BuildConfig.APP_BUILD_TIME
// 使用与渠道配置一样的gps提供者提供的数据,app/productFlavors/fPadLenovo.gradle GPS_PROVIDER 0-Android系统1-工控机2-OBU
FunctionBuildConfig.gpsProvider = BuildConfig.GPS_PROVIDER
// 演示模式,上一次勾选的数据
FunctionBuildConfig.isDemoMode = BuildConfig.IS_DEMO_MODE
// app安装的身份信息
FunctionBuildConfig.appIdentityMode = BuildConfig.APP_IDENTITY_MODE
// 不同身份对应不同的IP地址
FunctionBuildConfig.adasConnectIP = BuildConfig.ADAS_CONNECT_IP
}
private fun initDebugConfig(context: Context) {
DebugConfig.setNetMode(BuildConfig.NET_ENV)
DebugConfig.setDebug(BuildConfig.DEBUG)
DebugConfig.setLaunchLocationService(BuildConfig.LAUNCH_LOCATION_SERVICE)
DebugConfig.setLauncher(BuildConfig.IS_LAUNCHER)
DebugConfig.setUseMockObuData(false)
DebugConfig.setCarMachineType(BuildConfig.CAR_MACHINE_TYPE)
DebugConfig.setProductFlavor(BuildConfig.FLAVOR_product)
DebugConfig.setSocketAppId(BuildConfig.SOCKET_APP_ID)
DebugConfig.setScheduleCalculateNotHomeCompanyDistanceForPush(BuildConfig.IS_SUPPORT_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH)
DebugConfig.setNeedUploadCoordinatesInTime(BuildConfig.IS_NEED_UPLOAD_COORDINATES_IN_TIME)
DebugConfig.setObuType(
SharedPrefsMgr.getInstance(context).getInt("OBU_TYPE", DebugConfig.OBU_TYPE_CIDI)
)
}
private fun initOtherConfig(context: Context) {
// 配置BuglyAppIDMoGoEagleEye
CrashReportConstants.buglyAppID = "ac71228f85"
if (DebugConfig.getProductFlavor() == "fPadLenovoOchTaxi" || DebugConfig.getProductFlavor() == "fPadLenovoOchBus" || DebugConfig.getProductFlavor() == "fPadLenovoOchTaxiPassenger" || DebugConfig.getProductFlavor() == "fPadLenovoOchBusPassenger") {
//控制HMI展示元素 将不用手动调用setXXXXXViewVisibility
HmiBuildConfig.isShowSpeedView = false
HmiBuildConfig.isShowAutopilotStatusView = false
HmiBuildConfig.isShowPerspectiveSwitchView = false
HmiBuildConfig.isShowToolsView = false
HmiBuildConfig.isShowBadCaseView = false
HmiBuildConfig.isShowUpgradeTipsView = false
}
if (DebugConfig.getProductFlavor() == "fPadLenovoOchTaxi" || DebugConfig.getProductFlavor() == "fPadLenovoOchTaxiPassenger") {
HdMapBuildConfig.currentCarVrIconRes = R.raw.chuzuche
} else if (DebugConfig.getProductFlavor() == "fPadLenovoOchBus" || DebugConfig.getProductFlavor() == "fPadLenovoOchBusPassenger") {
HdMapBuildConfig.currentCarVrIconRes = R.raw.xiaobache
HmiBuildConfig.isShowBrakeLightView = false
HmiBuildConfig.isShowTurnLightView = false
}
if (DebugConfig.getProductFlavor() == "fPadLenovoOchTaxiPassenger") {
//是否显示 红绿等
HmiBuildConfig.isShowTrafficLightView = false
//是否显示 限速UI
HmiBuildConfig.isShowLimitingVelocityView = false
//是否显示 路侧监控
HmiBuildConfig.isShowCameraView = false
} else if (DebugConfig.getProductFlavor() == "fPadLenovoOchBusPassenger") {
//是否显示 红绿等
HmiBuildConfig.isShowTrafficLightView = false
//是否显示 限速UI
HmiBuildConfig.isShowLimitingVelocityView = false
//是否显示 路侧监控
HmiBuildConfig.isShowCameraView = false
//白天模式
FunctionBuildConfig.skinMode = 1
}
// 是否是演示美化模式会存在SP中方便做现场恢复
FunctionBuildConfig.isDemoMode =
SharedPrefsMgr.getInstance(context).getBoolean(MoGoConfig.IS_DEMO_MODE, false)
}
}

View File

@@ -0,0 +1,276 @@
package com.mogo.launcher.stageone
import android.content.Context
import com.mogo.aicloud.services.httpdns.HttpDnsConst
import com.mogo.aicloud.services.httpdns.IMogoHttpDns
import com.mogo.aicloud.services.httpdns.MogoHttpDnsHandler
import com.mogo.aicloud.services.locationinfo.MogoLocationInfoServices
import com.mogo.aicloud.services.socket.IMogoLifecycleListener
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
import com.mogo.cloud.httpdns.MogoHttpDnsConfig
import com.mogo.cloud.httpdns.bean.HttpDnsSimpleLocation
import com.mogo.cloud.httpdns.listener.IHttpDnsCurrentLocation
import com.mogo.cloud.httpdns.listener.OnAddressChangedListener
import com.mogo.cloud.passport.IMoGoTokenCallback
import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.constants.SharedPrefsConstants
import com.mogo.commons.debug.DebugConfig
import com.mogo.commons.device.Devices
import com.mogo.commons.network.NetConfigUtils
import com.mogo.commons.network.Utils
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.call.analytics.AnalyticsManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.util.ProcessUtils
import com.mogo.eagle.core.utilcode.util.ThreadPoolService
import com.mogo.module.common.constants.HostConst
import com.rousetime.android_startup.AndroidStartup
import java.lang.NumberFormatException
class HttpDnsStartUp : AndroidStartup<Boolean>() {
private val TAG = "MogoApplication"
// 配置云服务API
private val clientConfig by lazy {
MoGoAiCloudClientConfig.getInstance()
}
// 缓存IP地址
private var cacheIp: String? = null
private lateinit var mogoHttpDns: IMogoHttpDns
private var context: Context? = null
override fun callCreateOnMainThread() = true
override fun waitOnMainThread() = false
override fun dependenciesByName(): List<String> {
return listOf("com.mogo.launcher.stageone.ARouterStartUp", "com.mogo.launcher.stageone.ConfigStartUp")
}
override fun create(context: Context): Boolean {
this.context = context
if (ProcessUtils.isMainProcess(context)) {
initHttpDns()
initCloudClientConfig()
}
return true
}
/**
* 初始化 HttpDNS ,这里会通过一个接口获取所有鹰眼中使用的微服务域名以及端口号
* 后续的网络请求会通过 HttpDnsInterceptor 进行拦截替换
*/
private fun initHttpDns() {
mogoHttpDns = MogoHttpDnsHandler.getHttpDnsApi()
preparePassportEnvironment()
}
private fun preparePassportEnvironment() {
// 设置网络环境HTTP_DNS_ENV_QA、HTTP_DNS_ENV_RELEASE、HTTP_DNS_ENV_DEV
when (DebugConfig.getNetMode()) {
DebugConfig.NET_MODE_DEV -> clientConfig.netMode = MogoHttpDnsConfig.HTTP_DNS_ENV_DEV
DebugConfig.NET_MODE_QA -> clientConfig.netMode = MogoHttpDnsConfig.HTTP_DNS_ENV_QA
DebugConfig.NET_MODE_DEMO -> clientConfig.netMode = MogoHttpDnsConfig.HTTP_DNS_ENV_DEMO
else -> clientConfig.netMode = MogoHttpDnsConfig.HTTP_DNS_ENV_RELEASE
}
// 设置是否是第三APP登录
clientConfig.isThirdLogin =
DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE
// 设置是否输出日志
clientConfig.isShowDebugLog = true
// 设置是否输出网络日志
clientConfig.isShowNetDebugLog = false
// 设置是否是直播推流的主播
clientConfig.isAnchor = true
when (DebugConfig.getCarMachineType()) {
DebugConfig.CAR_MACHINE_TYPE_BYD -> clientConfig.thirdPartyAppKey = "bydauto"
DebugConfig.CAR_MACHINE_TYPE_LENOVO -> clientConfig.thirdPartyAppKey = "pfieouqg"
else -> clientConfig.thirdPartyAppKey = "wbvpzgar"
}
// 设置应用服务AppId 长链、鉴权
if (DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE) {
clientConfig.serviceAppId = "com_mogo_launcher"
} else {
clientConfig.serviceAppId = "com.mogo.launcher"
}
// 设置AI云平台分配给三方应用的签名密钥需要从AI云平台申请
// 设置车机设备的唯一标识(这些表识必须是通过后台录入的设备)
clientConfig.thirdPartyDeviceId = Utils.getDevicesId()
// 设置循环检测间隔时间每隔2小时loop一次httpDnsConfig
clientConfig.loopCheckDelay = (60 * 60 * 2 * 1000).toLong()
//设置长链接的secretKey //todo 通过SHA1和包名找中台服务生成后续包名分渠道,需要做对应操作
clientConfig.secretKey = "YMj2VFDFxJ3Q4gNoZceJ"
// todo 使用旧链路
// clientConfig.setUseOriginSocket(true);
clientConfig.iHttpDnsCurrentLocation = object : IHttpDnsCurrentLocation {
override fun getCurrentLocation(): HttpDnsSimpleLocation? {
var mogoLocation: MogoLocation? = null
val locationClient =
CallerMapUIServiceManager.getSingletonLocationClient(AbsMogoApplication.getApp())
if (locationClient != null) {
mogoLocation = locationClient.lastKnowLocation
}
val httpDnsSimpleLocation =
if (mogoLocation != null && mogoLocation.latitude != 0.0 && mogoLocation.longitude != 0.0
) {
HttpDnsSimpleLocation(
mogoLocation.cityCode,
mogoLocation.latitude,
mogoLocation.longitude
)
} else {
val ciyCode =
SharedPrefsMgr.getInstance(
AbsMogoApplication.getApp()
)
.getString(SharedPrefsConstants.LOCATION_CITY_CODE)
val latitude =
SharedPrefsMgr.getInstance(
AbsMogoApplication.getApp()
)
.getString(SharedPrefsConstants.LOCATION_LATITUDE)
val longitude =
SharedPrefsMgr.getInstance(
AbsMogoApplication.getApp()
)
.getString(SharedPrefsConstants.LOCATION_LONGITUDE)
try {
HttpDnsSimpleLocation(
ciyCode, latitude.toDouble(), longitude.toDouble()
)
} catch (e: NumberFormatException) {
// e.printStackTrace();
HttpDnsSimpleLocation("010", 1.0, 1.0)
}
//CallerLogger.INSTANCE.d(M_HMI + TAG, "使用缓存GPS信息" + httpDnsSimpleLocation);
}
return httpDnsSimpleLocation
}
}
initAiCloudSDK()
}
private fun initAiCloudSDK() {
// 初始化SDK可以设置状态回调来监听
MoGoAiCloudClient.getInstance().init(context, clientConfig).addTokenCallbacks(
object : IMoGoTokenCallback {
override fun onTokenGot(token: String, sn: String) {
CallerLogger.d(SceneConstant.M_HMI + TAG, "onTokenGot ")
clientConfig.token = token
// 异步初始化NetConfig
asyncInit()
// HttpDns ttl回调 --- socketTTL
registerSocketHttpDnsTTL(HostConst.SOCKET_CENTER_DOMAIN)
// 开启每5s/次定位上报
uploadLocPerFiveSecond()
}
override fun onError(code: Int, msg: String) {
CallerLogger.d(
SceneConstant.M_HMI + TAG,
"初始化MogoAiCloudSdk failed ,reason : $msg , 未能开启长链服务和初始化Modules服务"
)
}
}
)
}
/**
* 异步初始化
*/
private fun asyncInit() {
ThreadPoolService.execute {
if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) {
Devices.init(AbsMogoApplication.getApp())
Devices.checkBindState()
}
//初始化网络配置
NetConfigUtils.init()
// 初始化埋点
AnalyticsManager.init(context, DebugConfig.isDebug())
}
}
/**
* 请求获取最新的 DNS 微服务 域名信息
*/
private fun registerSocketHttpDnsTTL(host: String?) {
mogoHttpDns.addressChangedListener(object : OnAddressChangedListener {
override fun onAddressChanged(address: Map<String, String>?) {
val dnsCacheIp = mogoHttpDns.getCachedHttpDnsIps(
host,
HttpDnsConst.HTTP_DNS_ADDRESS_TYPE_HTTP
) ?: return
if (dnsCacheIp != cacheIp) {
CallerLogger.d("TEST_SOCKET", "获取缓存Dns IP : $dnsCacheIp , 原缓存 IP $cacheIp")
startSocketService()
cacheIp = dnsCacheIp
}
}
})
}
/**
* 上传自车位置信息到云端
*/
private fun uploadLocPerFiveSecond() {
if (DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) {
context?.let {
MogoLocationInfoServices.getInstance().init(it)
MogoLocationInfoServices.getInstance().start()
val locationClient = CallerMapUIServiceManager.getSingletonLocationClient(it)
locationClient?.addLocationListener { location: MogoLocation? ->
MogoLocationInfoServices.getInstance().provideLocation(location)
}
}
}
}
private fun startSocketService() {
CallerLogger.d(SceneConstant.M_HMI + TAG, "startSocketService")
val location = CallerMapUIServiceManager.getSingletonLocationClient(AbsMogoApplication.getApp())!!
.lastKnowLocation
// 关闭长链服务
MogoAiCloudSocketManager.getInstance(context).destroy()
MogoAiCloudSocketManager.getInstance(context)
.registerLifecycleListener(10020, object : IMogoLifecycleListener {
override fun onConnectFailure() {
CallerLogger.d(SceneConstant.M_HMI + TAG, "socket-onConnectFailure")
DebugConfig.setDownloadSnapshot(false)
}
override fun onConnectSuccess() {
CallerLogger.d(SceneConstant.M_HMI + TAG, "socket-onConnectSuccess")
DebugConfig.setDownloadSnapshot(true)
}
override fun onConnectLost() {
CallerLogger.d(SceneConstant.M_HMI + TAG, "socket-onConnectLost")
DebugConfig.setDownloadSnapshot(false)
}
})
// 开启Socket长链服务
val lat = location.latitude
val lon = location.longitude
MogoAiCloudSocketManager.getInstance(context)
.init(context, DebugConfig.getSocketAppId(), lat, lon)
}
private fun initCloudClientConfig() {
// 使用旧Socket链路 true = 旧链路false = 新链路
if (DebugConfig.getProductFlavor() == "fPadLenovoOchTaxi" || DebugConfig.getProductFlavor() == "fPadLenovoOchBus" || DebugConfig.getProductFlavor() == "fPadLenovoOchTaxiPassenger" || DebugConfig.getProductFlavor() == "fPadLenovoOchBusPassenger") {
clientConfig.isUseOriginSocket = true
}
}
}

View File

@@ -0,0 +1,26 @@
package com.mogo.launcher.stageone
import com.mogo.launcher.BuildConfig
import com.rousetime.android_startup.model.LoggerLevel
import com.rousetime.android_startup.model.StartupConfig
import com.rousetime.android_startup.provider.StartupProviderConfig
class MogoStartupProviderConfig: StartupProviderConfig {
override fun getConfig(): StartupConfig {
return when {
BuildConfig.DEBUG -> {
StartupConfig.Builder()
.setLoggerLevel(LoggerLevel.DEBUG)
.setOpenStatistics(true)
.build()
}
else -> {
StartupConfig.Builder()
.setLoggerLevel(LoggerLevel.NONE)
.setOpenStatistics(false)
.setAwaitTimeout(10000L)
.build()
}
}
}
}

View File

@@ -18,6 +18,11 @@ android {
//解决编译时com.android.builder.merge.DuplicateRelativeFileException: More than one file was found with OS independent path 'META-INF/rxjava.properties'这个错误
exclude 'META-INF/rxjava.properties'
}
externalNativeBuild {
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a'
}
}
}
buildTypes {
@@ -64,7 +69,9 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation rootProject.ext.dependencies.gson
implementation project(':libraries:mogo-adas')
implementation project(':core:mogo-core-data')
// implementation 'com.zhidao.support.adas:high:2.6.6.0'
// implementation 'com.zhjt.mogo.adas.data:adas-data:2.6.6.0'
compileOnly project(':core:mogo-core-data')
implementation project(':core:mogo-core-utils')
implementation 'org.greenrobot:eventbus:3.2.0'
implementation 'com.android.support:multidex:1.0.3'

View File

@@ -73,6 +73,7 @@ import com.zhidao.support.adas.high.OnAdasConnectStatusListener;
import com.zhidao.support.adas.high.OnAdasListener;
import com.zhidao.support.adas.high.OnMultiDeviceListener;
import com.zhidao.support.adas.high.bean.IPCUpgradeStateInfo;
import com.zhidao.support.adas.high.bean.VersionCompatibility;
import com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS;
import com.zhidao.support.adas.high.common.CupidLogUtils;
import com.zhidao.support.adas.high.common.ProtocolStatus;
@@ -265,6 +266,40 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
disconnect.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// MessagePad.Header header = MessagePad.Header.newBuilder()
// .setTimestamp(1.6523361438761907E9).build();
// PointCloud.LidarPointCloud pointCloud = PointCloud.LidarPointCloud.newBuilder()
// .setSelfLongitude(112.57563687979261)
// .setSelfLatitude(26.828128487326854)
// .setSelfAltitude(52.89)
// .setSelfRoll(-0.00715584993317675)
// .setSelfPitch(0.008726646259971651)
// .setSelfYaw(0.4850269854068756)
//
// .addAddData(1F)
// .addAddData(2F)
// .addAddData(3F)
// .addAddData(4F)
// .addAddData(5F)
// .addAddData(6F)
// .addAddData(7F)
// .addAddData(8F)
//
// .addDelData(9F)
// .addDelData(10F)
// .addDelData(11F)
// .addDelData(12F)
// .addDelData(13F)
// .addDelData(14F)
// .addDelData(15F)
// .addDelData(16F)
// .addDelData(17F)
// .addDelData(18F)
// .addDelData(19F)
// .addDelData(20F)
// .build();
// String data = PointCloudDecoder.decode(header, pointCloud);
// Log.i("ddd", "转换数据=" + data);
connect(false);
}
});
@@ -813,6 +848,9 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
public void onPointCloud(MessagePad.Header header, PointCloud.LidarPointCloud pointCloud) {
MyPointCloud base = new MyPointCloud(header, pointCloud);
DataDistribution.getInstance().addData(base);
// String data = PointCloudDecoder.decode(header, pointCloud);
// Log.i("dddd", "data==" + data.length());
// LogSave.getInstance().saveLog("转换数据=" + data);
}
@Override
@@ -987,6 +1025,11 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
CupidLogUtils.i(TAG, "connectStatus=" + status);
}
@Override
public void onCompatibility(VersionCompatibility versionCompatibility) {
showToastCenter("所连工控机:\n" + versionCompatibility.toString(), Toast.LENGTH_LONG);
}
private void showLocalIP() {
showToastCenter("已刷新本机IP");
localIp.setText("本机IP" + getIpAddressString());

View File

@@ -22,9 +22,9 @@ import com.zhidao.adas.client.BuildConfig;
import com.zhidao.adas.client.R;
import com.zhidao.adas.client.adapter.ConfigAdapter;
import com.zhidao.adas.client.base.BaseFragment;
import com.zhidao.adas.client.bean.CarConfigResp;
import com.zhidao.adas.client.bean.Config;
import com.zhidao.support.adas.high.AdasManager;
import com.zhidao.support.adas.high.bean.VersionCompatibility;
import com.zhidao.support.adas.high.common.CupidLogUtils;
import java.util.ArrayList;
@@ -169,6 +169,8 @@ public class VersionFragment extends BaseFragment {
list.add(new Config("最大加速度:", adasConfig == null ? null : adasConfig.getMaxAcceleration() + "m/s²"));
list.add(new Config("IPC通信协议版本:", adasConfig == null ? null : String.valueOf(adasConfig.getProtocolVersionValue())));
list.add(new Config("APP通信协议版本:", String.valueOf(AdasManager.getInstance().getProtocolVersion())));
VersionCompatibility versionCompatibility = AdasManager.getInstance().getVersionCompatibility();
list.add(new Config("版本兼容性:", versionCompatibility == null ? null : versionCompatibility.toString()));
}
list.add(new Config("ADAS LIB版本:", AdasManager.getInstance().getAdasVersion()));
list.add(new Config("APP构建时间:", BuildConfig.BUILD_TIME));

View File

@@ -238,7 +238,7 @@ ext {
//========================= DataStore ======================
androidx_datastore_preferences : "androidx.datastore:datastore-preferences:1.0.0",
androidx_datastore : "androidx.datastore:datastore:1.0.0",
android_start_up : "io.github.idisfkj:android-startup:1.1.0"
]
}

View File

@@ -51,7 +51,6 @@ dependencies {
kapt rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.mogochainbase
implementation rootProject.ext.dependencies.mogoami
implementation rootProject.ext.dependencies.mogoaicloudtelematic

View File

@@ -11,6 +11,10 @@ import com.mogo.eagle.core.data.autopilot.toRouteInfo
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_MULTI_CONNECT
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_ADAS
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.data.trafficlight.toTrafficLightDetail
@@ -39,10 +43,13 @@ import com.mogo.telematic.server.netty.NettyTcpServer
import com.zhidao.support.adas.high.AdasManager
import com.zhidao.support.adas.high.AdasOptions
import com.zhidao.support.adas.high.bean.IPCUpgradeInfo
import com.zhidao.support.adas.high.chain.AdasChain.CHAIN_LINK_LOG_CONNECT_STATUS
import com.zhidao.support.adas.high.common.Constants
import com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS
import com.zhidao.support.adas.high.common.CupidLogUtils
import com.zhidao.support.adas.high.common.MogoReport
import com.zhjt.service.chain.ChainLog
import com.zhjt.service.chain.TracingConstants
import io.netty.channel.Channel
import mogo.telematics.pad.MessagePad
import java.util.concurrent.TimeUnit
@@ -95,23 +102,26 @@ class MoGoAutopilotProvider :
platNumberArray.size, platNumberArray
), channel
) {
CallerLogger.d("$M_ADAS_IMPL$TAG", "司机发送车牌号到乘客是否成功:${it.isSuccess}")
invokeNettyConnResult("司机发送车牌号到乘客是否成功:${it.isSuccess}")
}
} else {
CallerAutoPilotManager.getCarConfig()
}
}
else -> {}
else -> {
}
}
}
}
override fun onStartServer() {
ToastUtils.showShort("司机端服务启动成功!")
invokeNettyConnResult("司机端服务启动成功!")
}
override fun onStopServer() {
ToastUtils.showLong("司机端服务停止!")
invokeNettyConnResult("司机端服务停止!")
}
override fun onChannelConnect(channel: Channel?) {
@@ -240,13 +250,27 @@ class MoGoAutopilotProvider :
}
override fun startAutoPilot(controlParameters: AutopilotControlParameters) {
if (AdasManager.getInstance().ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.CONNECTED) {
AdasManager.getInstance().sendAutoPilotModeReq(1, 1, controlParameters.toRouteInfo())
if (AdasManager.getInstance().ipcConnectionStatus == IPC_CONNECTION_STATUS.CONNECTED) {
val invokeResult = AdasManager.getInstance().sendAutoPilotModeReq(1, 1, controlParameters.toRouteInfo())
invokeAutoPilotResult(if (invokeResult) "自动驾驶调用成功" else "自动驾驶调用失败, socket 或者 rawPack 可能为空")
} else {
invokeAutoPilotResult("车机与工控机链接失败,无法开启自动驾驶")
CallerLogger.e("$M_ADAS_IMPL$TAG", "车机与工控机链接失败,无法开启自动驾驶")
}
}
@ChainLog(
linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT,
linkCode = CHAIN_LINK_ADAS,
endpoint = TracingConstants.Endpoint.PAD,
nodeAliasCode = ChainConstant.CHAIN_ALIAS_CODE_EAGLE_START_AUTOPILOT_RESULT,
paramIndexes = [0],
clientPkFileName = "sn"
)
private fun invokeAutoPilotResult(status: String) {
CallerLogger.e("$M_ADAS_IMPL$TAG", status)
}
override fun sendTrafficLightData(trafficLightResult: TrafficLightResult) {
AdasManager.getInstance().sendTrafficLightData(
trafficLightResult.crossId,
@@ -449,49 +473,51 @@ class MoGoAutopilotProvider :
}
private fun handleMsgFromServer(msg: MogoProtocolMsg?, channel: Channel) {
try {
msg?.let {
when (it.protocolType) {
NORMAL_DATA -> AdasManager.getInstance().parseIPCData(it.body)
SYNC_MODE_STATUS -> {
FunctionBuildConfig.isDemoMode = when (it.body[0].toInt()) {
1 -> true
else -> false
}
setDemoMode(FunctionBuildConfig.isDemoMode)
msg?.let {
when (it.protocolType) {
NORMAL_DATA -> {
try {
AdasManager.getInstance().parseIPCData(it.body)
} catch (e: Exception) {
e.printStackTrace()
CallerLogger.e("$M_ADAS_IMPL$TAG", "乘客屏解析数据过程中出现异常:${e.message}")
}
REQ_CAR_NUMBER -> {
AppConfigInfo.plateNumber = String(msg.body)
}
SYNC_MODE_STATUS -> {
FunctionBuildConfig.isDemoMode = when (it.body[0].toInt()) {
1 -> true
else -> false
}
else -> {}
setDemoMode(FunctionBuildConfig.isDemoMode)
}
REQ_CAR_NUMBER -> {
AppConfigInfo.plateNumber = String(msg.body)
invokeNettyConnResult("司机屏发送给乘客屏车牌号为:${AppConfigInfo.plateNumber}")
}
else -> {
}
}
} catch (e: Exception) {
e.printStackTrace()
CallerLogger.e("$M_ADAS_IMPL$TAG", "乘客屏解析数据流程中出现异常:${e.message}")
}
}
private fun handleConnStatusWithServer(statusCode: Int, sign: String?) {
when (statusCode) {
ConnectState.STATUS_CONNECT_SUCCESS -> {
CallerLogger.d("$M_ADAS_IMPL$TAG", "乘客端连接司机端服务成功! sign is:${sign}")
ToastUtils.showShort("连接司机屏成功!")
invokeNettyConnResult("乘客屏连接司机屏成功司机屏SN为$sign")
// 连接成功后,乘客屏没拿到车牌号就像司机屏请求
if (AppConfigInfo.plateNumber.isNullOrEmpty()) {
var byteArray = byteArrayOf(0)
NSDNettyManager.getInstance().sendMogoProtocolMsgToServer(
MogoProtocolMsg(REQ_CAR_NUMBER, byteArray.size, byteArray)
) {
CallerLogger.d("$M_ADAS_IMPL$TAG", "请求车牌号数据发送是否成功:${it}")
invokeNettyConnResult("乘客屏请求车牌号数据发送是否成功:${it}")
}
}
}
else -> {
ToastUtils.showLong("和司机端连接异常!")
CallerLogger.d(
"$M_ADAS_IMPL$TAG",
"client statusCode is:${statusCode}"
)
invokeNettyConnResult("乘客屏和司机屏连接异常,状态码为:$statusCode")
}
}
}
@@ -499,5 +525,18 @@ class MoGoAutopilotProvider :
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
// 乘客屏才监听
AppConfigInfo.plateNumber = carConfigResp.plateNumber
invokeNettyConnResult("乘客屏车牌号:${carConfigResp.plateNumber}")
}
@ChainLog(
linkChainLog = CHAIN_LINK_LOG_CONNECT_STATUS,
linkCode = CHAIN_LINK_ADAS,
endpoint = TracingConstants.Endpoint.PAD,
nodeAliasCode = CHAIN_ALIAS_CODE_MULTI_CONNECT,
paramIndexes = [0],
clientPkFileName = "sn"
)
private fun invokeNettyConnResult(status: String) {
CallerLogger.d("$M_ADAS_IMPL$TAG", status)
}
}

View File

@@ -25,17 +25,14 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeAutopilotSNRequest
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager.invokeAutopilotCarConfigData
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager.invokeAutopilotCarStateData
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager.invokeAutopilotIdentifyDataUpdate
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordResult
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager.invokeAutopilotWarnMessage
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager.invokeAutopilotRotting
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager.invokeAutopilotTrajectory
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showAdUpgradeStatus
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showDockerRebootResult
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL
import com.zhidao.support.adas.high.AdasManager
import com.zhidao.support.adas.high.OnAdasListener
import com.zhidao.support.adas.high.bean.IPCUpgradeStateInfo
@@ -228,7 +225,11 @@ class MoGoAdasListenerImpl : OnAdasListener {
header: MessagePad.Header?,
trafficLights: TrafficLightOuterClass.TrafficLights?
) {
if(trafficLights != null){
CallerAutopilotIdentifyListenerManager.invokeAutopilotPerceptionTrafficLight(
trafficLights
)
}
}
override fun onPredictionObstacleTrajectory(
@@ -327,23 +328,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
}
override fun onUpgradeStateInfo(info: IPCUpgradeStateInfo) {
if (info != null) {
CallerLogger.d(
"$M_ADAS_IMPL$TAG", "onUpgradeStateInfo " +
" upgrade mode=" + info.upgradeMode +
" download status=" + info.downloadStatus +
" download progress current=" + info.progress.current +
" download progress total=" + info.progress.total +
" download version=" + info.images +
" upgrade status=" + info.upgradeStatus
)
showAdUpgradeStatus(
info.upgradeMode, info.downloadStatus, info.progress.current,
info.progress.total, info.images, info.upgradeStatus
)
} else {
CallerLogger.w("$M_ADAS_IMPL$TAG", "onUpgradeStateInfo : upgrade state info is null")
}
}
// override fun onSSHResult(info: com.zhidao.adas.client.ssh.SSHResult?) {

View File

@@ -12,6 +12,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.zhidao.support.adas.high.AdasManager
import com.zhidao.support.adas.high.OnAdasConnectStatusListener
import com.zhidao.support.adas.high.bean.VersionCompatibility
import com.zhidao.support.adas.high.common.Constants
import io.reactivex.Flowable
import io.reactivex.android.schedulers.AndroidSchedulers
@@ -78,6 +79,10 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
CallerAutoPilotStatusListenerManager.invokeAutoPilotStatus()
}
override fun onCompatibility(versionCompatibility: VersionCompatibility?) {
// 与所连接工控机版本兼容性检查通知
}
/**
* 工控机获取SN
*/

View File

@@ -1,7 +1,6 @@
package com.mogo.eagle.core.function.bindingcar;
import android.content.Context;
import android.util.Log;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
@@ -10,6 +9,7 @@ import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.mogo.eagle.core.function.api.bindingcar.BindingcarCallBack;
import com.mogo.eagle.core.function.api.bindingcar.IMoGoBindingcarProvider;
import com.mogo.eagle.core.function.bindingcar.network.BindingcarNetWorkManager;
import com.mogo.eagle.core.function.ipcupgrade.IPCUpgradeManager;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import org.jetbrains.annotations.NotNull;
@@ -34,12 +34,13 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
@Override
public void onDestroy() {
IPCUpgradeManager.Companion.getINSTANCE().destroy();
}
@Override
public void init(Context context) {
mContext = context;
IPCUpgradeManager.Companion.getINSTANCE().initServer(context);
}
/**

View File

@@ -0,0 +1,64 @@
package com.mogo.eagle.core.function.ipcupgrade
import android.content.Context
import android.util.Log
import com.mogo.aicloud.services.socket.IMogoOnMessageListener
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
/**
* @author XuXinChao
* @description 工控机镜像版本升级管理
* @since: 2022/5/12
*/
class IPCUpgradeManager: IMogoOnMessageListener<IPCUpgradeStateInfo> ,
IMoGoAutopilotStatusListener {
companion object{
const val TAG ="IPCUpgradeManager"
const val IPC_UPGRADE_MSG_TYPE = 50000
val INSTANCE: IPCUpgradeManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED){
IPCUpgradeManager()
}
}
private var mContext: Context? = null
fun initServer(context: Context){
mContext = context
//添加长链接监听
MogoAiCloudSocketManager.getInstance(context)
.registerOnMessageListener(IPC_UPGRADE_MSG_TYPE, this)
// 添加 ADAS状态 监听
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
}
override fun target(): Class<IPCUpgradeStateInfo> {
return IPCUpgradeStateInfo::class.java
}
override fun onMsgReceived(obj: IPCUpgradeStateInfo?) {
}
/**
* 自动驾驶状态信息
* @param autoPilotStatusInfo 状态信息
*/
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
}
fun destroy(){
//注销长链接监听
MogoAiCloudSocketManager.getInstance(mContext)
.unregisterLifecycleListener(IPC_UPGRADE_MSG_TYPE)
// 移除 ADAS状态 监听
CallerAutoPilotStatusListenerManager.removeListener(TAG)
mContext = null
}
}

View File

@@ -11,6 +11,7 @@ import com.mogo.eagle.core.function.check.net.CheckNetWork.checkNetWork
import com.mogo.eagle.core.function.check.net.CheckResultData
import com.mogo.eagle.core.function.check.view.CheckActivity
import com.mogo.eagle.core.function.check.view.CheckDialog
import com.mogo.eagle.core.function.report.IPCReportManager
import com.mogo.eagle.core.utilcode.util.*
import com.mogo.module.common.MogoApisHandler
import com.mogo.service.statusmanager.IMogoStatusChangedListener
@@ -31,6 +32,10 @@ class VehicleMonitoringManager : ICheckProvider, IMogoStatusChangedListener {
private val mListeners: ConcurrentHashMap<String, IMogoCheckListener> = ConcurrentHashMap()
private var hasTipShow = false //是否已经弹框提示
var dialog: CheckDialog? = null
override val functionName: String
get() = "VehicleMonitoringManager"
override fun init(context: Context) {
mContext = context
MogoApisHandler.getInstance().apis.statusManagerApi.registerStatusChangedListener(
@@ -38,6 +43,8 @@ class VehicleMonitoringManager : ICheckProvider, IMogoStatusChangedListener {
StatusDescriptor.MAIN_PAGE_RESUME,
this
)
//开启工控机监控节点上报服务
IPCReportManager.INSTANCE.initServer()
}
override fun registerVehicleMonitoringListener(module: String, listener: IMogoCheckListener) {
@@ -113,4 +120,10 @@ class VehicleMonitoringManager : ICheckProvider, IMogoStatusChangedListener {
}
}
}
override fun onDestroy() {
//停止工控机监控节点上报服务
IPCReportManager.INSTANCE.destroy()
}
}

View File

@@ -0,0 +1,58 @@
package com.mogo.eagle.core.function.report
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.TimeUtils
import mogo_msg.MogoReportMsg
/**
* @author XuXinChao
* @description 工控机监控节点信息上报管理
* @since: 2022/5/12
*/
class IPCReportManager : IMoGoAutopilotStatusListener {
private var ipcReportList = arrayListOf<ReportEntity>()
companion object{
const val TAG ="IPCReportManager"
val INSTANCE: IPCReportManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
IPCReportManager()
}
}
fun initServer(){
// 添加 ADAS状态 监听
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
}
/**
*工控机监控节点上报
*/
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
guardianInfo?.let{
if(it.level=="error"){
if(ipcReportList.size>20){
ipcReportList.removeLast()
}
ipcReportList.add(0,
ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()),
it.src,it.level,it.msg,it.code,it.resultList,it.actionsList))
//当前不处于美化模式时,展示监控节点上报
if(!FunctionBuildConfig.isDemoMode){
CallerHmiManager.showIPCReportWindow(ipcReportList)
}
}
}
}
fun destroy(){
// 移除 ADAS状态 监听
CallerAutoPilotStatusListenerManager.removeListener(TAG)
}
}

View File

@@ -72,7 +72,6 @@ dependencies {
implementation rootProject.ext.dependencies.arouter
kapt rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.mogologlib
implementation rootProject.ext.dependencies.mogochainbase
implementation rootProject.ext.dependencies.androidx_datastore
implementation rootProject.ext.dependencies.androidxroomruntime

View File

@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
import android.content.Context
import android.os.Handler
import android.os.Message
import com.mogo.aicloud.services.socket.IMogoOnMessageListener
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
@@ -11,8 +12,10 @@ import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.function.api.map.deva.IMoGoMapDevaProvider
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapDevaListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
@@ -20,7 +23,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.aicloud.services.socket.IMogoOnMessageListener
import com.zhidao.loglib.bean.RemoteLogPushContent
import com.zhidao.loglib.call.LogInfoManagerFactory
import com.zhidao.loglib.core.ILogListener
@@ -30,10 +32,11 @@ import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchConst.Companio
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchConst.Companion.LOG_PUSH_TYPE
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchConst.Companion.START_CATCH_LOG
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchConst.Companion.STOP_CATCH_LOG
import java.io.File
@SuppressLint("StaticFieldLeak")
object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handler.Callback,
ILogListener {
ILogListener, IMoGoMapDevaProvider {
private const val TAG = "MogoLogCatchManager"
private const val MSG_TRY_CLOSE_LOG = 1001
@@ -50,6 +53,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
mContext = context
MogoAiCloudSocketManager.getInstance(AbsMogoApplication.getApp().applicationContext)
.registerOnMessageListener(LOG_PUSH_TYPE, this)
CallerMapDevaListenerManager.addListener(TAG, this)
manualContent.pkgName = context.packageName
logCheck(context)
}
@@ -107,7 +111,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
}
override fun handleMessage(msg: Message): Boolean {
when(msg.what){
when (msg.what) {
MSG_TRY_CLOSE_LOG -> {
CallerDevaToolsListenerManager.invokeDevaToolsLogCatchClose()
closeLoggerLevel()
@@ -225,10 +229,20 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
}
}
override fun uploadFile(filePath: String) {
val file = File(filePath)
if (file.isFile) {
CallerLogger.d("$M_DEVA$TAG", "uploadFile path : $filePath")
LogInfoManagerFactory.handleSingleUploadFile(filePath)
}else{
CallerLogger.d("$M_DEVA$TAG", "file absPath : ${file.absolutePath}")
}
}
fun onDestroy() {
MogoAiCloudSocketManager.getInstance(AbsMogoApplication.getApp().applicationContext)
.unregisterLifecycleListener(LOG_PUSH_TYPE)
CallerMapDevaListenerManager.removeListener(this)
if (handler.hasMessages(MSG_TRY_CLOSE_LOG)) {
handler.removeMessages(MSG_TRY_CLOSE_LOG)
}

View File

@@ -4,6 +4,7 @@ import android.content.Context
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.data.deva.chain.ChainLogParam
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
import com.mogo.eagle.core.utilcode.util.DeviceUtils
@@ -33,15 +34,15 @@ class TraceManager {
// Trace过程中进行日志抓取对日志进行配置
fwBuildMap[ChainConstant.CHAIN_LINK_LOG_CONNECT_STATUS] =
FwBuild(true, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_INIT)
FwBuild(true, -1,pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_INIT)
fwBuildMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT] =
FwBuild(true, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_AUTO)
FwBuild(true, -1,pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_AUTO)
fwBuildMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_DATA_TRACKED] =
FwBuild(false, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_DATA_TRACK)
FwBuild(false, 2,pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_DATA_TRACK)
fwBuildMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_TRAJECTORY] =
FwBuild(false, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_TRAJECTORY)
FwBuild(false, 30,pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_TRAJECTORY)
fwBuildMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_VEHICLE] =
FwBuild(false, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_VEHICLE)
FwBuild(false, 30,pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_VEHICLE)
traceInfoCache[ChainConstant.CHAIN_LINK_LOG_CONNECT_STATUS] =
ChainLogParam(true, "ADAS连接状态")
@@ -56,6 +57,14 @@ class TraceManager {
FileWriteManager.getInstance()
.init(context, MoGoAiCloudClientConfig.getInstance().sn, pkgName, fwBuildMap)
FileWriteManager.getInstance().registerListener { type ->
val param = traceInfoCache[type]
param?.let {
it.record = false
traceInfoCache[type] = it
}
CallerDevaToolsListenerManager.invokeDevaToolsFwThreadClose()
}
}
fun setTraceLogEnable(enable:Boolean){

View File

@@ -73,8 +73,7 @@ dependencies {
implementation rootProject.ext.dependencies.mogoami
implementation rootProject.ext.dependencies.mogochainbase
implementation rootProject.ext.dependencies.android_start_up
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
api rootProject.ext.dependencies.mogoaicloudservicesdk
api rootProject.ext.dependencies.mogocommons

View File

@@ -89,8 +89,10 @@ internal class WarningFloatWindowHelper(
// 将浮窗布局文件添加到父容器frameLayout中并返回该浮窗文件
val floatingView = config.layoutView?.also {
try {
val parent = (it.parent as ViewGroup)
parent.removeAllViews()
if (it.parent != null) {
val parent = (it.parent as ViewGroup)
parent.removeAllViews()
}
} catch (e: Exception) {
e.printStackTrace()
}

View File

@@ -11,9 +11,9 @@ import android.view.WindowManager.LayoutParams
import android.view.animation.*
import androidx.lifecycle.lifecycleScope
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.mvp.MvpFragment
import com.mogo.commons.voice.AIAssist
import com.mogo.eagle.core.data.autopilot.AdUpgradeStateHelper
import com.mogo.eagle.core.data.camera.CameraEntity
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.config.HmiBuildConfig
@@ -47,6 +47,7 @@ import com.mogo.eagle.core.function.hmi.ui.camera.CameraListView
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeBannerView
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeNormalBannerView
import com.mogo.eagle.core.function.hmi.ui.setting.DebugSettingView
import com.mogo.eagle.core.function.hmi.ui.setting.IPCReportWindow
import com.mogo.eagle.core.function.hmi.ui.setting.ReportListFloatWindow
import com.mogo.eagle.core.function.hmi.ui.tools.AutoPilotAndCheckView
import com.mogo.eagle.core.function.hmi.ui.widget.V2XNotificationView
@@ -62,6 +63,7 @@ import kotlinx.coroutines.*
import mogo_msg.MogoReportMsg
import record_cache.RecordPanelOuterClass
import java.util.*
import kotlin.collections.ArrayList
/**
@@ -112,6 +114,8 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
private var reportList = arrayListOf<ReportEntity>()
//工控机上报列表悬浮窗
private var reportListFloatWindow: ReportListFloatWindow?=null
private var ipcReportWindow: IPCReportWindow?=null
override fun vipIdentification(visible: Boolean) {
ThreadUtils.runOnUiThread {
@@ -210,13 +214,28 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
ToastUtils.showShort("重启成功")
} else {
//重启失败
msg?.let {
msg.let {
ToastUtils.showShort(it)
}
}
}
}
/**
* 展示工控机监控上报数据
* @param reportList 上报数据列表
*/
override fun showIPCReportWindow(reportList: ArrayList<ReportEntity>) {
ThreadUtils.runOnUiThread{
if(ipcReportWindow==null){
ipcReportWindow= activity?.let { IPCReportWindow(it) }
ipcReportWindow?.showFloatWindow()
AIAssist.getInstance(AbsMogoApplication.getApp()).speakTTSVoice("")
}
ipcReportWindow?.refreshData(reportList)
}
}
/**
* 设置 V2X 通知 代理View
*/
@@ -950,60 +969,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
HmiBuildConfig.isShowSnBindingView = isOpen
}
/**
* 展示工控机下载、升级状态信息
* @param upgradeMode 升级模式(提示升级、静默升级)
* @param downloadStatus 下载状态
* @param currentProgress 当前已经下载包体大小
* @param totalProgress 下载包体总大小
* @param downloadVersion 下载版本
* @param upgradeStatus 升级状态
*/
override fun showAdUpgradeStatus(
upgradeMode: Int,
downloadStatus: Int,
currentProgress: Int,
totalProgress: Int,
downloadVersion: String,
upgradeStatus: Int
) {
ThreadUtils.runOnUiThread {
val tipsView = upgradeTipsView?.invoke()
//如果工控机处于“下载中”、“可升级(下载完成)”、“升级中”、“升级失败”状态时,工具箱入口显示红色角标
if (AdUpgradeStateHelper.showUpgradeTips(downloadStatus, upgradeStatus)) {
if (HmiBuildConfig.isShowUpgradeTipsView) {
viewUpgradeTips?.visibility = View.VISIBLE
} else {
tipsView?.let {
it.visibility = View.VISIBLE
}
}
} else {
viewUpgradeTips?.visibility = View.GONE
tipsView?.let {
it.visibility = View.GONE
}
}
//将状态同步到工具箱
toolsView?.showAdUpgradeStatus(
upgradeMode,
downloadStatus,
currentProgress,
totalProgress,
downloadVersion,
upgradeStatus
)
//将状态同步到调试窗
mDebugSettingView?.setAdUpgradeInfo(
upgradeMode,
downloadStatus,
currentProgress,
totalProgress,
downloadVersion,
upgradeStatus)
}
}
/**
* 工控机监控节点上报

View File

@@ -48,8 +48,6 @@ import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.logcatch.ILogViewListener
import com.mogo.eagle.core.function.hmi.ui.logcatch.LogInfoView
import com.mogo.eagle.core.function.hmi.ui.tools.AdUpgradeDialog
import com.mogo.eagle.core.function.hmi.ui.tools.DockerRebootDialog
import com.mogo.eagle.core.function.hmi.ui.upgrade.UpgradeListAdapter
import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
@@ -83,8 +81,8 @@ class DebugSettingView @JvmOverloads constructor(
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoObuStatusListener,
IMoGoAutopilotStatusListener, IMoGoAutopilotCarStateListener,
IMoGoMapLocationListener, IMoGoAutopilotIdentifyListener,
IMoGoAutopilotPlanningListener, IMoGoAutopilotCarConfigListener
,IMoGoAutopilotVehicleStateListener{
IMoGoAutopilotPlanningListener, IMoGoAutopilotCarConfigListener,
IMoGoAutopilotVehicleStateListener {
private val TAG = "DebugSettingView"
@@ -94,7 +92,7 @@ class DebugSettingView @JvmOverloads constructor(
private var mAutoPilotStatusInfo: AutopilotStatusInfo? = null
private var mGnssInfo: MessagePad.GnssInfo? = null
private var accelerationFloatWindow: AccelerationFloatWindow?=null
private var accelerationFloatWindow: AccelerationFloatWindow? = null
private var accelerationList = arrayListOf<AccelerationEntity>()
private var accelerationIsShow: Boolean = false //实时加速度面板是否展示
private var accelerationThresholdNum: Double = 0.0
@@ -114,19 +112,6 @@ class DebugSettingView @JvmOverloads constructor(
//日志过滤标签集合
private val sceneMap = mutableMapOf<String, SceneModule>()
private var dockerRebootDialog: DockerRebootDialog? = null //docker重启对话框
private var adUpgradeDialog: AdUpgradeDialog? = null //工控机升级对话框
private var upgradeMode: Int = -1 //升级模式
private var downloadStatus: Int = -1 //下载状态
private var currentProgress: Int = -1 //当前已下载包体大小
private var previousProgress: Int = -1 //前一秒的下载进度,用于计算下载剩余时间
private var totalProgress: Int = -1 //包体总大小
private var downloadVersion: String? = null //工控机docker版本
private var upgradeStatus: Int = -1 //升级状态
//ADAS连接状态
private var adasConnectStatus: Boolean = false
//OBU连接状态
private var obuConnectStatus: Boolean = false
@@ -134,9 +119,9 @@ class DebugSettingView @JvmOverloads constructor(
private var onlineSelected: Boolean = true
private var qaSelected: Boolean = true
private var upgradeListAdapter: UpgradeListAdapter?=null
private var upgradeListAdapter: UpgradeListAdapter? = null
private val upgradeVersionList by lazy{
private val upgradeVersionList by lazy {
ArrayList<UpgradeVersionEntity>()
}
@@ -182,7 +167,7 @@ class DebugSettingView @JvmOverloads constructor(
// 添加 工控机基础信息回调 监听
CallerAutopilotCarConfigListenerManager.addListener(TAG, this)
//添加 车辆底盘数据回调 监听
CallerAutopilotVehicleStateListenerManager.addListener(TAG,this)
CallerAutopilotVehicleStateListenerManager.addListener(TAG, this)
if (logInfoView != null) {
logInfoView!!.onEnterForeground()
}
@@ -292,11 +277,11 @@ class DebugSettingView @JvmOverloads constructor(
* 鹰眼参数配置
*/
tbEagleEyeController.setOnCheckedChangeListener { buttonView, isChecked ->
if(isChecked){
if (isChecked) {
buttonView.setCompoundDrawables(null, null, iconDown, null)
//展示参数配置
eagleEyeControllerLayout.visibility = View.VISIBLE
}else{
} else {
buttonView.setCompoundDrawables(null, null, iconRight, null)
//隐藏参数配置
eagleEyeControllerLayout.visibility = View.GONE
@@ -338,7 +323,7 @@ class DebugSettingView @JvmOverloads constructor(
* 车辆状态控制中心
*/
tbVehicleStateController.setOnCheckedChangeListener { buttonView, isChecked ->
if(isChecked){
if (isChecked) {
buttonView.setCompoundDrawables(null, null, iconDown, null)
//展示车辆状态中心
vehicleStateLayout.visibility = View.VISIBLE
@@ -398,7 +383,7 @@ class DebugSettingView @JvmOverloads constructor(
* 应用包管理中心
*/
btnApkCenter.setOnCheckedChangeListener { buttonView, isChecked ->
if(isChecked){
if (isChecked) {
buttonView.setCompoundDrawables(null, null, iconDown, null)
//展示应用包管理中心
apkCenterLayout.visibility = View.VISIBLE
@@ -598,7 +583,7 @@ class DebugSettingView @JvmOverloads constructor(
}
//初始化切换自车按钮文本Bus版本默认显示切换自车为出租车
if(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)){
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
tbChangeCurrentCarIcon.isChecked = true
}
@@ -615,27 +600,28 @@ class DebugSettingView @JvmOverloads constructor(
/**
* 设置鹰眼本地参数配置监听
*/
private fun setEagleEyeConfigListener(){
private fun setEagleEyeConfigListener() {
//初始化刹车加速度阈值信息
val brakeThreshold = SharedPrefsMgr.getInstance(context)
.getFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD,-2.5F)
.getFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD, -2.5F)
etInputBrakeThreshold.setText(brakeThreshold.toString())
etInputBrakeThreshold.text?.let { etInputBrakeThreshold.setSelection(brakeThreshold.toString().length) }
//设置刹车加速度阈值信息
btnBrakeThreshold.setOnClickListener {
val thresholdStr = etInputBrakeThreshold.text.toString()
if(thresholdStr.isEmpty()){
if (thresholdStr.isEmpty()) {
ToastUtils.showShort("请输入正确的判定刹车加速度阈值")
}else{
try{
} else {
try {
val thresholdStrFloat = thresholdStr.toFloat()
if(thresholdStrFloat<0){
SharedPrefsMgr.getInstance(context).putFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD,thresholdStrFloat)
if (thresholdStrFloat < 0) {
SharedPrefsMgr.getInstance(context)
.putFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD, thresholdStrFloat)
ToastUtils.showShort("刹车阈值设置成功")
}else{
} else {
ToastUtils.showShort("刹车阈值加速度值应小于0")
}
}catch (e: Exception){
} catch (e: Exception) {
ToastUtils.showShort("判定刹车加速度阈值格式设置不正确")
}
}
@@ -677,41 +663,6 @@ class DebugSettingView @JvmOverloads constructor(
CallerAutoPilotManager.disconnectIpc()
}
updateSpeedSettingViews()
/**
* 设置最大速度
*/
btnSetAutopilotSpeed.onClick {
if (AppConfigInfo.isConnectAutopilot) {
val speedStr = etInputSpeed.text?.toString()
try {
if (speedStr.isNullOrEmpty()) {
ToastUtils.showShort("请输入最大车速")
}
val speed = speedStr?.toInt()
if (speed != null && speed > 0 && speed < 60) {
// 设置自动驾驶速度
val isSuccess = CallerAutoPilotManager.setAutoPilotSpeed(speed)
when {
isSuccess -> {
ToastUtils.showShort("车速设置成功,立即生效")
}
else -> {
ToastUtils.showShort("设置车速失败,请启动域控制器")
}
}
} else {
ToastUtils.showShort("最大车速应大于0且小于60")
}
} catch (e: Exception) {
ToastUtils.showShort("车速设置失败,请正确设置车速")
}
} else {
ToastUtils.showShort("设置车速失败,请启动域控制器")
}
}
/**
* 录制Bag包
*/
@@ -732,151 +683,6 @@ class DebugSettingView @JvmOverloads constructor(
}
}
/**
* 工控机升级
*/
btnSystemUpgrade.onClick {
if (AppConfigInfo.isConnectAutopilot) {
Logger.i(
TAG,
"upgradeMode=" + upgradeMode + " downloadStatus=" + downloadStatus + " upgradeStatus=" + upgradeStatus
)
if (AdUpgradeStateHelper.isDownloading(downloadStatus)) {
//点击Toast提示下载剩余时间
ToastUtils.showShort(
"预计" + AdUpgradeStateHelper.getRemainingTime(
totalProgress,
previousProgress,
currentProgress
) + "下载完成"
)
} else if (AdUpgradeStateHelper.getUpgradeStatus()) {
//工控机状态为“升级中”
ToastUtils.showShort("新版本升级中预计5分钟升级完成")
} else if (AdUpgradeStateHelper.isUpgradeFailed(upgradeStatus)) {
//如果升级失败则Toast提示升级失败请联系运维人员
ToastUtils.showShort("升级失败,请联系运维人员")
} else if (AdUpgradeStateHelper.isHintUpgradeMode(upgradeMode) && AdUpgradeStateHelper.isDownloadFinish(
downloadStatus,
upgradeStatus
)
) {
//如果升级模式为“提示升级”,并且下载状态为已经下载完成,点击弹出升级确认弹窗
if (adUpgradeDialog == null) {
adUpgradeDialog = AdUpgradeDialog(context)
adUpgradeDialog?.setClickListener(object : AdUpgradeDialog.ClickListener {
override fun confirm() {
if (mAutoPilotStatusInfo?.state == 2) {
//当前处于自动驾驶状态不可进行升级Toast提示
ToastUtils.showShort("升级前请先退出自动驾驶模式")
} else {
//确认升级
Logger.i(TAG, "upgrade confirm")
//设置当前状态为“升级中”
AdUpgradeStateHelper.setUpgradeStatus(true)
CallerAutoPilotManager.setIPCUpgradeAffirm()
}
}
override fun cancel() {
//取消升级
Logger.i(TAG, "upgrade cancel")
//取消升级命令不下发
// CallerAutoPilotManager.setIPCUpgradeCancel()
}
})
}
adUpgradeDialog?.showUpgradeDialog()
} else {
ToastUtils.showShort("当前工控机处于最新版本状态,不可升级")
}
} else {
ToastUtils.showShort("域控制器未连接")
}
}
/**
* 重启系统
*/
btnSystemRestart.onClick {
if (AppConfigInfo.isConnectAutopilot) {
if (dockerRebootDialog == null) {
dockerRebootDialog = DockerRebootDialog(context)
dockerRebootDialog?.setClickListener(object : DockerRebootDialog.ClickListener {
override fun confirm() {
if (mAutoPilotStatusInfo?.state == 2) {
//当前处于自动驾驶状态不可进行重启Toast提示
ToastUtils.showShort("请先退出自动驾驶状态")
} else if (AdUpgradeStateHelper.showCannotReboot(
downloadStatus,
upgradeStatus
)
) {
//当工控机处于下载或者升级状态,需要先进行升级
ToastUtils.showShort("请先完成新自动驾驶系统的下载/升级")
} else {
//确认重启
Logger.i(TAG, "reboot confirm")
CallerAutoPilotManager.setIPCReboot()
}
}
override fun cancel() {
//取消重启
Logger.i(TAG, "reboot cancel")
}
})
}
dockerRebootDialog?.showUpgradeDialog()
} else {
ToastUtils.showShort("域控制器未连接")
}
}
}
/**
* Bus不可设置自动驾驶速度而Taxi可以
*/
private fun updateSpeedSettingViews() {
when {
AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) -> {
btnSetAutopilotSpeed.visibility = View.GONE
llSpeedLayout.visibility = View.GONE
}
else -> {
btnSetAutopilotSpeed.visibility = View.VISIBLE
llSpeedLayout.visibility = View.VISIBLE
}
}
}
/**
* 设置工控机下载、升级状态信息
* @param upgradeMode 升级模式(提示升级、静默升级)
* @param downloadStatus 下载状态
* @param currentProgress 当前已经下载包体大小
* @param totalProgress 下载包体总大小
* @param downloadVersion 下载版本
* @param upgradeStatus 升级状态
*/
fun setAdUpgradeInfo(
upgradeMode: Int, downloadStatus: Int, currentProgress: Int, totalProgress: Int,
downloadVersion: String, upgradeStatus: Int
) {
this.upgradeMode = upgradeMode
this.downloadStatus = downloadStatus
this.previousProgress = this.currentProgress
this.currentProgress = currentProgress
this.totalProgress = totalProgress
this.downloadVersion = downloadVersion
this.upgradeStatus = upgradeStatus
}
/**
@@ -976,13 +782,13 @@ class DebugSettingView @JvmOverloads constructor(
* 实时加速度面板控制
*/
tbOpenAcceleration.setOnCheckedChangeListener { _, isChecked ->
if(isChecked){
if (isChecked) {
//打开实时加速度面板
accelerationFloatWindow = context?.let { AccelerationFloatWindow(it as Activity) }
accelerationFloatWindow?.showFloatWindow()
etThreshold.visibility = View.VISIBLE
btnThresholdDefine.visibility = View.VISIBLE
}else{
} else {
//关闭实时加速度面板
accelerationFloatWindow?.hideFloatWindow()
etThreshold.visibility = View.GONE
@@ -992,9 +798,9 @@ class DebugSettingView @JvmOverloads constructor(
}
btnThresholdDefine.setOnClickListener {
try{
try {
accelerationThresholdNum = etThreshold.text.toString().toDouble()
}catch(e:java.lang.Exception){
} catch (e: java.lang.Exception) {
ToastUtils.showShort("请输入正确的阈值")
}
}
@@ -1198,6 +1004,10 @@ class DebugSettingView @JvmOverloads constructor(
}
}
override fun fwThreadClose() {
refreshTraceInfo()
}
override fun moduleLogChanged(moduleTag: MutableMap<String, SceneModule>) {
//模块日志 tag 发生变化,需要更新对应 UI
setLogCheckedChangeListener()
@@ -1207,12 +1017,16 @@ class DebugSettingView @JvmOverloads constructor(
//版本信息更新
urls?.let {
upgradeVersionList.clear()
it.iterator().forEach {map ->
val name = if(map.key.contains("{")) map.key.replace("{","") else map.key
val url = if(map.value.contains("}")) map.value.replace("}","") else map.value
upgradeVersionList.add(UpgradeVersionEntity(name.trim(),url))
it.iterator().forEach { map ->
val name =
if (map.key.contains("{")) map.key.replace("{", "") else map.key
val url = if (map.value.contains("}")) map.value.replace(
"}",
""
) else map.value
upgradeVersionList.add(UpgradeVersionEntity(name.trim(), url))
}
upgradeVersionList.sortByDescending { upgradeVersionEntity ->upgradeVersionEntity.name }
upgradeVersionList.sortByDescending { upgradeVersionEntity -> upgradeVersionEntity.name }
upgradeListAdapter?.setDada(dataFilter(upgradeVersionList))
upgradeListAdapter?.notifyDataSetChanged()
}
@@ -1242,23 +1056,8 @@ class DebugSettingView @JvmOverloads constructor(
}
}
val traceInfoMap = CallerDevaToolsManager.getTraceInfo()
val autopilot = traceInfoMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT]
autopilot?.let{
cbAdasAutoPilot.isChecked = it.record
}
val dataTrack = traceInfoMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_DATA_TRACKED]
dataTrack?.let {
cbAdasDataTrack.isChecked = it.record
}
val trajectory = traceInfoMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_TRAJECTORY]
trajectory?.let {
cbAdasTrajectory.isChecked = it.record
}
val vehicle = traceInfoMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_VEHICLE]
vehicle?.let {
cbAdasVehicle.isChecked = it.record
}
// 更新链路信息
refreshTraceInfo()
/**
* ADAS自动驾驶链路
@@ -1313,24 +1112,46 @@ class DebugSettingView @JvmOverloads constructor(
}
}
private fun refreshTraceInfo() {
val traceInfoMap = CallerDevaToolsManager.getTraceInfo()
val autopilot = traceInfoMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT]
autopilot?.let {
cbAdasAutoPilot.isChecked = it.record
}
val dataTrack = traceInfoMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_DATA_TRACKED]
dataTrack?.let {
cbAdasDataTrack.isChecked = it.record
}
val trajectory = traceInfoMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_TRAJECTORY]
trajectory?.let {
cbAdasTrajectory.isChecked = it.record
}
val vehicle = traceInfoMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_VEHICLE]
vehicle?.let {
cbAdasVehicle.isChecked = it.record
}
}
/**
* APK包管理
*/
private fun setApkCenterListener(){
val layoutManager: LinearLayoutManager = object : LinearLayoutManager(context,
VERTICAL, false) {
private fun setApkCenterListener() {
val layoutManager: LinearLayoutManager = object : LinearLayoutManager(
context,
VERTICAL, false
) {
override fun canScrollVertically(): Boolean {
// 直接禁止垂直滑动
return false
}
}
rvUpgradeVersionList.layoutManager =layoutManager
rvUpgradeVersionList.layoutManager = layoutManager
upgradeListAdapter = UpgradeListAdapter(context,upgradeVersionList,
object:UpgradeListAdapter.ClickListener{
override fun downloadApk(name: String,url: String) {
upgradeListAdapter = UpgradeListAdapter(context, upgradeVersionList,
object : UpgradeListAdapter.ClickListener {
override fun downloadApk(name: String, url: String) {
//下载包
CallerDevaToolsManager.downLoadPackage(name,url)
CallerDevaToolsManager.downLoadPackage(name, url)
ToastUtils.showLong("开始下载APK,稍后可前往downloads文件夹查看")
}
@@ -1340,9 +1161,9 @@ class DebugSettingView @JvmOverloads constructor(
ivApkSearch.setOnClickListener {
val searchStr = etApkSearch.text.toString()
if(searchStr.isEmpty()){
if (searchStr.isEmpty()) {
ToastUtils.showShort("请输入正确的搜索关键字")
}else{
} else {
CallerDevaToolsManager.getUpgradeVersionUrls(searchStr)
}
@@ -1370,11 +1191,11 @@ class DebugSettingView @JvmOverloads constructor(
private fun dataFilter(list: ArrayList<UpgradeVersionEntity>): ArrayList<UpgradeVersionEntity> {
val tempList = ArrayList<UpgradeVersionEntity>()
list.let {
it.iterator().forEach { entity->
if(onlineSelected && entity.name.contains("online")){
it.iterator().forEach { entity ->
if (onlineSelected && entity.name.contains("online")) {
tempList.add(entity)
}
if(qaSelected && entity.name.contains("qa")){
if (qaSelected && entity.name.contains("qa")) {
tempList.add(entity)
}
}
@@ -1413,10 +1234,15 @@ class DebugSettingView @JvmOverloads constructor(
AppConfigInfo.widevineIDMd5 =
DeviceIdUtils.getWidevineIDWithMd5(AbsMogoApplication.getApp())
}
AppConfigInfo.mogoSN = MoGoAiCloudClient.getInstance().aiCloudClientConfig.sn
AppConfigInfo.mogoToken = MoGoAiCloudClient.getInstance().aiCloudClientConfig.token
if (MoGoAiCloudClient.getInstance().aiCloudClientConfig != null) {
AppConfigInfo.mogoSN = MoGoAiCloudClient.getInstance().aiCloudClientConfig.sn
AppConfigInfo.mogoToken = MoGoAiCloudClient.getInstance().aiCloudClientConfig.token
}
AppConfigInfo.netMode = DebugConfig.getNetMode()
AppConfigInfo.mapSdkVersion = MogoMap.getInstance().mogoMap.mapVersion
if (MogoMap.getInstance().mogoMap != null) {
AppConfigInfo.mapSdkVersion = MogoMap.getInstance().mogoMap.mapVersion
}
AppConfigInfo.isConnectNet = NetworkUtils.isConnected(context)
AppConfigInfo.isConnectSocket = DebugConfig.isDownloadSnapshot()
@@ -1430,7 +1256,8 @@ class DebugSettingView @JvmOverloads constructor(
AppConfigInfo.isConnectedNetty = CallerTelematicManager.getClientConnStatus()
AppConfigInfo.serverIp = CallerTelematicManager.getServerIp()
}
else -> {}
else -> {
}
}
/**
@@ -1448,11 +1275,12 @@ class DebugSettingView @JvmOverloads constructor(
tvAppVersionName.text = "鹰眼版本名:${AppUtils.getAppVersionName()}"
tvAutopilotProtocolVersionInfo.text =
"Autopilot协议版本${CallerAutoPilotManager.getProtocolVersion()}"
if(AppConfigInfo.protocolVersionNumber==0){
tvIpcProtocolVersionInfo.text="工控机协议版本:未知"
}else{
if (AppConfigInfo.protocolVersionNumber == 0) {
tvIpcProtocolVersionInfo.text = "工控机协议版本:未知"
} else {
tvIpcProtocolVersionInfo.text = "工控机协议版本:${AppConfigInfo.protocolVersionNumber}"
}
tvIpcVersionInfo.text = "工控机镜像:${mAutoPilotStatusInfo?.dockVersion}"
tvMoGoMapVersion.text = "HD-Map版本${MogoMap.getInstance().mogoMap.mapVersion}"
tvGitBranchInfo.text = "Git分支${AppConfigInfo.workingBranchName}"
tvAppBuildTimeInfo.text = "版本构建时间:${AppConfigInfo.appBuildTime}"
@@ -1512,9 +1340,9 @@ class DebugSettingView @JvmOverloads constructor(
"<font color='blue'>正常"
} else {
"<font color='red'>异常 原因:${
if(AppConfigInfo.connectStatusDescribe.isNullOrEmpty()){
if (AppConfigInfo.connectStatusDescribe.isNullOrEmpty()) {
"主动断开连接"
}else{
} else {
AppConfigInfo.connectStatusDescribe
}
}"
@@ -1557,7 +1385,7 @@ class DebugSettingView @JvmOverloads constructor(
)
tvLocationEnabled.text = Html.fromHtml(
"定位服务开启状态:${
"Pad定位服务开启状态:${
if (DeviceUtils.isLocationEnabled()) {
"<font color='blue'>正常"
} else {
@@ -1616,30 +1444,40 @@ class DebugSettingView @JvmOverloads constructor(
AppConfigInfo.isConnectAutopilot = autoPilotStatusInfo.connectStatus
AppConfigInfo.connectStatusDescribe = autoPilotStatusInfo.connectStatusDescribe
// if (autoPilotStatusInfo.connectStatus) {
// adasConnectStatus = true
// }
//ADAS断开连接提示异常
// if (adasConnectStatus && !autoPilotStatusInfo.connectStatus) {
// adasConnectStatus = false
// toastMsg("工控机连接断开")
// }
}
override fun onAutopilotCarStateData(gnssInfo: MessagePad.GnssInfo?) {
mGnssInfo = gnssInfo
//实时加速度列表
ThreadUtils.runOnUiThread{
if(accelerationIsShow){
if(accelerationList.size > 9){
ThreadUtils.runOnUiThread {
if (accelerationIsShow) {
if (accelerationList.size > 9) {
accelerationList.removeLast()
}
gnssInfo?.acceleration?.let {
if(accelerationList.isEmpty()){
accelerationList.add(AccelerationEntity(TimeUtils.millis2String(System.currentTimeMillis(),TimeUtils.getHourMinSecondFormat()),it.toString()))
if (accelerationList.isEmpty()) {
accelerationList.add(
AccelerationEntity(
TimeUtils.millis2String(
System.currentTimeMillis(),
TimeUtils.getHourMinSecondFormat()
), it.toString()
)
)
}
if(abs(it.minus(accelerationList.first().acceleration.toDouble())) > abs(accelerationThresholdNum)){
accelerationList.add(0, AccelerationEntity(TimeUtils.millis2String(System.currentTimeMillis(),TimeUtils.getHourMinSecondFormat()),it.toString()))
if (abs(it.minus(accelerationList.first().acceleration.toDouble())) > abs(
accelerationThresholdNum
)
) {
accelerationList.add(
0,
AccelerationEntity(
TimeUtils.millis2String(
System.currentTimeMillis(),
TimeUtils.getHourMinSecondFormat()
), it.toString()
)
)
}
accelerationFloatWindow?.refreshData(accelerationList)
@@ -1698,13 +1536,15 @@ class DebugSettingView @JvmOverloads constructor(
tvReportCode.text = "code:${it.code}"
var resultStr = "result:"
for (result in it.resultList) {
resultStr = "$resultStr$result${CallerAutoPilotManager.getReportResultDesc(result)} "
resultStr =
"$resultStr$result${CallerAutoPilotManager.getReportResultDesc(result)} "
}
tvReportResult.text = resultStr
var actionStr = "action:"
for (action in it.actionsList) {
actionStr = "$actionStr$action${CallerAutoPilotManager.getReportActionDesc(action)} "
actionStr =
"$actionStr$action${CallerAutoPilotManager.getReportActionDesc(action)} "
}
tvReportActions.text = actionStr
@@ -1744,7 +1584,7 @@ class DebugSettingView @JvmOverloads constructor(
* 时延显示
*/
override fun onObuV2iDelayTime(delayTime: Long) {
ThreadUtils.runOnUiThread{
ThreadUtils.runOnUiThread {
tvObuDelay.text = "obu时延" + delayTime.toString()
}
}
@@ -1770,7 +1610,7 @@ class DebugSettingView @JvmOverloads constructor(
* @param steering 方向盘转向角
*/
override fun onAutopilotSteeringData(steering: Float) {
ThreadUtils.runOnUiThread{
ThreadUtils.runOnUiThread {
tvSteeringInfo.text = "方向盘转向角:${steering}"
}
}
@@ -1780,7 +1620,7 @@ class DebugSettingView @JvmOverloads constructor(
* @param gear 档位
*/
override fun onAutopilotGearData(gear: Chassis.GearPosition) {
ThreadUtils.runOnUiThread{
ThreadUtils.runOnUiThread {
tvGearInfo.text = "挂挡档位:${gear}"
}
}
@@ -1799,7 +1639,7 @@ class DebugSettingView @JvmOverloads constructor(
this.clickListener = clickListener
}
interface ClickListener{
interface ClickListener {
fun showReportListWindow(show: Boolean)
}

View File

@@ -0,0 +1,60 @@
package com.mogo.eagle.core.function.hmi.ui.setting
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.hmi.R
/**
* @author XuXinChao
* @description 工控机异常节点上报适配器
* @since: 2022/5/12
*/
class IPCReportAdapter: RecyclerView.Adapter<IPCReportAdapter.IPCReportHolder>(){
private var data:List<ReportEntity>? = null
fun setData( data: List<ReportEntity>?){
this.data = data
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): IPCReportHolder {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.item_ipc_report, parent, false)
return IPCReportHolder(view)
}
override fun onBindViewHolder(holder: IPCReportHolder, position: Int) {
data?.let {it ->
val reportEntity = it[position]
reportEntity.let {
holder.tvReportTimeContent.text = it.time
var resultStr = "发生异常"
for (result in it.resultList){
resultStr = "${resultStr}-${CallerAutoPilotManager.getReportResultDesc(result)}"
}
holder.tvReportResultContent.text = resultStr
holder.tvReportMsgContent.text = it.msg
var actionStr = ""
for (action in it.actionsList){
actionStr = "${actionStr}-${CallerAutoPilotManager.getReportActionDesc(action)}"
}
holder.tvReportActionContent.text = actionStr
}
}
}
override fun getItemCount() = data?.size ?: 0
class IPCReportHolder(itemView: View) : RecyclerView.ViewHolder(itemView){
var tvReportTimeContent: TextView = itemView.findViewById(R.id.tvReportTimeContent)
var tvReportResultContent: TextView = itemView.findViewById(R.id.tvReportResultContent)
var tvReportMsgContent: TextView = itemView.findViewById(R.id.tvReportMsgContent)
var tvReportActionContent: TextView = itemView.findViewById(R.id.tvReportActionContent)
}
}

View File

@@ -0,0 +1,126 @@
package com.mogo.eagle.core.function.hmi.ui.setting
import android.app.Activity
import android.graphics.PixelFormat
import android.util.DisplayMetrics
import android.view.*
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.hmi.R
import java.lang.reflect.Field
/**
* @author XuXinChao
* @description 工控机异常节点上报
* @since: 2022/5/12
*/
class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
private var mActivity: Activity = activity
private var mWindowParams: WindowManager.LayoutParams? = null
private var mWindowManager: WindowManager? = null
private lateinit var rvIPCReport: RecyclerView
private var ipcReportAdapter: IPCReportAdapter?=null
private lateinit var mFloatLayout: View
private var mInViewX = 0f
private var mInViewY = 0f
private var mDownInScreenX = 0f
private var mDownInScreenY = 0f
private var mInScreenX = 0f
private var mInScreenY = 0f
init {
initFloatWindow();
}
private fun initFloatWindow(){
mFloatLayout = LayoutInflater.from(mActivity).inflate(R.layout.view_ipc_report, null) as View
mFloatLayout.setOnTouchListener(this)
rvIPCReport= mFloatLayout.findViewById(R.id.rv_ipc_report)
mWindowParams = WindowManager.LayoutParams()
mWindowManager = mActivity.windowManager
mWindowParams?.let {
it.format = PixelFormat.RGBA_8888
it.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
it.gravity = Gravity.START or Gravity.TOP
it.width = 800
it.height = 1000
it.alpha = 0.9f
}
ipcReportAdapter = IPCReportAdapter()
rvIPCReport.layoutManager = LinearLayoutManager(mActivity,
LinearLayoutManager.VERTICAL,false)
rvIPCReport.adapter = ipcReportAdapter
}
fun refreshData(data:List<ReportEntity>){
ipcReportAdapter?.setData(data)
ipcReportAdapter?.notifyDataSetChanged()
}
override fun onTouch(v: View?, motionEvent: MotionEvent?): Boolean {
when (motionEvent?.action) {
MotionEvent.ACTION_DOWN -> {
// 获取相对View的坐标即以此View左上角为原点
mInViewX = motionEvent.x
mInViewY = motionEvent.y
// 获取相对屏幕的坐标,即以屏幕左上角为原点
mDownInScreenX = motionEvent.rawX
mDownInScreenY = motionEvent.rawY - getSysBarHeight(mActivity)
mInScreenX = motionEvent.rawX
mInScreenY = motionEvent.rawY - getSysBarHeight(mActivity)
}
MotionEvent.ACTION_MOVE -> {
// 更新浮动窗口位置参数
mInScreenX = motionEvent.rawX
mInScreenY = motionEvent.rawY - getSysBarHeight(mActivity)
mWindowParams!!.x = (mInScreenX - mInViewX).toInt()
mWindowParams!!.y = (mInScreenY - mInViewY).toInt()
// 手指移动的时候更新小悬浮窗的位置
mWindowManager!!.updateViewLayout(mFloatLayout, mWindowParams)
}
// MotionEvent.ACTION_UP -> // 如果手指离开屏幕时xDownInScreen和xInScreen相等且yDownInScreen和yInScreen相等则视为触发了单击事件。
// if (mDownInScreenX === mInScreenX && mDownInScreenY === mInScreenY) {
// }
}
return true
}
fun showFloatWindow() {
if (mFloatLayout.parent == null) {
val metrics = DisplayMetrics()
// 默认固定位置,靠屏幕右边缘的中间
mWindowManager!!.defaultDisplay.getMetrics(metrics)
mWindowParams!!.x = metrics.widthPixels
mWindowParams!!.y = metrics.heightPixels / 2 - getSysBarHeight(mActivity)
mWindowManager!!.addView(mFloatLayout, mWindowParams)
}
}
fun hideFloatWindow() {
if (mFloatLayout.parent != null) mWindowManager!!.removeView(mFloatLayout)
}
// 获取系统状态栏高度
private fun getSysBarHeight(activity: Activity): Int {
val c: Class<*>
val obj: Any
val field: Field
val x: Int
var sbar = 0
try {
c = Class.forName("com.android.internal.R\$dimen")
obj = c.newInstance()
field = c.getField("status_bar_height")
x = field.get(obj).toString().toInt()
sbar = activity.resources.getDimensionPixelSize(x)
} catch (e1: Exception) {
e1.printStackTrace()
}
return sbar
}
}

View File

@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui.widget
import android.animation.ValueAnimator
import android.content.Context
import android.content.res.Resources
import android.content.res.TypedArray
import android.graphics.*
import android.util.AttributeSet
@@ -87,8 +88,6 @@ class CircularProgressView @JvmOverloads constructor(
Log.d(TAG, mRectL.toString() + "," + mRectT.toString())
Log.d(TAG, mRectF.toString() + "," + "width:" + measuredWidth.toString() + "," + "PaddingLeft:" + getPaddingLeft().toString())
}
override fun onDraw(canvas: Canvas?) {

View File

@@ -5,23 +5,22 @@ import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager;
import com.mogo.eagle.core.function.hmi.R;
import com.mogo.eagle.core.network.utils.Util;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
@@ -47,6 +46,7 @@ public class SteeringWheelView extends ConstraintLayout {
private TextView steeringTVR;
private TapPositionView tapPositionView;
private CircularProgressView steeringCircularV;
private CircularProgressView steeringCircularVAlpha;
private RotateAnimation rotateAnimation;
private float fromDegrees = 0;//方向盘旋转起始位置
@@ -58,7 +58,11 @@ public class SteeringWheelView extends ConstraintLayout {
public SteeringWheelView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
Log.d(TAG, "2");
LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel, this);
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_bus, this);
} else {
LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_taxi, this);
}
initView();
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
CallerAutopilotVehicleStateListenerManager.INSTANCE.addListener(TAG, mIMoGoAutopilotVehicleStateListener);
@@ -74,6 +78,13 @@ public class SteeringWheelView extends ConstraintLayout {
steeringCircularV.setBackColor(R.color.hmi_light_blue_00);
steeringCircularV.setProgColor(R.color.hmi_light_blue, R.color.hmi_dark_blue);
steeringCircularV.setProgress((int) (180 * 100) / 360, 1000);
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
steeringCircularVAlpha = findViewById(R.id.steering_circular_alpha);
steeringCircularVAlpha.setAlpha(0.4f);
steeringCircularVAlpha.setBackColor(R.color.hmi_light_blue_00);
steeringCircularVAlpha.setProgColor(R.color.hmi_light_blue_alpha);
steeringCircularVAlpha.setProgress((int) (180 * 100) / 360, 1000);
}
}
public SteeringWheelView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
@@ -151,7 +162,7 @@ public class SteeringWheelView extends ConstraintLayout {
}
/**
* 方向盘转向角
* 方向盘转向角 左+右-
* @param steering
*/
@Override
@@ -159,12 +170,12 @@ public class SteeringWheelView extends ConstraintLayout {
ThreadUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
Log.d(TAG, "steering" + String.valueOf(steering));
if (steeringTVL != null && steering < 0) {
Log.d(TAG, "steering====" + String.valueOf(steering));
if (steeringTVL != null && steering > 0) {
steeringTVR.setVisibility(View.INVISIBLE);
steeringTVL.setVisibility(View.VISIBLE);
steeringTVL.setText(String.valueOf((int) steering) + "°");
} else if (steeringTVR != null && steering >= 0) {
} else if (steeringTVR != null && steering <= 0) {
steeringTVL.setVisibility(View.INVISIBLE);
steeringTVR.setVisibility(View.VISIBLE);
steeringTVR.setText(String.valueOf((int) steering) + "°");
@@ -172,7 +183,7 @@ public class SteeringWheelView extends ConstraintLayout {
Log.d(TAG, "onAutopilotSteeringData error");
}
animationWithSteeringData(steering);
steeringCircularV.setProgress((int) (steering * 100) / 360, 1000);
steeringCircularV.setProgress((int) (-steering * 100) / 360, 1000);
}
});

View File

@@ -104,6 +104,7 @@ class SystemVersionView @JvmOverloads constructor(
CallerLogger.i("$M_HMI$$TAG", "upgrade confirm")
//设置当前状态为“升级中”
AdUpgradeStateHelper.setUpgradeStatus(true)
//TODO
CallerAutoPilotManager.setIPCUpgradeAffirm()
//将角标设为升级中
ivAdStatus?.setImageResource(R.drawable.icon_upgrading)

View File

@@ -4,7 +4,9 @@ import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import kotlinx.android.synthetic.main.view_vip_identification.view.*
@@ -21,6 +23,20 @@ class VipIdentificationView @JvmOverloads constructor(
LayoutInflater.from(context).inflate(R.layout.view_vip_identification, this, true)
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
val lp = this.layoutParams as LayoutParams
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left_bus).toInt()
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top_bus).toInt()
} else {
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left_taxi).toInt()
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top_taxi).toInt()
}
this.layoutParams = lp
invalidate()
}
fun setVipIdentificationVisible(visible: Boolean) {
UiThreadHandler.post {
ivVipIdentification.visibility = visibility

View File

@@ -0,0 +1,70 @@
package com.mogo.eagle.core.function.main;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.function.hmi.R;
import java.util.List;
public class ConnInfoAdapter extends RecyclerView.Adapter<ConnInfoAdapter.ConnInfoViewHolder> {
private List<AutopilotStatusInfo> data;
private Context context;
public ConnInfoAdapter(Context context, List<AutopilotStatusInfo> data) {
this.data = data;
this.context = context;
}
public void updateData(AutopilotStatusInfo statusInfo) {
if (data.size() > 999) {
data.clear();
}
data.add(statusInfo);
notifyDataSetChanged();
}
@NonNull
@Override
public ConnInfoViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.autopilot_connect_status_item, parent, false);
return new ConnInfoViewHolder(view);
}
@SuppressLint("ResourceAsColor")
@Override
public void onBindViewHolder(@NonNull ConnInfoViewHolder holder, int position) {
AutopilotStatusInfo statusInfo = data.get(position);
if (statusInfo.getConnectStatus()) {
holder.mContentView.setTextColor(Color.parseColor("#FFFFFF"));
} else {
holder.mContentView.setTextColor(Color.parseColor("#FF4040"));
}
holder.mContentView.setText(statusInfo.toString());
}
@Override
public int getItemCount() {
return data != null ? data.size() : 0;
}
public static class ConnInfoViewHolder extends RecyclerView.ViewHolder {
private TextView mContentView;
public ConnInfoViewHolder(@NonNull View itemView) {
super(itemView);
mContentView = itemView.findViewById(R.id.tvStatusInfo);
}
}
}

View File

@@ -15,18 +15,26 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.cloud.commons.BuildConfig;
import com.mogo.commons.context.ContextHolderUtil;
import com.mogo.commons.mvp.BaseFragment;
import com.mogo.commons.mvp.MvpActivity;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.hmi.R;
import com.mogo.eagle.core.function.main.cards.MogoModulesManager;
import com.mogo.eagle.core.function.main.service.MogoMainService;
import com.mogo.eagle.core.function.main.stagetwo.APMStartup;
import com.mogo.eagle.core.function.main.stagetwo.AutopilotStartup;
import com.mogo.eagle.core.function.main.utils.DisplayEffectsHelper;
import com.mogo.eagle.core.function.main.windowview.FloatingViewHandler;
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils;
@@ -44,10 +52,18 @@ import com.mogo.module.common.MogoApisHandler;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.fragmentmanager.FragmentStackTransactionListener;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.rousetime.android_startup.StartupManager;
import com.rousetime.android_startup.model.LoggerLevel;
import com.rousetime.android_startup.model.StartupConfig;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import mogo.telematics.pad.MessagePad;
import mogo_msg.MogoReportMsg;
/**
* @author congtaowang
* @since 2019-12-23
@@ -56,7 +72,8 @@ import java.util.Map;
*/
public class MainActivity extends MvpActivity<MainView, MainPresenter> implements MainView,
IMogoLocationListener,
FragmentStackTransactionListener {
FragmentStackTransactionListener,
IMoGoAutopilotStatusListener {
protected static final String TAG = "MainActivity";
private static final int REQUEST_CODE_DIALOG = 100;
@@ -71,6 +88,11 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
private boolean isFirst = false;
private RecyclerView mConnectInfoRV;
private ConnInfoAdapter mConnAdapter;
private List<AutopilotStatusInfo> dataList = new ArrayList<>();
private boolean isFloatingLayerHidden = false;
@Override
protected int getLayoutId() {
return R.layout.module_main_activity_main;
@@ -89,10 +111,10 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
mCoverUpLayout = findViewById(R.id.module_main_id_cover_up);
clSpecialEffect = findViewById(R.id.cl_special_effect);
mConnectInfoRV = findViewById(R.id.rvConnectInfo);
initConnectInfoRV();
FloatingViewHandler.init(mFloatingLayout);
//申请悬浮窗权限
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
// 检查是否有悬浮窗权限
@@ -118,6 +140,9 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
super.onCreate(savedInstanceState);
calculateStartTime();
ContextHolderUtil.holdContext(this);
// 监听工控机连接信息
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
startUpInStage2();
// 加载模块
mPresenter.postLoadModuleMsg();
// 监听网络状态
@@ -171,6 +196,32 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
mMogoStatusManager.setMainPageLaunchedStatus(TAG, true);
}
private void initConnectInfoRV() {
mConnAdapter = new ConnInfoAdapter(this, dataList);
mConnectInfoRV.setLayoutManager(new LinearLayoutManager(this));
mConnectInfoRV.setAdapter(mConnAdapter);
}
/**
* 第二阶段初始化,第一阶段初始化可查看:{@link com.mogo.launcher.stageone}
*/
public void startUpInStage2() {
StartupConfig config = null;
if (BuildConfig.DEBUG) {
config = new StartupConfig.Builder()
.setLoggerLevel(LoggerLevel.DEBUG)
.setOpenStatistics(true)
.build();
}
new StartupManager.Builder()
.addStartup(new AutopilotStartup())
.addStartup(new APMStartup())
.setConfig(config)
.build(this)
.start()
.await();
}
@Override
public void loadModules() {
final long start = System.currentTimeMillis();
@@ -186,7 +237,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
EventDispatchCenter.getInstance().setMapLoadedCallback(() -> {
CallerLogger.INSTANCE.d(M_HMI + TAG, "map loaded." + Thread.currentThread().getName());
// 延时加载其他模块
getWindow().getDecorView().postDelayed(() -> {
getWindow().getDecorView().post(() -> {
loadOthersModules();
loadFunctionFragment();
@@ -194,7 +245,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode(TAG, true);
// 设置地图样式
MogoMapListenerHandler.getInstance().onMapModeChanged(EnumMapUI.MAP_STYLE_DAY_VR);
}, 1000);
});
CallerLogger.INSTANCE.i(M_HMI + TAG, "App launch timer cost " + (System.currentTimeMillis() - start) + "ms");
});
@@ -239,8 +290,10 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
@Override
public void hideCoverUpLayout() {
mConnectInfoRV.setVisibility(View.GONE);
getWindow().setBackgroundDrawable(null);
mCoverUpLayout.setVisibility(View.GONE);
isFloatingLayerHidden = true;
}
@Override
@@ -317,9 +370,33 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
return mServiceApis;
}
@Override
public void onAutopilotStatusResponse(@NonNull AutopilotStatusInfo autoPilotStatusInfo) {
mConnectInfoRV.post(() -> updateConnectInfoView(autoPilotStatusInfo));
}
@Override
public void onAutopilotArriveAtStation(@Nullable MessagePad.ArrivalNotification arrivalNotification) {}
@Override
public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo) {}
@Override
public void onAutopilotSNRequest() {}
private void updateConnectInfoView(@NonNull AutopilotStatusInfo autoPilotStatusInfo) {
if (!isFloatingLayerHidden) {// 遮罩层显示的时候
mConnAdapter.updateData(autoPilotStatusInfo);
mConnectInfoRV.scrollToPosition(mConnAdapter.getItemCount() - 1);
} else {// 遮罩层隐藏的时候
CallerAutoPilotStatusListenerManager.INSTANCE.removeListener(TAG);
}
}
@Override
protected void onDestroy() {
super.onDestroy();
CallerAutoPilotStatusListenerManager.INSTANCE.removeListener(TAG);
IMogoHosListenerRegister listenerRegister = CallerMapUIServiceManager.INSTANCE.getHostListenerRegister();
if (listenerRegister != null) {
listenerRegister.unregisterMarkerClickListener();

View File

@@ -6,25 +6,14 @@ import android.content.Context;
import android.os.Process;
import com.bytedance.boost_multidex.BoostMultiDex;
import com.mogo.aicloud.services.locationinfo.MogoLocationInfoServices;
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager;
import com.mogo.cloud.httpdns.MogoHttpDnsConfig;
import com.mogo.cloud.httpdns.bean.HttpDnsSimpleLocation;
import com.mogo.cloud.passport.IMoGoTokenCallback;
import com.mogo.cloud.passport.MoGoAiCloudClient;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.cloud.socket.SocketBuildConfig;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.constants.SharedPrefsConstants;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.network.Utils;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.constants.MoGoConfig;
import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.chat.biz.ChatConsts;
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.notice.PushUIConstants;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils;
@@ -32,16 +21,10 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.eagle.core.utilcode.util.ProcessUtils;
import com.mogo.map.MapApiPath;
import com.mogo.map.location.IMogoLocationClient;
import com.mogo.module.common.MogoModule;
import com.mogo.module.common.MogoModulePaths;
import com.mogo.module.common.constants.HostConst;
import com.mogo.module.service.ServiceConst;
import com.mogo.aicloud.services.socket.IMogoLifecycleListener;
import com.mogo.test.crashreport.CrashReportConstants;
import com.mogo.test.crashreport.upgrade.UpgradeReportConstants;
import com.zhidao.support.obu.ami.AmiClientManager;
import com.zhjt.mogo_core_function_devatools.DevaToolsProvider;
import java.lang.reflect.Field;
@@ -57,19 +40,17 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
@Override
public void onCreate() {
initBuildConfig();
initConfigWithSP();
super.onCreate();
if (!shouldInit()) {
return;
}
start = System.currentTimeMillis();
connectAmiIp();
// Crash 日志收集
initCrashConfig();
initLogConfig();
initTipToast();
initModules();
initCloudClientConfig();
}
@Override
@@ -78,26 +59,11 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
return ProcessUtils.isMainProcess(this);
}
/**
* BuildConfig中渠道配置赋值
*/
protected abstract void initBuildConfig();
/**
* 从SP本地设置中恢复数据
*/
protected abstract void initConfigWithSP();
/**
* 初始化异常采集配置
*/
protected abstract void initCrashConfig();
/**
* 初始化异常采集配置
*/
protected abstract void initAnalyticsConfig();
/**
* 初始化日志
*/
@@ -115,149 +81,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
CallerDevaToolsManager.INSTANCE.init(this);
}
/**
* 初始化 MoGoAiCloudClientConfig
*/
protected abstract void initCloudClientConfig();
@Override
protected void asyncInitImpl() {
super.asyncInitImpl();
initAnalyticsConfig();
}
@Override
protected void initHttpDns() {
super.initHttpDns();
prepareBaseService();
}
/**
* 基础服务passport、location、socket
*/
private void prepareBaseService() {
// 第三方平台的sn是由AI云SDK中服务调用通过服务端生成的
preparePassportEnvironment();
}
private void preparePassportEnvironment() {
// 设置网络环境HTTP_DNS_ENV_QA、HTTP_DNS_ENV_RELEASE、HTTP_DNS_ENV_DEV
switch (DebugConfig.getNetMode()) {
case DebugConfig.NET_MODE_DEV:
clientConfig.setNetMode(MogoHttpDnsConfig.HTTP_DNS_ENV_DEV);
break;
case DebugConfig.NET_MODE_QA:
clientConfig.setNetMode(MogoHttpDnsConfig.HTTP_DNS_ENV_QA);
break;
case DebugConfig.NET_MODE_DEMO:
clientConfig.setNetMode(MogoHttpDnsConfig.HTTP_DNS_ENV_DEMO);
break;
default:
clientConfig.setNetMode(MogoHttpDnsConfig.HTTP_DNS_ENV_RELEASE);
}
// 设置是否是第三APP登录
clientConfig.setThirdLogin(DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE);
// 设置是否输出日志
clientConfig.setShowDebugLog(true);
// 设置是否输出网络日志
clientConfig.setShowNetDebugLog(false);
// 设置是否是直播推流的主播
clientConfig.setAnchor(true);
// 设置从蘑菇AI开放平台获取的APPKey
switch (DebugConfig.getCarMachineType()) {
// 比亚迪
case DebugConfig.CAR_MACHINE_TYPE_BYD:
clientConfig.setThirdPartyAppKey("bydauto");
break;
// 衡阳-鹰眼项目
case DebugConfig.CAR_MACHINE_TYPE_LENOVO:
clientConfig.setThirdPartyAppKey("pfieouqg");
break;
// 自研车机
default:
clientConfig.setThirdPartyAppKey("wbvpzgar");
break;
}
// 设置应用服务AppId 长链、鉴权
if (DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE) {
clientConfig.setServiceAppId("com_mogo_launcher");
} else {
clientConfig.setServiceAppId("com.mogo.launcher");
}
// 设置AI云平台分配给三方应用的签名密钥需要从AI云平台申请
// 设置车机设备的唯一标识(这些表识必须是通过后台录入的设备)
clientConfig.setThirdPartyDeviceId(Utils.getDevicesId());
// 设置循环检测间隔时间每隔2小时loop一次httpDnsConfig
clientConfig.setLoopCheckDelay(60 * 60 * 2 * 1000);
//设置长链接的secretKey //todo 通过SHA1和包名找中台服务生成后续包名分渠道,需要做对应操作
clientConfig.setSecretKey("YMj2VFDFxJ3Q4gNoZceJ");
//连接ami
connectAmiIp();
// todo 使用旧链路
// clientConfig.setUseOriginSocket(true);
clientConfig.setIHttpDnsCurrentLocation(() -> {
MogoLocation mogoLocation = null;
IMogoLocationClient locationClient = CallerMapUIServiceManager.INSTANCE.getSingletonLocationClient(getApp());
if (locationClient != null) {
mogoLocation = locationClient.getLastKnowLocation();
}
HttpDnsSimpleLocation httpDnsSimpleLocation;
if (mogoLocation != null
&& mogoLocation.getLatitude() != 0
&& mogoLocation.getLongitude() != 0) {
httpDnsSimpleLocation = new HttpDnsSimpleLocation(
mogoLocation.getCityCode(),
mogoLocation.getLatitude(),
mogoLocation.getLongitude());
} else {
String ciyCode = SharedPrefsMgr.getInstance(getApp())
.getString(SharedPrefsConstants.LOCATION_CITY_CODE);
String latitude = SharedPrefsMgr.getInstance(getApp())
.getString(SharedPrefsConstants.LOCATION_LATITUDE);
String longitude = SharedPrefsMgr.getInstance(getApp())
.getString(SharedPrefsConstants.LOCATION_LONGITUDE);
try {
httpDnsSimpleLocation = new HttpDnsSimpleLocation(
ciyCode,
Double.parseDouble(latitude),
Double.parseDouble(longitude));
} catch (NumberFormatException e) {
// e.printStackTrace();
httpDnsSimpleLocation = new HttpDnsSimpleLocation("010", 1, 1);
}
//CallerLogger.INSTANCE.d(M_HMI + TAG, "使用缓存GPS信息" + httpDnsSimpleLocation);
}
return httpDnsSimpleLocation;
});
// 初始化SDK可以设置状态回调来监听
MoGoAiCloudClient.getInstance().init(this, clientConfig).addTokenCallbacks(
new IMoGoTokenCallback() {
@Override
public void onTokenGot(String token, String sn) {
CallerLogger.INSTANCE.d(M_HMI + TAG, "onTokenGot ");
clientConfig.setToken(token);
// 异步初始化NetConfig
asyncInit();
// HttpDns ttl回调 --- socketTTL
registerSocketHttpDnsTTL(HostConst.SOCKET_CENTER_DOMAIN);
// 开启每5s/次定位上报
uploadLocPerFiveSecond();
}
@Override
public void onError(int code, String msg) {
CallerLogger.INSTANCE.d(M_HMI + TAG, "初始化MogoAiCloudSdk failed ,reason : " + msg + " , 未能开启长链服务和初始化Modules服务");
}
}
);
}
/**
* 连接ami
*/
@@ -266,69 +89,15 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
AmiClientManager.getInstance().setObuIp(ipAddress);
}
/**
* 上传自车位置信息到云端
*/
private void uploadLocPerFiveSecond() {
if (DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) {
MogoLocationInfoServices.getInstance().init(getApplicationContext());
MogoLocationInfoServices.getInstance().start();
IMogoLocationClient locationClient = CallerMapUIServiceManager.INSTANCE.getSingletonLocationClient(getApplicationContext());
if (locationClient != null) {
locationClient.addLocationListener(location -> MogoLocationInfoServices.getInstance().provideLocation(location));
}
}
}
private void startSocketService() {
CallerLogger.INSTANCE.d(M_HMI + TAG, "startSocketService");
MogoLocation location = CallerMapUIServiceManager.INSTANCE.getSingletonLocationClient(getApp()).getLastKnowLocation();
// 关闭长链服务
MogoAiCloudSocketManager.getInstance(getApplicationContext()).destroy();
MogoAiCloudSocketManager.getInstance(getApplicationContext()).registerLifecycleListener(10020, new IMogoLifecycleListener() {
@Override
public void onConnectFailure() {
CallerLogger.INSTANCE.d(M_HMI + TAG, "socket-onConnectFailure");
DebugConfig.setDownloadSnapshot(false);
}
@Override
public void onConnectSuccess() {
CallerLogger.INSTANCE.d(M_HMI + TAG, "socket-onConnectSuccess");
DebugConfig.setDownloadSnapshot(true);
}
@Override
public void onConnectLost() {
CallerLogger.INSTANCE.d(M_HMI + TAG, "socket-onConnectLost");
DebugConfig.setDownloadSnapshot(false);
}
});
// 开启Socket长链服务
double lat = location.getLatitude();
double lon = location.getLongitude();
MogoAiCloudSocketManager.getInstance(getApplicationContext()).init(getApplicationContext(), DebugConfig.getSocketAppId(), lat, lon);
}
@Override
protected void socketTTL() {
// 鉴权成功后开启socket长链服务
startSocketService();
}
private void initModules() {
CallerLogger.INSTANCE.d(M_HMI + TAG, "initModules");
// 初始化 bugly 升级
MogoModulePaths.addBaseModule(new MogoModule(UpgradeReportConstants.PATH, UpgradeReportConstants.NAME));
// 初始化 apm 日志采集
MogoModulePaths.addBaseModule(new MogoModule(CrashReportConstants.PATH, CrashReportConstants.NAME));
//och模块
MogoModulePaths.addModuleFunction(new MogoModule("/och/api", "IMoGoFunctionProvider"));
MogoModulePaths.addBaseModule(new MogoModule(MapApiPath.PATH, "CustomMapApiBuilder"));
MogoModulePaths.addBaseModule(new MogoModule(ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY));
// MogoModulePaths.addBaseModule(new MogoModule(V2XConst.PATH_V2X_UI, V2XConst.MODULE_NAME));
// 域控制器模块(新)
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_AUTO_PILOT, "IMoGoAutoPilotProvider"));
// OBU 模块
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_V2X_OBU_MOGO, "IMoGoObuProvider"));
// 超视距,路测、行车记录仪监控
@@ -365,5 +134,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
AppLaunchTimeUtils.beginTimeCalculate(AppLaunchTimeUtils.COLD_START);
}
BoostMultiDex.install(base);
AbsMogoApplication.sApp = this;
}
}

View File

@@ -22,13 +22,13 @@ import com.mogo.eagle.core.function.main.constants.MainConstants;
* <p>
* 描述
*/
public class MainPresenter extends Presenter< MainView > {
public class MainPresenter extends Presenter<MainView> {
private Handler mMsgHandler = new Handler( Looper.getMainLooper() ) {
private Handler mMsgHandler = new Handler(Looper.getMainLooper()) {
@Override
public void handleMessage( Message msg ) {
super.handleMessage( msg );
switch ( msg.what ) {
public void handleMessage(Message msg) {
super.handleMessage(msg);
switch (msg.what) {
case MainConstants.MSG_HIDE_MAP_COVER_FRAME:
mView.hideCoverUpLayout();
break;
@@ -41,14 +41,14 @@ public class MainPresenter extends Presenter< MainView > {
public static final int MOGO_PERMISSION_REQUEST_CODE = 10000;
public MainPresenter( MainView view ) {
super( view );
SchemeIntent.getInstance().init( getContext(), mView.getApis() );
public MainPresenter(MainView view) {
super(view);
SchemeIntent.getInstance().init(getContext(), mView.getApis());
}
@Override
public void onCreate( @NonNull LifecycleOwner owner ) {
super.onCreate( owner );
public void onCreate(@NonNull LifecycleOwner owner) {
super.onCreate(owner);
}
public void checkPermission(Activity activity) {
@@ -96,25 +96,20 @@ public class MainPresenter extends Presenter< MainView > {
return true;
}
/**
* 延时操作
*/
public void delayOperations() {
mMsgHandler.sendEmptyMessageDelayed( MainConstants.MSG_HIDE_MAP_COVER_FRAME, 150L );
mMsgHandler.sendEmptyMessage(MainConstants.MSG_HIDE_MAP_COVER_FRAME);
}
public void postLoadModuleMsg() {
Message msg = Message.obtain();
msg.what = MainConstants.MSG_LOAD_MODULES;
mMsgHandler.sendMessageDelayed( msg, 500 );
mMsgHandler.sendMessage(msg);
}
public void handleSchemeIntent( Intent intent, boolean isOnNewIntent ) {
SchemeIntent.getInstance().handle( intent, isOnNewIntent );
}
public void initADAS(){
public void handleSchemeIntent(Intent intent, boolean isOnNewIntent) {
SchemeIntent.getInstance().handle(intent, isOnNewIntent);
}
}

View File

@@ -0,0 +1,33 @@
package com.mogo.eagle.core.function.main.stagetwo;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.test.crashreport.CrashReportConstants;
import com.mogo.test.crashreport.upgrade.UpgradeReportConstants;
import com.rousetime.android_startup.AndroidStartup;
public class APMStartup extends AndroidStartup<Boolean> {
@Nullable
@Override
public Boolean create(@NonNull Context context) {
// bugly
ARouter.getInstance().build(UpgradeReportConstants.PATH).navigation();
// apm
ARouter.getInstance().build(CrashReportConstants.PATH).navigation();
return true;
}
@Override
public boolean callCreateOnMainThread() {
return true;
}
@Override
public boolean waitOnMainThread() {
return false;
}
}

View File

@@ -0,0 +1,40 @@
package com.mogo.eagle.core.function.main.stagetwo;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.rousetime.android_startup.AndroidStartup;
import java.util.ArrayList;
import java.util.List;
public class AutopilotStartup extends AndroidStartup<Boolean> {
@Nullable
@Override
public Boolean create(@NonNull Context context) {
ARouter.getInstance().build(MogoServicePaths.PATH_AUTO_PILOT).navigation();
return true;
}
@Override
public boolean callCreateOnMainThread() {
return true;
}
@Override
public boolean waitOnMainThread() {
return false;
}
@Nullable
@Override
public List<String> dependenciesByName() {
List<String> deps = new ArrayList<>();
deps.add("com.mogo.eagle.core.function.main.stagetwo.APMStartup");
return deps;
}
}

View File

@@ -0,0 +1,38 @@
package com.mogo.eagle.core.function.main.stagetwo;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.rousetime.android_startup.AndroidStartup;
import java.util.ArrayList;
import java.util.List;
public class MapStartup extends AndroidStartup<Boolean> {
@Nullable
@Override
public Boolean create(@NonNull Context context) {
// TODO:暂不支持分步加载
return true;
}
@Override
public boolean callCreateOnMainThread() {
return true;
}
@Override
public boolean waitOnMainThread() {
return false;
}
@Nullable
@Override
public List<String> dependenciesByName() {
List<String> deps = new ArrayList<>();
deps.add("com.mogo.eagle.core.function.main.stagetwo.APMStartup");
return deps;
}
}

View File

@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<gradient android:angle="270"
android:endColor="#00044CFF"
android:startColor="#FF45D3FF"
android:type="radial"
android:centerX="0.5"
android:centerY="0"
android:gradientRadius="@dimen/dp_46"/>
</shape>
</item>
</selector>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/background">
<shape
android:innerRadius="@dimen/dp_85"
android:shape="ring"
android:thickness="4px"
android:useLevel="false">
<solid android:color="#BBCFF6" />
</shape>
</item>
</layer-list>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="@dimen/dp_36"/>
<gradient android:angle="315" android:endColor="#E6E9EFFC" android:startColor="#E6E9EFFC" />
</shape>
</item>
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape
android:innerRadiusRatio="3"
android:shape="ring"
android:thicknessRatio="8"
android:useLevel="false">
<gradient
android:centerColor="#FF7121"
android:centerY="0.50"
android:endColor="#FFFF00"
android:startColor="#6BD3FF"
android:type="sweep"
android:useLevel="false" />
</shape>
</item>
</layer-list>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="48px"
android:padding="12px">
<TextView
android:id="@+id/tvStatusInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:textSize="24px"
tools:text="测试数据看一下测试数据看一下测试数据看一下测试数据看一下测试数据看一下测试数据看一下测试数据看一下测试数据看一下测试数据看一下测试数据看一下"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -44,8 +44,6 @@
android:id="@+id/flVipIdentificationView"
android:layout_width="@dimen/module_vip_width"
android:layout_height="@dimen/module_vip_height"
android:layout_marginStart="@dimen/module_vip_margin_left"
android:layout_marginTop="@dimen/module_vip_margin_top"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />

View File

@@ -3,29 +3,17 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_steering_wheel">
<ImageView
android:id="@+id/autopilot_iv"
android:layout_width="@dimen/dp_240"
android:layout_height="@dimen/dp_240"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_60"
android:src="@drawable/bg_auto"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:background="@drawable/bg_steering_wheel_bus">
<ProgressBar
android:id="@+id/blue_circle"
android:layout_width="@dimen/dp_260"
android:layout_height="@dimen/dp_260"
android:layout_width="@dimen/dp_180"
android:layout_height="@dimen/dp_180"
android:layout_centerHorizontal="true"
android:layout_marginLeft="@dimen/dp_85"
android:layout_marginTop="@dimen/dp_50"
android:layout_marginRight="@dimen/dp_85"
android:indeterminateDrawable="@drawable/bg_steering_outer"
android:layout_marginLeft="@dimen/dp_60"
android:layout_marginTop="@dimen/dp_38"
android:layout_marginRight="@dimen/dp_60"
android:indeterminateDrawable="@drawable/bg_steering_outer_bus"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -38,8 +26,8 @@
android:layout_marginRight="-10px"
android:gravity="right"
android:text="-18°"
android:textColor="#FFFFFFFF"
android:textSize="@dimen/dp_37"
android:textColor="#415479"
android:textSize="@dimen/dp_26"
android:visibility="invisible"
app:layout_constraintRight_toLeftOf="@+id/blue_circle"
app:layout_constraintTop_toTopOf="parent" />
@@ -52,25 +40,35 @@
android:layout_marginTop="@dimen/dp_50"
android:gravity="left"
android:text="18°"
android:textColor="#FFFFFFFF"
android:textSize="@dimen/dp_37"
android:textColor="#415479"
android:textSize="@dimen/dp_26"
app:layout_constraintLeft_toRightOf="@+id/autopilot_iv"
app:layout_constraintTop_toTopOf="parent" />
<com.mogo.eagle.core.function.hmi.ui.widget.CircularProgressView
android:id="@+id/steering_circular"
android:layout_width="@dimen/dp_260"
android:layout_height="@dimen/dp_260"
android:layout_width="@dimen/dp_180"
android:layout_height="@dimen/dp_180"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_50"
android:outlineAmbientShadowColor="#1EBBCFF6"
android:layout_marginTop="@dimen/dp_36"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:progWidth="8px"
app:progress="0" />
<ImageView
android:id="@+id/autopilot_iv"
android:layout_width="@dimen/dp_186"
android:layout_height="@dimen/dp_186"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_34"
android:src="@drawable/bg_auto"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:layout_width="@dimen/dp_40"
@@ -86,8 +84,7 @@
android:id="@+id/tap_position"
android:layout_width="@dimen/dp_240"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_30"
android:layout_marginBottom="@dimen/dp_40"
android:layout_marginBottom="@dimen/dp_20"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"

View File

@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/dp_630"
android:layout_height="@dimen/dp_630"
android:background="@drawable/steering_bg">
<ImageView
android:id="@+id/autopilot_iv"
android:layout_width="@dimen/dp_240"
android:layout_height="@dimen/dp_240"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_140"
android:src="@drawable/bg_auto"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--底层默认进度条,无进度值改变动作-->
<ProgressBar
android:id="@+id/blue_circle"
android:layout_width="@dimen/dp_260"
android:layout_height="@dimen/dp_260"
android:layout_centerHorizontal="true"
android:layout_marginLeft="@dimen/dp_85"
android:layout_marginTop="@dimen/dp_130"
android:layout_marginRight="@dimen/dp_85"
android:indeterminateDrawable="@drawable/bg_steering_outer_taxi"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/steering_tv_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_130"
android:layout_marginRight="-10px"
android:gravity="right"
android:text="-18°"
android:textColor="#FFFFFFFF"
android:textSize="@dimen/dp_37"
android:visibility="invisible"
app:layout_constraintRight_toLeftOf="@+id/blue_circle"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/steering_tv_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="-10px"
android:layout_marginTop="@dimen/dp_130"
android:gravity="left"
android:text="18°"
android:textColor="#FFFFFFFF"
android:textSize="@dimen/dp_37"
app:layout_constraintLeft_toRightOf="@+id/autopilot_iv"
app:layout_constraintTop_toTopOf="parent" />
<!--进度值改变状态进度条-->
<com.mogo.eagle.core.function.hmi.ui.widget.CircularProgressView
android:id="@+id/steering_circular"
android:layout_width="@dimen/dp_260"
android:layout_height="@dimen/dp_260"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_130"
android:outlineAmbientShadowColor="#1EBBCFF6"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:progWidth="8px"
app:progress="0" />
<!--状态条阴影-->
<com.mogo.eagle.core.function.hmi.ui.widget.CircularProgressView
android:id="@+id/steering_circular_alpha"
android:layout_width="@dimen/dp_274"
android:layout_height="@dimen/dp_274"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_122"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:progWidth="22px"
app:progress="0" />
<ImageView
android:layout_width="@dimen/dp_60"
android:layout_height="@dimen/dp_60"
android:src="@drawable/icon_in_steering"
app:layout_constraintBottom_toBottomOf="@+id/autopilot_iv"
app:layout_constraintLeft_toLeftOf="@+id/autopilot_iv"
app:layout_constraintRight_toRightOf="@+id/autopilot_iv"
app:layout_constraintTop_toTopOf="@+id/autopilot_iv" />
<!--档位信息-->
<com.mogo.eagle.core.function.hmi.ui.widget.TapPositionView
android:id="@+id/tap_position"
android:layout_width="@dimen/dp_272"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_30"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/blue_circle" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto">
<TextView
android:id="@+id/tvReportTimeTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
/>
<TextView
android:id="@+id/tvReportTimeContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toRightOf="@id/tvReportTimeTitle"
/>
<TextView
android:id="@+id/tvReportResultTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvReportTimeTitle"
/>
<TextView
android:id="@+id/tvReportResultContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tvReportResultTitle"
app:layout_constraintLeft_toRightOf="@id/tvReportResultTitle"
android:minLines="1"
/>
<TextView
android:id="@+id/tvReportMsgTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/tvReportResultContent"
app:layout_constraintLeft_toLeftOf="parent"
/>
<TextView
android:id="@+id/tvReportMsgContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tvReportMsgTitle"
app:layout_constraintLeft_toRightOf="@id/tvReportMsgTitle"
android:minLines="1"
/>
<TextView
android:id="@+id/tvReportActionTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvReportMsgContent"
/>
<TextView
android:id="@+id/tvReportActionContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tvReportActionTitle"
app:layout_constraintLeft_toRightOf="@id/tvReportActionTitle"
android:minLines="1"
/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0"
app:layout_constraintTop_toBottomOf="@id/tvReportActionContent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -87,4 +87,10 @@
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvConnectInfo"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</FrameLayout>

View File

@@ -293,6 +293,17 @@
android:layout_height="1dp"
android:background="#F0F0F0" />
<TextView
android:id="@+id/tvIpcVersionInfo"
style="@style/DebugSettingText"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0" />
<TextView
android:id="@+id/tvMoGoMapVersion"
style="@style/DebugSettingText"
@@ -468,7 +479,7 @@
style="@style/DebugSettingText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minLines="6"
android:minLines="7"
app:layout_constraintTop_toTopOf="parent" />
<View
@@ -528,61 +539,6 @@
android:background="#F0F0F0"
app:layout_constraintTop_toBottomOf="@id/btnSetAutopilotIP" />
<Button
android:id="@+id/btnSetAutopilotSpeed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="@dimen/dp_5"
android:text="设置最大速度"
android:textSize="@dimen/dp_24"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/autopilotIPDivider" />
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/llSpeedLayout"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginEnd="@dimen/dp_30"
android:layout_marginBottom="@dimen/dp_10"
android:background="@drawable/debug_setting_edit_bg"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="@id/btnSetAutopilotSpeed"
app:layout_constraintLeft_toRightOf="@id/btnSetAutopilotSpeed"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/btnSetAutopilotSpeed">
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/etInputSpeed"
style="@style/DebugSettingText"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="90px"
android:layout_weight="1"
android:background="@null"
android:gravity="center"
tools:ignore="SpeakableTextPresentCheck" />
<TextView
style="@style/DebugSettingText"
android:layout_width="93px"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="km/h" />
</androidx.appcompat.widget.LinearLayoutCompat>
<View
android:id="@+id/autopilotSpeedDivider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0"
app:layout_constraintTop_toBottomOf="@id/btnSetAutopilotSpeed" />
<Button
android:id="@+id/btnRecordPackage"
android:layout_width="wrap_content"
@@ -592,7 +548,7 @@
android:text="录制Bag包"
android:textSize="@dimen/dp_24"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/autopilotSpeedDivider" />
app:layout_constraintTop_toBottomOf="@id/autopilotIPDivider" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
@@ -636,36 +592,13 @@
android:layout_height="1dp"
android:background="#F0F0F0"
app:layout_constraintTop_toBottomOf="@id/btnRecordPackage" />
<Button
android:id="@+id/btnSystemUpgrade"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="升级系统"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/btnSystemRestart"
app:layout_constraintTop_toBottomOf="@id/recordPackageDivider"
tools:visibility="visible" />
<Button
android:id="@+id/btnSystemRestart"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="重启系统"
android:visibility="gone"
app:layout_constraintLeft_toRightOf="@id/btnSystemUpgrade"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/recordPackageDivider"
tools:visibility="visible" />
<TextView
android:id="@+id/tvCarInfo"
style="@style/DebugSettingText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/btnSystemUpgrade" />
app:layout_constraintTop_toBottomOf="@id/recordPackageDivider" />
<TextView
android:id="@+id/tvIdentifyInfo"

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="840px"
android:layout_height="584px"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/icon_drag"
android:padding="15dp"
android:layout_gravity="center_horizontal"
/>
<com.mogo.eagle.core.widget.RoundConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/dialog_bg_color"
app:roundLayoutRadius="10dp">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_ipc_report"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</com.mogo.eagle.core.widget.RoundConstraintLayout>
</LinearLayout>

View File

@@ -57,4 +57,5 @@
<color name="hmi_light_blue">#45D3FF</color>
<color name="hmi_dark_blue">#1B5BFF</color>
<color name="hmi_light_blue_00">#0045D3FF</color>
<color name="hmi_light_blue_alpha">#666C79C4</color>
</resources>

View File

@@ -37,7 +37,7 @@
<string name="application_upgrade_confirm">是否将应用升级至最新版本?</string>
<string name="application_upgrade_tips">注意!升级时需退出自动驾驶,支持在人工驾驶时升级,升级时不可中途断电。</string>
<string name="confirm">确认</string>
<string name="cancel">取消</string>
<string name="cancel">稍后升级</string>
<!--绑定车机-->
<string name="bindingcar_title">绑定车机</string>

View File

@@ -9,6 +9,7 @@ import com.mogo.eagle.core.function.call.trafficlight.CallTrafficLightManager
import com.mogo.eagle.core.function.v2x.events.V2XEventManager
import com.mogo.eagle.core.function.v2x.redlightwarning.RedLightWarningManager
import com.mogo.eagle.core.function.v2x.speedlimit.SpeedLimitDataManager
import com.mogo.eagle.core.function.v2x.trafficlight.core.TrafficLightDispatcher
import com.mogo.eagle.core.function.v2x.vip.VipCarManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
@@ -22,6 +23,7 @@ class V2XProvider : IMoGoFunctionServerProvider {
CallTrafficLightManager.getTrafficLightProvider().initTrafficLightServer(context)
VipCarManager.INSTANCE.initServer(context)
SpeedLimitDataManager.getInstance().start()
TrafficLightDispatcher.INSTANCE.initServer(context)
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
//不处理
@@ -34,7 +36,7 @@ class V2XProvider : IMoGoFunctionServerProvider {
override fun onDestroy() {
VipCarManager.INSTANCE.destroy()
TrafficLightDispatcher.INSTANCE.destroy()
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
//不处理
} else {

View File

@@ -0,0 +1,112 @@
package com.mogo.eagle.core.function.v2x.trafficlight.core
import android.content.Context
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.trafficlight.CallTrafficLightListenerManager
import com.mogo.eagle.core.function.v2x.trafficlight.TrafficLightHMIManager
import perception.TrafficLightOuterClass
import perception.TrafficLightOuterClass.TrafficLight
/**
* @author XuXinChao
* @description 对多个红绿灯信号来源进行统一调度AI云、工控机
* @since: 2022/4/28
*/
class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener , IMoGoTrafficLightListener {
companion object{
const val TAG = "TrafficLightDispatcher"
val INSTANCE: TrafficLightDispatcher by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED){
TrafficLightDispatcher()
}
}
private var mContext: Context? = null
//是否有AI获取红绿灯灯态
private var hasAiLightStatus: Boolean = false
fun initServer(context: Context){
mContext = context
//注册监听AI云获取红绿灯状态
CallTrafficLightListenerManager.registerTrafficLightListener(TAG, this)
//注册监听AI云进入路口
CallTrafficLightListenerManager.registerEnterCrossRoadListener(TAG, this)
//注册监听工控机感知红绿灯
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
}
/**
* 工控机感知红绿灯
* @param trafficLights 感知红绿灯
*/
override fun onAutopilotPerceptionTrafficLight(trafficLights: TrafficLightOuterClass.TrafficLights?) {
if(!hasAiLightStatus){
trafficLights?.let { it ->
var light :TrafficLight?= null
if(it.hasStraight()){
light = it.straight
}else if(it.hasLeft()){
light = it.left
}else if(it.hasRight()){
light = it.right
}else if(it.hasUTurn()){
light = it.uTurn
}
if(light == null){
//隐藏红绿灯显示
CallerHmiManager.showWarningTrafficLight(0)
}else{
when (light.state) {
TrafficLightOuterClass.LightState.STATE_RED -> {
//红灯
CallerHmiManager.showWarningTrafficLight(1)
CallerHmiManager.changeCountdownGreen(0)
}
TrafficLightOuterClass.LightState.STATE_YELLOW -> {
//黄灯
CallerHmiManager.showWarningTrafficLight(2)
CallerHmiManager.changeCountdownGreen(0)
}
TrafficLightOuterClass.LightState.STATE_GREEN -> {
//绿灯
CallerHmiManager.showWarningTrafficLight(3)
CallerHmiManager.changeCountdownGreen(0)
}
else -> {}
}
}
}
}
}
/**
* AI云获取红绿灯状态
*/
override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) {
TrafficLightHMIManager.INSTANCE.updateTrafficLight(trafficLightResult)
hasAiLightStatus = true
}
/**
* 车辆进入路口
*/
override fun onEnterCrossRoad(enter: Boolean) {
hasAiLightStatus = enter
}
fun destroy(){
//取消注册监听AI云获取红绿灯状态
CallTrafficLightListenerManager.unRegisterTrafficLightListener(TAG)
//取消注册监听工控机感知红绿灯
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
//取消注册监听AI云进入路口
CallTrafficLightListenerManager.unRegisterEnterCrossRoadListener(TAG)
}
}

View File

@@ -74,5 +74,11 @@ class AutopilotStatusInfo : Serializable {
*/
var pilotmode = 0
override fun toString(): String {
return "AutopilotStatusInfo(connectIP=$connectIP, connectPort=$connectPort, " +
"connectStatus=$connectStatus, connectDescribe=$connectStatusDescribe, version=$version, dockVersion=$dockVersion," +
" locationStatus=$locationStatus), locationLat=$locationLat, locationLon=$locationLon," +
" satelliteTime=$satelliteTime, speed=$speed, state=$state, reason=$reason, camera=$camera," +
" radar=$radar, rtk=$rtk, pilotmode=$pilotmode)"
}
}

View File

@@ -0,0 +1,26 @@
package com.mogo.eagle.core.data.bindingcar
/**
* @author XuXinChao
* @description 工控机镜像升级状态实体类
* @since: 2022/5/12
*/
data class IPCUpgradeStateInfo(
val callback_url: String,
val images: List<String>,
val progress: Progress,
val release_id: String,
val status: String,
val token: String
)
data class Progress(
val id: String,
val progressDetail: ProgressDetail,
val status: String
)
data class ProgressDetail(
val current: Int,
val total: Int
)

View File

@@ -19,7 +19,7 @@ class ChainConstant {
const val CHAIN_LINK_LOG_ADAS_TRAJECTORY = "-adasWsTrajectory"
const val CHAIN_LINK_LOG_ADAS_VEHICLE = "-adasWsVehicle"
const val CHAIN_ALIAS_CODE_MULTI_CONNECT = "CHAIN_ALIAS_CODE_MULTI_CONNECT"
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_RECT_DATA = "PAD_ADAS_MESSAGE_AUTOPILOT_RECT_DATA"
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_CAR_STATE = "PAD_ADAS_MESSAGE_AUTOPILOT_CAR_STATE"
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_STATUS = "PAD_ADAS_MESSAGE_AUTOPILOT_STATUS"
@@ -30,5 +30,12 @@ class ChainConstant {
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_RECORD = "PAD_ADAS_MESSAGE_AUTOPILOT_RECORD"
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_VEHICLE = "PAD_ADAS_MESSAGE_AUTOPILOT_VEHICLE"
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_WARN = "PAD_ADAS_MESSAGE_AUTOPILOT_WARN"
//operation by user
const val CHAIN_ALIAS_CODE_OCH_BUS_START_AUTOPILOT = "CHAIN_ALIAS_CODE_OCH_BUS_START_AUTOPILOT"
const val CHAIN_ALIAS_CODE_OCH_TAXI_START_AUTOPILOT = "CHAIN_ALIAS_CODE_OCH_TAXI_START_AUTOPILOT"
const val CHAIN_ALIAS_CODE_EAGLE_START_AUTOPILOT = "CHAIN_ALIAS_CODE_EAGLE_START_AUTOPILOT"
const val CHAIN_ALIAS_CODE_EAGLE_START_AUTOPILOT_RESULT = "CHAIN_ALIAS_CODE_EAGLE_START_AUTOPILOT_RESULT"
}
}

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.core.function.api.autopilot
import mogo.telematics.pad.MessagePad
import perception.TrafficLightOuterClass
/**
* @author xiaoyuzhou
@@ -23,4 +24,10 @@ interface IMoGoAutopilotIdentifyListener {
*/
fun onAutopilotWarnMessage(warn: MessagePad.Warn?) {}
/**
* 感知红绿灯
* @param trafficLights 感知红绿灯
*/
fun onAutopilotPerceptionTrafficLight(trafficLights: TrafficLightOuterClass.TrafficLights?){}
}

View File

@@ -2,17 +2,12 @@ package com.mogo.eagle.core.function.api.check;
import android.content.Context;
import com.alibaba.android.arouter.facade.template.IProvider;
import org.jetbrains.annotations.NotNull;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider;
/**
* 检测接口
*/
public interface ICheckProvider extends IProvider {
public interface ICheckProvider extends IMoGoFunctionServerProvider {
/**
* 注册车辆监控变化监听
*

View File

@@ -27,6 +27,11 @@ interface IMoGoDevaToolsListener {
*/
fun onLogCatch(lineLog: String)
/**
* fw线程写入倒计时结束
*/
fun fwThreadClose()
/**
* 模块TAG更新回调
*/

View File

@@ -4,6 +4,7 @@ import android.view.View
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.api.hmi.IMoGoHmiViewProxy
/**
@@ -203,17 +204,6 @@ interface IMoGoWaringProvider : IMoGoHmiViewProxy {
*/
fun showModifyBindingcarDialog()
/**
* 展示工控机下载、升级状态信息
* @param upgradeMode 升级模式(提示升级、静默升级)
* @param downloadStatus 下载状态
* @param currentProgress 当前已经下载包体大小
* @param totalProgress 下载包体总大小
* @param downloadVersion 下载版本
* @param upgradeStatus 升级状态
*/
fun showAdUpgradeStatus(upgradeMode: Int, downloadStatus: Int, currentProgress: Int, totalProgress: Int, downloadVersion: String, upgradeStatus: Int)
/**
*注册工控机升级提示圆点View的回调
* @param 提示圆点View
@@ -226,4 +216,10 @@ interface IMoGoWaringProvider : IMoGoHmiViewProxy {
* @param msg
*/
fun showDockerRebootResult(code: Int,msg: String)
/**
* 展示工控机监控上报数据
* @param reportList 上报数据列表
*/
fun showIPCReportWindow(reportList: ArrayList<ReportEntity>)
}

View File

@@ -0,0 +1,9 @@
package com.mogo.eagle.core.function.api.map.deva
interface IMoGoMapDevaProvider {
/**
* 压缩并上传地图日志
*/
fun uploadFile(filePath: String)
}

View File

@@ -3,9 +3,15 @@ package com.mogo.eagle.core.function.call.autopilot
import android.os.SystemClock
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_EAGLE_START_AUTOPILOT
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_ADAS
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider
import com.mogo.eagle.core.function.call.base.CallerBase
import com.zhjt.service.chain.ChainLog
import com.zhjt.service.chain.TracingConstants
import kotlin.random.Random
/**
@@ -43,6 +49,14 @@ object CallerAutoPilotManager {
*
* @param controlParameters 开启自动驾驶的控制参数
*/
@ChainLog(
linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT,
linkCode = CHAIN_LINK_ADAS,
endpoint = TracingConstants.Endpoint.PAD,
nodeAliasCode = CHAIN_ALIAS_CODE_EAGLE_START_AUTOPILOT,
paramIndexes = [0],
clientPkFileName = "sn"
)
fun startAutoPilot(controlParameters: AutopilotControlParameters?) {
if (controlParameters == null) {
//LogUtils.eTag(TAG, "自动驾驶控制参数异常,请检查参数信息")

View File

@@ -4,6 +4,7 @@ import androidx.annotation.Nullable
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.call.base.CallerBase
import mogo.telematics.pad.MessagePad
import perception.TrafficLightOuterClass
import java.util.concurrent.ConcurrentHashMap
/**
@@ -79,5 +80,15 @@ object CallerAutopilotIdentifyListenerManager : CallerBase() {
}
}
/**
* 感知红绿灯
*/
fun invokeAutopilotPerceptionTrafficLight(trafficLights: TrafficLightOuterClass.TrafficLights?){
M_AUTOPILOT_IDENTIFY_LISTENERS.forEach{
val tag = it.key
val listener = it.value
listener.onAutopilotPerceptionTrafficLight(trafficLights)
}
}
}

View File

@@ -72,6 +72,13 @@ object CallerDevaToolsListenerManager {
}
}
fun invokeDevaToolsFwThreadClose() {
M_DEVA_TOOLS_LISTENER.forEach {
val listener = it.value
listener.fwThreadClose()
}
}
fun invokeDevaToolsModuleLogChanges(moduleTag: MutableMap<String, SceneModule>) {
M_DEVA_TOOLS_LISTENER.forEach {
val listener = it.value

View File

@@ -6,6 +6,7 @@ import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.api.hmi.view.IViewLimitingVelocity
import com.mogo.eagle.core.function.api.hmi.view.IViewNotification
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
@@ -279,20 +280,6 @@ object CallerHmiManager : CallerBase() {
waringProviderApi?.hideToolsView()
}
/**
* 展示工控机下载、升级状态信息
* @param upgradeMode 升级模式(提示升级、静默升级)
* @param downloadStatus 下载状态
* @param currentProgress 当前已经下载包体大小
* @param totalProgress 下载包体总大小
* @param downloadVersion 下载版本
* @param upgradeStatus 升级状态
*/
fun showAdUpgradeStatus(upgradeMode : Int, downloadStatus : Int,currentProgress : Int,totalProgress : Int
,downloadVersion : String,upgradeStatus : Int){
waringProviderApi?.showAdUpgradeStatus(upgradeMode,downloadStatus, currentProgress, totalProgress, downloadVersion, upgradeStatus)
}
/**
*注册工控机升级提示圆点View的回调
* @param 提示圆点View
@@ -334,4 +321,12 @@ object CallerHmiManager : CallerBase() {
waringProviderApi?.setProxyNotificationView(view)
}
/**
* 展示工控机监控上报数据
* @param reportList 上报数据列表
*/
fun showIPCReportWindow(reportList: ArrayList<ReportEntity>){
waringProviderApi?.showIPCReportWindow(reportList)
}
}

View File

@@ -0,0 +1,54 @@
package com.mogo.eagle.core.function.call.map
import androidx.annotation.Nullable
import com.mogo.eagle.core.function.api.map.deva.IMoGoMapDevaProvider
import com.mogo.eagle.core.function.call.base.CallerBase
import java.util.concurrent.ConcurrentHashMap
object CallerMapDevaListenerManager : CallerBase() {
private val mMapDevaListeners: ConcurrentHashMap<String, IMoGoMapDevaProvider> =
ConcurrentHashMap()
private var filePath: String? = null
fun addListener(
@Nullable tag: String,
@Nullable listener: IMoGoMapDevaProvider
) {
if (mMapDevaListeners.containsKey(tag)) {
return
}
mMapDevaListeners[tag] = listener
filePath?.let {
listener.uploadFile(it)
}
}
fun removeListener(@Nullable tag: String) {
if (!mMapDevaListeners.containsKey(tag)) {
return
}
mMapDevaListeners.remove(tag)
}
fun removeListener(@Nullable listener: IMoGoMapDevaProvider) {
if (!mMapDevaListeners.containsValue(listener)) {
return
}
mMapDevaListeners.forEach {
if (it.value == listener) {
mMapDevaListeners.remove(it.key)
}
}
}
fun invokeUploadLogFile(filePath: String) {
this.filePath = filePath
mMapDevaListeners.forEach {
val listener = it.value
listener.uploadFile(filePath)
}
}
}

View File

@@ -6,8 +6,11 @@
<dimen name="module_vip_width">104px</dimen>
<dimen name="module_vip_height">104px</dimen>
<dimen name="module_vip_margin_left">540px</dimen>
<dimen name="module_vip_margin_top">40px</dimen>
<dimen name="module_vip_margin_left_bus">540px</dimen>
<dimen name="module_vip_margin_top_bus">40px</dimen>
<dimen name="module_vip_margin_left_taxi">640px</dimen>
<dimen name="module_vip_margin_top_taxi">80px</dimen>
<dimen name="module_ext_speed_width_sm_radius">30px</dimen>
<dimen name="module_ext_speed_width_big_radius">130px</dimen>

View File

@@ -14,8 +14,11 @@
<dimen name="module_vip_width">104px</dimen>
<dimen name="module_vip_height">104px</dimen>
<dimen name="module_vip_margin_left">380px</dimen>
<dimen name="module_vip_margin_top">40px</dimen>
<dimen name="module_vip_margin_left_bus">380px</dimen>
<dimen name="module_vip_margin_top_bus">40px</dimen>
<dimen name="module_vip_margin_left_taxi">380px</dimen>
<dimen name="module_vip_margin_top_taxi">40px</dimen>
<dimen name="module_ext_speed_width_sm_radius">20px</dimen>
<dimen name="module_ext_speed_width_big_radius">110px</dimen>

View File

@@ -75,6 +75,8 @@ dependencies {
api rootProject.ext.dependencies.androidxlifecycleprocess
api rootProject.ext.dependencies.androidxccorektx
api rootProject.ext.dependencies.life_cycle_java8
api rootProject.ext.dependencies.mogochainbase
}
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()

View File

@@ -1,8 +1,5 @@
package com.mogo.commons;
import static com.mogo.aicloud.services.httpdns.HttpDnsConst.HTTP_DNS_ADDRESS_TYPE_HTTP;
import static com.mogo.commons.debug.DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE;
import android.app.Application;
import android.content.Context;
import android.text.TextUtils;
@@ -12,20 +9,11 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.aicloud.services.httpdns.IMogoHttpDns;
import com.mogo.aicloud.services.httpdns.MogoHttpDnsHandler;
import com.mogo.commons.crash.FinalizeCrashFixer;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.device.Devices;
import com.mogo.commons.network.NetConfigUtils;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.toast.TipDrawable;
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
import com.mogo.eagle.core.utilcode.util.AppStateManager;
import com.mogo.eagle.core.utilcode.util.AppUtils;
import com.mogo.eagle.core.utilcode.util.CleanUtils;
import com.mogo.eagle.core.utilcode.util.ThreadPoolService;
import com.mogo.eagle.core.utilcode.util.Utils;
import io.reactivex.plugins.RxJavaPlugins;
@@ -40,27 +28,19 @@ public abstract class AbsMogoApplication extends Application {
private static final String TAG = "AbsMogoApplication";
private static Application sApp;
protected static Application sApp;
public static Application getApp() {
return sApp;
}
private static IMogoHttpDns sApis;
@Override
public void onCreate() {
super.onCreate();
AppStateManager.INSTANCE.init(this);
initRxJavaErrorHandler();
sApp = this;
FinalizeCrashFixer.fix();
initARouter();
Utils.init(this);
if (shouldInit()) {
initHttpDns();
}
}
private void initRxJavaErrorHandler() {
@@ -69,40 +49,10 @@ public abstract class AbsMogoApplication extends Application {
});
}
/**
* 初始化跨模块框架 ARouter
*/
private void initARouter() {
try {
if (DebugConfig.isDebug()) {
ARouter.openDebug();
ARouter.openLog();
}
// 初始化 arouter
ARouter.init(sApp);
} catch (Exception e) {
e.printStackTrace();
// 由于ARouter会在SP_AROUTER_CACHE.xml缓存路由表如果出现了被删除的情况会报错这里清除下就好了
CleanUtils.cleanInternalSp();
// 重启应用
AppUtils.relaunchApp();
}
}
protected boolean shouldInit() {
return true;
}
/**
* 初始化 HttpDNS ,这里会通过一个接口获取所有鹰眼中使用的微服务域名以及端口号
* 后续的网络请求会通过 HttpDnsInterceptor 进行拦截替换
*/
protected void initHttpDns() {
if (sApis == null) {
sApis = MogoHttpDnsHandler.getHttpDnsApi();
}
}
/**
* 初始化 自定义样式e饿
*/
@@ -143,49 +93,4 @@ public abstract class AbsMogoApplication extends Application {
}
return contentView;
}
/**
* 异步初始化
*/
protected void asyncInit() {
ThreadPoolService.execute(() -> {
if (DebugConfig.getCarMachineType() == CAR_MACHINE_TYPE_SELF_INNOVATE) {
Devices.init(getApp());
Devices.checkBindState();
}
//初始化网络配置
NetConfigUtils.init();
asyncInitImpl();
});
}
/**
* 异步厨初始化
*/
protected void asyncInitImpl() {
}
// 缓存IP地址
private String cacheIp = null;
/**
* 请求获取最新的 DNS 微服务 域名信息
*/
protected void registerSocketHttpDnsTTL(String host) {
sApis.addressChangedListener(map -> {
String dnsCacheIp = sApis.getCachedHttpDnsIps(host, HTTP_DNS_ADDRESS_TYPE_HTTP);
if (dnsCacheIp == null) {
return;
}
if (!dnsCacheIp.equals(cacheIp)) {
CallerLogger.INSTANCE.d("TEST_SOCKET", "获取缓存Dns IP : " + dnsCacheIp + " , 原缓存 IP " + cacheIp);
socketTTL();
this.cacheIp = dnsCacheIp;
}
});
}
protected abstract void socketTTL();
}

View File

@@ -60,7 +60,7 @@ HOOK_LOG_VERSION=1.6.1
SERVICE_CHAIN_VERSION=1.1.0
################ 外部依赖引用 ################
# loglib
LOGLIB_VERSION=1.2.30
LOGLIB_VERSION=1.2.46
######## MogoAiCloudSDK Version ########
# 网络请求LOGLIB_VERSION
MOGO_NETWORK_VERSION=1.3.55
@@ -82,8 +82,8 @@ MOGO_LOCATION_VERSION=1.3.55
MOGO_TELEMATIC_VERSION=1.3.55
######## MogoAiCloudSDK Version ########
# 自研地图
MAP_SDK_VERSION=2.1.0.6-2
MAP_SDK_OPERATION_VERSION=1.0.12
MAP_SDK_VERSION=2.1.1.2
MAP_SDK_OPERATION_VERSION=1.0.13
# websocket
WEBSOCKET_VERSION=1.1.7
## 产品库必备配置产品库自动对versionCode和versionName版本进行升级
@@ -157,3 +157,15 @@ MOGO_AICLOUD_SERVICES_SDK_VERSION=2.1.16.10
# v2x-sdk
MOGO_V2X_SDK_VERSION=1.3.55
################# 旧版本架构模块版本 #################
# ADAS LIB Maven配置用于地图部门测试使用鹰眼项目中使用本地依赖 #
ADAS_LIB_GROUP=com.zhidao.support.adas
ADAS_LIB_POM_ARTIFACT_ID=high
ADAS_LIB_CHILD_VERSION=.0
ADAS_DATA_LIB_GROUP=com.zhjt.mogo.adas.data
ADAS_DATA_LIB_POM_ARTIFACT_ID=adas-data
ADAS_DATA_LIB_CHILD_VERSION=.0

View File

@@ -2,6 +2,7 @@ plugins {
id 'com.android.library'
id 'kotlin-android'
id 'com.google.protobuf'
id 'maven'
}
android {
@@ -60,4 +61,27 @@ android {
dependencies {
api rootProject.ext.dependencies.protobuf_java
api rootProject.ext.dependencies.protobuf_java_util
}
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
//配置需要上传到maven仓库的文件
artifacts {
archives androidSourcesJar
}
uploadArchives {
repositories.mavenDeployer {
repository(url: RELEASE_REPOSITORY_URL) {
authentication(userName: USERNAME, password: PASSWORD)
}
snapshotRepository(url: SNAPSHOT_REPOSITORY_URL) {
authentication(userName: USERNAME, password: PASSWORD)
}
pom.groupId = ADAS_DATA_LIB_GROUP
pom.artifactId = ADAS_DATA_LIB_POM_ARTIFACT_ID
pom.version = versionName + ADAS_DATA_LIB_CHILD_VERSION
}
}

View File

@@ -8,7 +8,10 @@ message LidarPointCloud
optional common.Header header = 1;
optional double self_longitude = 2;
optional double self_latitude = 3;
optional double self_yaw = 4;
repeated float del_data = 7 [packed=true];
repeated float add_data = 8 [packed=true];
optional double self_altitude = 4;
optional double self_roll = 5;
optional double self_pitch = 6;
optional double self_yaw = 7;
repeated float del_data = 8 [packed=true];
repeated float add_data = 9 [packed=true];
}

View File

@@ -1,7 +1,7 @@
plugins {
id 'com.android.library'
id 'com.google.protobuf'
// id 'maven'
id 'maven'
}
//ext {
// //自动驾驶产品版本号
@@ -22,11 +22,6 @@ android {
versionName rootProject.versionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
externalNativeBuild {
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a'
}
}
}
buildTypes {
@@ -77,6 +72,7 @@ dependencies {
implementation 'com.squareup.okhttp3:okhttp:3.12.3'
// parser
implementation rootProject.ext.dependencies.gson
implementation project(':libraries:mogo-adas-data')
// logger
//implementation 'com.orhanobut:logger:2.2.0'
//ProtoBuf
@@ -86,33 +82,40 @@ dependencies {
// api project(path: ':lib_recorder')
// api "com.zhidao.support.recorder:recorder:1.0.0.3"
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
implementation project(':libraries:mogo-adas-data')
} else {
implementation project(':libraries:mogo-adas-data')
}
}
//task androidSourcesJar(type: Jar) {
// classifier = 'sources'
// from android.sourceSets.main.java.srcDirs
//}
////配置需要上传到maven仓库的文件
//artifacts {
// archives androidSourcesJar
//}
//
//uploadArchives {
// repositories.mavenDeployer {
// repository(url: RELEASE_REPO_URL) {
// authentication(userName: NAME, password: PASSWORD)
// }
// snapshotRepository(url: SNAPSHOT_REPOSITORY_URL) {
// authentication(userName: NAME, password: PASSWORD)
// }
// pom.groupId = GROUP
// pom.artifactId = POM_ARTIFACT_ID
// pom.version = VERSION
// }
//}
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
//配置需要上传到maven仓库的文件
artifacts {
archives androidSourcesJar
}
uploadArchives {
repositories.mavenDeployer {
repository(url: RELEASE_REPOSITORY_URL) {
authentication(userName: USERNAME, password: PASSWORD)
}
snapshotRepository(url: SNAPSHOT_REPOSITORY_URL) {
authentication(userName: USERNAME, password: PASSWORD)
}
pom.groupId = ADAS_LIB_GROUP
pom.artifactId = ADAS_LIB_POM_ARTIFACT_ID
pom.version = versionName + ADAS_LIB_CHILD_VERSION
pom.whenConfigured { pom ->
pom.dependencies.forEach { dep ->
if (dep.getVersion() == "unspecified") {
println("--修改pom.xml中的dependies模块--->>" + dep.getArtifactId())
if (dep.getArtifactId() == ADAS_DATA_LIB_POM_ARTIFACT_ID) {
dep.setGroupId(ADAS_DATA_LIB_GROUP)
dep.setVersion(versionName + ADAS_DATA_LIB_CHILD_VERSION)
}
}
}
}
}
}

View File

@@ -1,12 +1,17 @@
package com.zhidao.support.adas.high;
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_ALIAS_CODE_ADAS_START_AUTOPILOT;
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_ALIAS_CODE_CONNECT_ADDRESS;
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_ALIAS_CODE_INIT;
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_ALIAS_CODE_STATUS_CHANGE_REASON;
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_ALIAS_CODE_WEB_SOCKET_MESSAGE_BYTE;
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_LINK_ADAS;
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_LINK_LOG_CONNECT_STATUS;
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -14,6 +19,7 @@ import androidx.annotation.Nullable;
import com.google.gson.Gson;
import com.google.protobuf.InvalidProtocolBufferException;
import com.zhidao.support.adas.high.bean.BaseInfo;
import com.zhidao.support.adas.high.bean.VersionCompatibility;
import com.zhidao.support.adas.high.common.Constants;
import com.zhidao.support.adas.high.common.CupidLogUtils;
import com.zhidao.support.adas.high.common.Define;
@@ -61,6 +67,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
private FpgaSocket mSocket;
private RawUnpack rawUnpack;//数据拆包
private RawPack rawPack;//数据打包
private Timer checkCompatibilityTimer;//检查版本兼容性定时器 连接成功后5秒内等待工控机发送配置信息
/**
* 与工控机链接状态
*/
@@ -428,11 +435,84 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
* @param reason 状态描述
* 如果ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.DISCONNECTED && reason==null 表示主动断开连接
*/
@ChainLog(linkChainLog = CHAIN_LINK_LOG_CONNECT_STATUS,
linkCode = CHAIN_LINK_ADAS,
endpoint = TracingConstants.Endpoint.PAD,
nodeAliasCode = CHAIN_ALIAS_CODE_STATUS_CHANGE_REASON,
paramIndexes = {1},
clientPkFileName = "sn")
private void updateConnectStatus(@Define.IPCConnectionStatus int status, @Nullable String reason) {
ipcConnectionStatus.set(status);
if (adasConnectStatusListener != null) {
adasConnectStatusListener.onConnectionIPCStatus(ipcConnectionStatus.get(), reason);
}
if (status == Constants.IPC_CONNECTION_STATUS.CONNECTED) {
startCheckCompatibility();
} else {
stopCheckCompatibility();
}
}
/**
* 检查兼容性
*/
private void startCheckCompatibility() {
if (checkCompatibilityTimer == null) {
checkCompatibilityTimer = new Timer();
checkCompatibilityTimer.schedule(new TimerTask() {
@Override
public void run() {
if (adasConnectStatusListener != null) {
adasConnectStatusListener.onCompatibility(getVersionCompatibility());
}
stopCheckCompatibility();
}
}, 6 * 1000L);//延时
}
}
private void stopCheckCompatibility() {
if (checkCompatibilityTimer != null) {
checkCompatibilityTimer.cancel();
checkCompatibilityTimer = null;
}
}
/**
* 获取与当前连接工控机兼容性
* 连接状态=已连接 时正常返回其他状态全部为null
*
* @return 兼容性
*/
@Override
public VersionCompatibility getVersionCompatibility() {
//判断是否是已连接成功
if (ipcConnectionStatus.get() == Constants.IPC_CONNECTION_STATUS.CONNECTED) {
MessagePad.CarConfigResp carConfigResp = AdasManager.getInstance().getCarConfig();
boolean isCompatibility = false;
VersionCompatibility.VersionCompatibilityDegree compatibilityDegree = VersionCompatibility.VersionCompatibilityDegree.INCOMPATIBLE;
int appProtocolVersion = AdasManager.getInstance().getProtocolVersion();
int ipcProtocolVersion = -1;
String msg = "与当前连接工控机不兼容";
if (carConfigResp != null) {
ipcProtocolVersion = carConfigResp.getProtocolVersionValue();
if (ipcProtocolVersion == appProtocolVersion) {
isCompatibility = true;
compatibilityDegree = VersionCompatibility.VersionCompatibilityDegree.CONGRUENT;
msg = "与当前连接工控机完美兼容";
} else if (ipcProtocolVersion == 0) {
isCompatibility = false;
compatibilityDegree = VersionCompatibility.VersionCompatibilityDegree.INCOMPATIBLE;
msg = "与当前连接工控机不兼容,工控机协议版本有误";
} else {
isCompatibility = true;
compatibilityDegree = VersionCompatibility.VersionCompatibilityDegree.COMPATIBILITY;
msg = "与当前连接工控机兼容,建议使用相同版本协议通讯";
}
}
return new VersionCompatibility(isCompatibility, compatibilityDegree, appProtocolVersion, ipcProtocolVersion, msg);
}
return null;
}
void setOnAdasListener(OnAdasListener adasListener) {
@@ -507,6 +587,14 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
* @param routeInfo 自动驾驶路径信息
* @return boolean
*/
@ChainLog(
linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT,
linkCode = CHAIN_LINK_ADAS,
endpoint = TracingConstants.Endpoint.PAD,
nodeAliasCode = CHAIN_ALIAS_CODE_ADAS_START_AUTOPILOT,
paramIndexes = {2},
clientPkFileName = "sn"
)
@Override
public boolean sendAutoPilotModeReq(int mode, int source, MessagePad.RouteInfo routeInfo) {
MessagePad.SetAutopilotModeReq.Builder builder = MessagePad.SetAutopilotModeReq.newBuilder();

View File

@@ -5,6 +5,7 @@ import android.content.Context;
import androidx.annotation.NonNull;
import com.zhidao.support.adas.high.bean.BaseInfo;
import com.zhidao.support.adas.high.bean.VersionCompatibility;
import com.zhidao.support.adas.high.common.AppPreferenceHelper;
import com.zhidao.support.adas.high.common.Constants;
@@ -182,6 +183,20 @@ public class AdasManager implements IAdasNetCommApi {
}
}
/**
* 获取与当前连接工控机兼容性
* 连接状态=已连接 时正常返回其他状态全部为null
*
* @return 兼容性
*/
@Override
public VersionCompatibility getVersionCompatibility() {
if (mChannel != null) {
return mChannel.getVersionCompatibility();
}
return null;
}
/**
* 解析工控机发送过来的数据
* 多设备时使用

View File

@@ -3,6 +3,7 @@ package com.zhidao.support.adas.high;
import androidx.annotation.NonNull;
import com.zhidao.support.adas.high.bean.BaseInfo;
import com.zhidao.support.adas.high.bean.VersionCompatibility;
import com.zhidao.support.adas.high.common.Constants;
import mogo.telematics.pad.MessagePad;
@@ -204,5 +205,11 @@ public interface IAdasNetCommApi {
*/
void setEnableLog(boolean isEnableLog);
/**
* 获取与当前连接工控机兼容性
* 连接状态=已连接 时正常返回其他状态全部为null
*
* @return 兼容性
*/
VersionCompatibility getVersionCompatibility();
}

View File

@@ -2,6 +2,7 @@ package com.zhidao.support.adas.high;
import androidx.annotation.Nullable;
import com.zhidao.support.adas.high.bean.VersionCompatibility;
import com.zhidao.support.adas.high.common.Constants;
import com.zhidao.support.adas.high.common.Define;
@@ -21,4 +22,10 @@ public interface OnAdasConnectStatusListener {
*/
void onConnectionIPCStatus(@Define.IPCConnectionStatus int ipcConnectionStatus, @Nullable String reason);
/**
* 与工控机版本的兼容性
*
* @param versionCompatibility 版本兼容对象
*/
void onCompatibility(VersionCompatibility versionCompatibility);
}

View File

@@ -0,0 +1,82 @@
package com.zhidao.support.adas.high.bean;
import com.zhidao.support.adas.high.common.Define;
/**
* 版本兼容性
*/
public class VersionCompatibility {
/**
* 兼容程度
*/
public interface VERSION_COMPATIBILITY_DEGREE {
/**
* 不兼容
*/
int INCOMPATIBLE = 0x00;
/**
* 兼容
*/
int COMPATIBILITY = 0x01;
/**
* 完全一致 全等
*/
int CONGRUENT = 0x02;
}
public enum VersionCompatibilityDegree {
INCOMPATIBLE(VERSION_COMPATIBILITY_DEGREE.INCOMPATIBLE, "INCOMPATIBLE"),
COMPATIBILITY(VERSION_COMPATIBILITY_DEGREE.COMPATIBILITY, "COMPATIBILITY"),
CONGRUENT(VERSION_COMPATIBILITY_DEGREE.CONGRUENT, "CONGRUENT");
@Define.VersionCompatibilityDegree
public final int degree;
public final String desc;
VersionCompatibilityDegree(int degree, String desc) {
this.degree = degree;
this.desc = desc;
}
}
/**
* 是否兼容
*/
public final boolean isCompatibility;
/**
* 版本兼容程度
*/
public final VersionCompatibilityDegree compatibilityDegree;
/**
* 鹰眼使用的协议版本号
*/
public final int appProtocolVersion;
/**
* 工控机使用的协议版本号
*/
public final int ipcProtocolVersion;
/**
* 消息 文本描述
*/
public final String msg;
public VersionCompatibility(boolean isCompatibility, VersionCompatibilityDegree compatibilityDegree, int appProtocolVersion, int ipcProtocolVersion, String msg) {
this.isCompatibility = isCompatibility;
this.compatibilityDegree = compatibilityDegree;
this.appProtocolVersion = appProtocolVersion;
this.ipcProtocolVersion = ipcProtocolVersion;
this.msg = msg;
}
@Override
public String toString() {
return "是否兼容:" + isCompatibility
+ "\n兼容程度" + compatibilityDegree.desc
+ "\nAPP使用协议版本" + appProtocolVersion
+ "\nIPC使用协议版本" + (ipcProtocolVersion == -1 ? "未知" : ipcProtocolVersion)
+ "\n信息" + msg;
}
}

View File

@@ -5,11 +5,15 @@ public class AdasChain {
public static final int CHAIN_LINK_ADAS = 1;
public static final int CHAIN_LINK_LOG_CONNECT_STATUS = 0;
public static final int CHAIN_LINK_LOG_WEB_SOCKET_DATA = 1;
public static final int CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT = 1;
public static final String CHAIN_ALIAS_CODE_INIT = "PAD_ADAS_INIT";
public static final String CHAIN_ALIAS_CODE_STATUS_CHANGE_REASON = "CHAIN_ALIAS_CODE_STATUS_CHANGE_REASON";
public static final String CHAIN_ALIAS_CODE_CONNECT_ADDRESS = "PAD_ADAS_CONNECT_ADDRESS";
public static final String CHAIN_ALIAS_CODE_WEB_SOCKET_OPEN = "PAD_ADAS_WEB_SOCKET_OPEN";
public static final String CHAIN_ALIAS_CODE_WEB_SOCKET_MESSAGE_JSON = "PAD_ADAS_WEB_SOCKET_MESSAGE_JSON";
public static final String CHAIN_ALIAS_CODE_WEB_SOCKET_MESSAGE_BYTE = "PAD_ADAS_WEB_SOCKET_MESSAGE_BYTE";
//operation by user
public static final String CHAIN_ALIAS_CODE_ADAS_START_AUTOPILOT = "CHAIN_ALIAS_CODE_ADAS_START_AUTOPILOT";
}

Some files were not shown because too many files have changed in this diff Show More