Merge branch 'dev_arch_opt_3.0' into dev_robosweeper-d_app-module_221230_1.1.0

# Conflicts:
#	OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/model/SweeperOrderModel.java
#	OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java
This commit is contained in:
donghongyu
2023-02-17 14:23:49 +08:00
43 changed files with 585 additions and 211 deletions

View File

@@ -12,6 +12,14 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugViewTrigger
android:layout_width="@dimen/dp_400"
android:layout_height="@dimen/dp_100"
android:longClickable="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<com.mogo.eagle.core.function.hmi.ui.widget.SteeringWheelView
android:id="@+id/steering_wheel"
android:layout_width="@dimen/dp_490"

View File

@@ -11,6 +11,14 @@
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugViewTrigger
android:layout_width="@dimen/dp_400"
android:layout_height="@dimen/dp_100"
android:longClickable="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<FrameLayout
android:id="@+id/fl_speed"
android:layout_width="@dimen/dp_616"
@@ -94,7 +102,7 @@
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
android:id="@+id/viewLimitingVelocity"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginEnd="40dp"
android:elevation="@dimen/dp_10"

View File

@@ -24,10 +24,7 @@ class OchNoopFragment : MvpFragment<OchNoopContract.View?, OchNoopPresenter?>(),
}
override fun initViews() {
viewShowDebugView.setOnLongClickListener {
ToggleDebugView.toggleDebugView.toggle(requireContext())
true
}
}

View File

@@ -6,19 +6,19 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:id="@+id/viewShowDebugView"
android:layout_width="@dimen/dp_400"
android:layout_height="@dimen/dp_100"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<com.mogo.eagle.core.function.view.MapBizView
android:id="@+id/mapBizView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugViewTrigger
android:layout_width="@dimen/dp_400"
android:layout_height="@dimen/dp_100"
android:longClickable="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<!--刹车、转向-->
<com.mogo.eagle.core.function.hmi.ui.vehicle.SteeringBrakeView
android:layout_width="wrap_content"
@@ -96,7 +96,7 @@
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
android:id="@+id/viewLimitingVelocity"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginEnd="40dp"
android:elevation="@dimen/dp_10"

View File

@@ -15,6 +15,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.och.common.module.manager.OCHAdasAbilityManager;
import com.mogo.och.taxi.passenger.bean.TaxiPassengerOrderQueryRespBean;
import com.mogo.och.taxi.passenger.bean.TaxiPassengerScoreUpdateOrderReqBean;
import com.mogo.och.taxi.passenger.callback.IOCHTaxiPassengerADASStatusCallback;
@@ -27,8 +28,6 @@ import com.mogo.och.taxi.passenger.model.TaxiPassengerModel;
import com.mogo.och.taxi.passenger.ui.TaxiPassengerBaseFragment;
import com.mogo.och.taxi.passenger.ui.leftmenu.LeftMenuOpen;
import mogo.telematics.pad.MessagePad;
/**
* @author: wangmingjun
* @date: 2022/3/4
@@ -44,6 +43,7 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
public BaseTaxiPassengerPresenter(TaxiPassengerBaseFragment view) {
super(view);
TaxiPassengerModel.getInstance().init(AbsMogoApplication.getApp());
OCHAdasAbilityManager.getInstance().init(AbsMogoApplication.getApp());
initListeners();
}
@@ -59,6 +59,7 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
releaseListeners();
TaxiPassengerModel.getInstance().release();
OCHAdasAbilityManager.getInstance().release();
}
private void initListeners() {
@@ -162,11 +163,11 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
// 70 取消订单
if (TaxiPassengerOrderStatusEnum.Cancel.getCode() == order.orderStatus){
runOnUIThread(() -> {
mView.showOrHideServingOrderFragment(false,true);
mView.showOrHideStartAutopilotView(false,false);
mView.showOrHidePressengerCheckPager(false, "",
"", "", "", "");
mView.showOrHideArrivedEndLayout(false,"","");
mView.showOrHideServingOrderFragment(false,true);
mView.showOrHideStartAutopilotView(false,false);
mView.showOrHidePressengerCheckPager(false, "",
"", "", "", "");
mView.showOrHideArrivedEndLayout(false,"","");
});
TaxiPassengerModel.getInstance().recoverNaviInfo();
TaxiPassengerGeocodeSearchModel.getInstance(getContext()).destroyGeocodeSearch();
@@ -200,7 +201,6 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
mView.showOrHideServingOrderFragment(true,true);
});
TaxiPassengerModel.getInstance().startOrStopReadyToAutopilotLoop(false);
CallerSmpManager.startQueryV2XEvents();//全览模式的V2X事件轮询开始
}
// 30 用户到达上车点 并通过了手机号后四位验证
// 40 服务中

View File

@@ -10,6 +10,14 @@
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugViewTrigger
android:layout_width="@dimen/dp_400"
android:layout_height="@dimen/dp_100"
android:longClickable="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<com.mogo.eagle.core.function.hmi.ui.widget.SteeringWheelView
android:id="@+id/steering_wheel"
android:layout_width="@dimen/dp_630"

View File

@@ -11,6 +11,14 @@
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugViewTrigger
android:layout_width="@dimen/dp_400"
android:layout_height="@dimen/dp_100"
android:longClickable="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<LinearLayout
android:id="@+id/module_mogo_och_speed_layout"
android:layout_height="@dimen/taxi_tab_speed_width_height"
@@ -150,7 +158,7 @@
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
android:id="@+id/viewLimitingVelocity"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginEnd="40dp"
android:elevation="@dimen/dp_10"

View File

@@ -20,7 +20,7 @@ project.android.productFlavors {
//高德地图鉴权信息
manifestPlaceholders = [
AMAP_API_VALUE : rootProject.ext.android.fLauncherAmapApiValue,
CHANNEL_VALUE : "fPadLenovoOchBus",
CHANNEL_VALUE : "fMultiDisplayOchBus",
ACTIVITY_ROOT : true,
SCREEN_ORIENTATION: "landscape"
]

View File

@@ -23,7 +23,7 @@ project.android.productFlavors {
// 高德地图鉴权信息
AMAP_API_VALUE : rootProject.ext.android.fLauncherAmapApiValue,
// BUGLY_APP_CHANNEL
CHANNEL_VALUE : "fPadLenovoOchTaxi",
CHANNEL_VALUE : "fMultiDisplayOchTaxi",
// 在启动的时候把Task给清空
ACTIVITY_ROOT : true,
// Activity的朝向

View File

@@ -11,10 +11,12 @@ public abstract class BaseInfo {
public final long nowTime;
public final MessagePad.Header header;
public final int len;
public final int payloadLen;
private SimpleDateFormat sdf;
public BaseInfo(String action, int len, MessagePad.Header header, SimpleDateFormat sdf) {
this.action = action;
this.payloadLen = len;
nowTime = System.currentTimeMillis();
this.len = 8 + header.getSerializedSize() + len;
this.header = header;
@@ -25,12 +27,13 @@ public abstract class BaseInfo {
this.action = action;
nowTime = System.currentTimeMillis();
this.len = len;
this.payloadLen = len;
this.header = null;
}
@Override
public String toString() {
return "原始数据长度:" + len + "\nHeader:[" + "MessageID:" + header.getMsgID() +
return "原始数据长度:" + len + "\tPayload数据长度" + payloadLen + "\nHeader:[" + "MessageID:" + header.getMsgID() +
" MessageType:" + header.getMsgType() + " 发送时间:" + sdf.format(new Date((long) (header.getTimestamp() * 1000)))
+ " 数据源时间:" + sdf.format(new Date((long) (header.getSourceTimestamp() * 1000))) + "]\n";
}

View File

@@ -17,6 +17,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84Lis
import com.mogo.eagle.core.function.call.obu.CallerObuLocationWGS84ListenerManager
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.util.CoordinateTransform
import com.mogo.eagle.core.utilcode.util.MultiDisplayUtils
import com.mogo.eagle.core.utilcode.util.TimeUtils
import com.mogo.eagle.core.utilcode.util.Utils
import com.mogo.support.obu.model.MogoObuHvBasicsData
@@ -124,6 +125,7 @@ object MoGoLocationDispatcher :
DataSourceType.TELEMATIC
)
}
MultiDisplayUtils.getOtherDisplay()
}
/**

View File

@@ -11,12 +11,14 @@ import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.api.map.angle.Default
import com.mogo.eagle.core.function.api.map.angle.TooClose
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
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.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.call.obu.CallerObuConnectListenerManager
import com.mogo.eagle.core.function.call.obu.CallerObuLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.obu.CallerObuWarningListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.datacenter.obu.utils.TrafficDataConvertUtilsNew
@@ -577,18 +579,24 @@ class MogoPrivateObuNewManager private constructor() {
info: ObuScene.RvWarningData
) {
// 这里排除需要特殊定制的语音及文案外,其余的都可以使用 EventTypeEnumNew 提供的
var alertContent: String = ""
var ttsContent: String = ""
var alertContent = ""
var ttsContent = ""
var v2xType = appId
var changeVisualAngle = false
when (appId) {
//前向碰撞预警
MogoObuConstants.V2X_WARNING_TYPE.FCW.toString() -> {
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
// ObuManager.getInstance().obuRvToTrackedObject(info) //todo emArrow
if (FunctionBuildConfig.isObuWarningFusionUnion) {
alertContent = "前车距离过近"
ttsContent = "前车距离过近"
CallerObuWarningListenerManager.invokeTrackerFusionData(ObuManager.getInstance().obuRvToTrackedObject(info))
} else {
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
}
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType
}
//交叉路口碰撞预警
@@ -597,6 +605,7 @@ class MogoPrivateObuNewManager private constructor() {
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType)
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType
}
//左转辅助预警
@@ -605,6 +614,7 @@ class MogoPrivateObuNewManager private constructor() {
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType)
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType
}
//盲区预警
@@ -613,6 +623,7 @@ class MogoPrivateObuNewManager private constructor() {
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType)
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType)
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType
if (
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
@@ -638,7 +649,8 @@ class MogoPrivateObuNewManager private constructor() {
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType)
if (
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType
if (
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
@@ -661,6 +673,7 @@ class MogoPrivateObuNewManager private constructor() {
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType)
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType
}
//紧急制动预警
@@ -669,6 +682,7 @@ class MogoPrivateObuNewManager private constructor() {
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType)
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType
}
//异常车辆提醒
@@ -687,6 +701,7 @@ class MogoPrivateObuNewManager private constructor() {
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType)
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType
alertContent = String.format(alertContent, direction.desc)
ttsContent = String.format(ttsContent, direction.desc)
}
@@ -696,6 +711,7 @@ class MogoPrivateObuNewManager private constructor() {
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType
}
// 这里处理固定的提示信息,包括了<紧急车辆提醒>
@@ -715,9 +731,9 @@ class MogoPrivateObuNewManager private constructor() {
)
if (level == 2 || level == 3) {
//不显示弹框,其它保留
saveObuData(appId, alertContent, ttsContent)
saveObuData(v2xType, alertContent, ttsContent)
CallerHmiManager.warningV2X(
appId,
v2xType,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
object : IMoGoWarningStatusListener {
@@ -736,10 +752,12 @@ class MogoPrivateObuNewManager private constructor() {
}, direction
)
}
//更新周边车辆进行预警颜色变换,车辆实时移动和变色 UUID不需要匹配了
TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let {
CallerMapUIServiceManager.getMarkerService()
?.updateITrafficThreatLevelInfo(it)
CallerObuWarningListenerManager.invokeTrackerWarningInfo(it)
}
}
// 删除
@@ -751,6 +769,7 @@ class MogoPrivateObuNewManager private constructor() {
it.threatLevel = 0x01
CallerMapUIServiceManager.getMarkerService()
?.updateITrafficThreatLevelInfo(it)
CallerObuWarningListenerManager.removeTrackerWarningInfo(it)
}
}
}
@@ -815,13 +834,24 @@ class MogoPrivateObuNewManager private constructor() {
if (!isShowRunRedLight) {
isShowRunRedLight = true
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "changeTrafficLightStatus 闯红灯 --------> ")
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"changeTrafficLightStatus 闯红灯 --------> "
)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
saveObuData(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent)
showWarning(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent, WarningDirectionEnum.ALERT_WARNING_NON)
saveObuData(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
alertContent,
ttsContent
)
showWarning(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
alertContent,
ttsContent,
WarningDirectionEnum.ALERT_WARNING_NON
)
}
}
@@ -839,16 +869,27 @@ class MogoPrivateObuNewManager private constructor() {
ttsContent =
String.format(
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
adviceSpeedTts)
adviceSpeedTts
)
alertContent =
String.format(
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
adviceSpeed)
adviceSpeed
)
val maxSpeed = currentLight.suggestMaxSpeed
if (maxSpeed > 0) {
saveObuData(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, ttsContent)
showWarning(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, ttsContent, WarningDirectionEnum.ALERT_WARNING_NON)
saveObuData(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
alertContent,
ttsContent
)
showWarning(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
alertContent,
ttsContent,
WarningDirectionEnum.ALERT_WARNING_NON
)
}
}
}
@@ -914,7 +955,12 @@ class MogoPrivateObuNewManager private constructor() {
/**
* 消息盒子对应消息的语音播报
*/
private fun showWarning(type: String, content: String, tts: String, direction: WarningDirectionEnum) {
private fun showWarning(
type: String,
content: String,
tts: String,
direction: WarningDirectionEnum
) {
CallerHmiManager.warningV2X(
type,
content,

View File

@@ -158,6 +158,10 @@ class DevaToolsProvider : IDevaToolsProvider {
upgradeManager.updateUpgradeProgress(mContext!!)
}
override fun updateObuUpgradeStatus() {
upgradeManager.updateObuUpgradeStatus(mContext!!)
}
override fun showStatusBar(ctx: Context, container: ViewGroup) {
StatusManager.init(ctx)
StatusManager.show(container)

View File

@@ -43,6 +43,8 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
fun init(context: Context) {
mContext = context
SharedPrefsMgr.getInstance(mContext!!).putLong("typeDriver", 0)
SharedPrefsMgr.getInstance(mContext!!).putLong("typePassenger", 0)
CallerAutopilotCarConfigListenerManager.addListener(TAG, this)
ipcUpgradeManager.init(context)
UiThreadHandler.postDelayed({ queryAppUpgrade() }, 10_000)
@@ -57,6 +59,9 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
if (carConfigResp != null && !TextUtils.isEmpty(carConfigResp.macAddress)) {
Log.d("Upgrade", "MoGoHandAdasMsgManager address = " + carConfigResp.macAddress)
getBindingCarInfo(carConfigResp.macAddress, MoGoAiCloudClientConfig.getInstance().sn)
//obu的升级,只需要司机屏连接
queryObuUpgrade(carConfigResp.macAddress)
}
}
@@ -162,11 +167,11 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
}
/**
* 司机屏 处理obu升级即可,乘客屏不需要处理 TODO OBU的角色
* 司机屏 处理obu升级即可,乘客屏不需要处理
*
*/
fun queryObuUpgrade() {
ObuUpgradeAppNetWorkManager.getInstance().getObuUpgradeInfo(mContext, mAddress, role.toString() + "")
private fun queryObuUpgrade(macAddress: String) {
ObuUpgradeAppNetWorkManager.getInstance().getObuUpgradeInfo(mContext, macAddress)
}
}

View File

@@ -74,17 +74,20 @@ class BindingCarNetWorkManager private constructor() {
override fun onSubscribe(d: Disposable) {}
override fun onNext(info: BindingCarInfo) {
if (info != null && info.getData() != null) {
d(SceneConstant.M_BINDING + TAG, "getBindingCarInfo data =" + info.getData().toString())
if (!SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.MAC_ADDRESS).equals(macAddress) && DebugConfig.isCarModelChange()) {
updateCarVrIconRes(info.getData().brandId);
}
d(
SceneConstant.M_BINDING + TAG,
"getBindingCarInfo data =" + info.getData().toString()
)
updateCarVrIconRes(info.getData().brandId);
when (info.getData().compare) {
"0" -> showBindingCarDialog()
"3" -> showModifyBindingCarDialog()
"null" -> TipToast.shortTip("当前工控机没有入库")
}
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.CAR_INFO, GsonUtils.toJson(info.getData()))
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.MAC_ADDRESS, macAddress)
SharedPrefsMgr.getInstance(context).putString(
SharedPrefsConstants.CAR_INFO,
GsonUtils.toJson(info.getData())
)
}
}
@@ -133,10 +136,7 @@ class BindingCarNetWorkManager private constructor() {
SceneConstant.M_BINDING + TAG,
"modifyBindingCar onNext code = " + info.code + "---msg = " + info.msg + "--info.toString() = " + info.toString()
)
if (!SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.MAC_ADDRESS).equals(macAddress) && DebugConfig.isCarModelChange()) {
updateCarVrIconRes(info.data.brandId);
}
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.MAC_ADDRESS, macAddress)
updateCarVrIconRes(info.data.brandId)
}
}
@@ -155,6 +155,9 @@ class BindingCarNetWorkManager private constructor() {
if (brandId == null || brandId.isEmpty()) {
return
}
if (getDefaultId() == brandId) {
return
}
d(SceneConstant.M_BINDING + TAG, "updateCarVrIconRes : $brandId")
when (brandId) {
"1" -> {
@@ -176,4 +179,12 @@ class BindingCarNetWorkManager private constructor() {
}
}
private fun getDefaultId(): String {
return when (HdMapBuildConfig.currentCarVrIconRes) {
R.raw.chuzuche -> "1"
R.raw.xiaobache -> "3"
else -> "1"
}
}
}

View File

@@ -7,6 +7,7 @@ import android.content.Context;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.constants.HostConst;
import com.mogo.eagle.core.data.bindingcar.UpgradeAppInfo;
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.network.MoGoRetrofitFactory;
import com.mogo.eagle.core.network.utils.GsonUtil;
@@ -48,17 +49,17 @@ public class ObuUpgradeAppNetWorkManager {
}
/**
* 获取obu升级信息
* 获取obu升级信息obu升级服务端使用app升级接口根据screenType区分类型
* mac 工控机mac地址
* screenType 类型
*/
public void getObuUpgradeInfo(Context context, String mac, String screenType) {
public void getObuUpgradeInfo(Context context, String mac) {
// String sn = "X20202203105S688HZ";
// String mac = "48:b0:2d:3a:bc:78";
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
int versionCode = AppUtils.getAppVersionCode();
CallerLogger.INSTANCE.d(M_BINDING + TAG, "getObuUpgradeInfo mac = " + mac + "---type = " + screenType + "---sn = " + sn + "---versionCode =" + versionCode);
UpgradeAppRequest request = new UpgradeAppRequest(sn, mac, screenType);
String obuVersionName = String.valueOf(AppUtils.getAppVersionCode()); // TODO 获取obu的版本号, string和int 服务端处理
CallerLogger.INSTANCE.d(M_BINDING + TAG, "getObuUpgradeInfo mac = " + mac + "---sn = " + sn + "---obuVersionName =" + obuVersionName);
UpgradeAppRequest request = new UpgradeAppRequest(sn, mac, "7");
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request));
mUpgradeApiService.getUpgradeInfo(requestBody)
.subscribeOn(Schedulers.io())
@@ -71,9 +72,10 @@ public class ObuUpgradeAppNetWorkManager {
@Override
public void onNext(@NonNull UpgradeAppInfo info) {
if (info != null && info.result != null) {
CallerLogger.INSTANCE.d(M_BINDING + TAG, "getObuUpgradeInfo url = " + info.result.getAppUrl() + "----code = " + info.result.getVersionCode() + "--versionCode =" + versionCode + "--info.result = " + info.result);
if (info.result.getVersionCode() > versionCode) {
CallerHmiManager.INSTANCE.showUpgradeDialog(info.result.getAppUrl().substring(info.result.getAppUrl().lastIndexOf("/")+1), info.result.getAppUrl(), info.result.getInstallTitle(), info.result.getInstallContent(), info.result.getInstallType());
CallerLogger.INSTANCE.d(M_BINDING + TAG, "getObuUpgradeInfo url = " + info.result.getAppUrl() + "----name = " + info.result.getVersionName() + "--obuVersionName =" + obuVersionName + "--info.result = " + info.result);
if (!String.valueOf(info.result.getVersionName()).equals(obuVersionName)) {
//下载 TAG和文件名 TODO
CallerDevaToolsManager.INSTANCE.downLoadPackage("OBU", info.result.getAppUrl());
}
} else {
CallerLogger.INSTANCE.d(M_BINDING + TAG, "getObuUpgradeInfo onNext info == null");

View File

@@ -14,6 +14,8 @@ import com.mogo.eagle.core.utilcode.breakpoint.utils.DownloadUtils
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.AppUtils
import com.mogo.eagle.core.utilcode.util.ZipUtils
import java.io.IOException
class UpgradeManager : IDownload {
@@ -116,6 +118,9 @@ class UpgradeManager : IDownload {
}
}
/**
* 鹰眼app下载监听
*/
fun updateUpgradeProgress(context: Context) {
val builder = NotificationCompat.Builder(context)
// builder.setSmallIcon(R.mipmap.icon1001);//todo emArrow 更换图标,去除地图下载图标的依赖关系
@@ -147,4 +152,34 @@ class UpgradeManager : IDownload {
})
}
/**
* obu升级包下载监听
*/
fun updateObuUpgradeStatus(context: Context) {
CallerDevaToolsUpgradeListenerManager.addListener(
TAG,
object : IMogoDevaToolsUpgradeListener {
override fun onStart(url: String?) {}
override fun onPause(url: String?) {}
override fun onProgress(url: String?, length: Int) {
}
override fun onFinished(url: String?) {
//下载完成,解压文件 TODO
try {
val files = ZipUtils.unzipFile("", "")
//传给obu升级
} catch (e: IOException) {
//解压失败
e.printStackTrace()
}
}
override fun onError(url: String?, errorMsg: String?) {}
})
}
}

View File

@@ -20,8 +20,7 @@ import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo.NoticeTrafficAccou
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.data.notice.NoticeValue
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.startAutoPilot
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lat
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lon
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager.bizProvider
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
@@ -201,8 +200,8 @@ class NoticeTrafficDialog : BaseFloatDialog, LifecycleObserver {
mTrafficStyleInfo!!.lat, mTrafficStyleInfo!!.lon
)
parameters.startLatLon = AutoPilotLonLat(
getCurWgs84Lat(),
getCurWgs84Lon()
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude,
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude
)
parameters.endLatLon = AutoPilotLonLat(gcj02[0], gcj02[1])
startAutoPilot(parameters)

View File

@@ -0,0 +1,16 @@
package com.mogo.eagle.core.function.hmi.ui.setting
import android.content.Context
import android.util.AttributeSet
import android.view.View
class ToggleDebugViewTrigger(context: Context, attrs: AttributeSet?
) : View(context, attrs){
init {
setOnLongClickListener {
ToggleDebugView.toggleDebugView.toggle(this.context)
true
}
}
}

View File

@@ -12,10 +12,12 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.map.*
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.Utils
import kotlinx.android.synthetic.main.view_steering_brake.view.*
@@ -30,6 +32,7 @@ class SteeringBrakeView(context: Context, attrs: AttributeSet?) : ConstraintLayo
private const val TAG = "SteeringBrakeView"
}
@Volatile
private var isShowTurnLight = false
private var brakeLight = -1
@@ -59,11 +62,13 @@ class SteeringBrakeView(context: Context, attrs: AttributeSet?) : ConstraintLayo
"$M_HMI$TAG",
"---onAutopilotLightSwitchData ---Acceleration = " + gnssInfo.acceleration + "-- brakeLight = " + brakeLight
)
if (!isShowTurnLight) { //在不展示转向灯的情况下,展示车辆刹车的动效
brakeView.visibility = View.VISIBLE
brakeView.setBrakeLight(brakeLight)
} else {
brakeView.visibility = View.GONE
ThreadUtils.runOnUiThread {
if (!isShowTurnLight) { //在不展示转向灯的情况下,展示车辆刹车的动效
brakeView.visibility = View.VISIBLE
brakeView.setBrakeLight(brakeLight)
} else {
brakeView.visibility = View.GONE
}
}
}
}
@@ -73,13 +78,16 @@ class SteeringBrakeView(context: Context, attrs: AttributeSet?) : ConstraintLayo
//can数据转发 转向灯状态 0是正常 1是左转 2是右转
if (lightSwitch != null) {
CallerLogger.d("$M_HMI$TAG", "---lightSwitch.getNumber() = " + lightSwitch.number)
if (lightSwitch.number == 1 || lightSwitch.number == 2) {
isShowTurnLight = true
brakeView.visibility = View.VISIBLE
brakeView.setBrakeLight(0)
} else {
brakeView.visibility = View.GONE
isShowTurnLight = false
ThreadUtils.runOnUiThread {
if (lightSwitch.number == 1 || lightSwitch.number == 2) {
isShowTurnLight = true
brakeView.visibility = View.VISIBLE
brakeView.setBrakeLight(0)
} else {
brakeView.visibility = View.GONE
isShowTurnLight = false
}
turnLightView.visibility = View.VISIBLE
}
}
}

View File

@@ -12,15 +12,10 @@ import android.widget.ImageView
import androidx.constraintlayout.widget.ConstraintLayout
import chassis.Chassis
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
import com.mogo.eagle.core.function.api.map.angle.Turning
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
import com.mogo.eagle.core.function.hmi.R
import kotlinx.android.synthetic.main.view_steering_brake.view.*
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import kotlinx.android.synthetic.main.view_turn_light_status.view.*
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
/**
* @description
@@ -39,6 +34,9 @@ open class TurnLightViewStatus @JvmOverloads constructor(
}
private val visible: Boolean
private var isLeftLight: Boolean = false
private var isRightLight: Boolean = false
private var isDisappear: Boolean = false
init {
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.TurnLightView)
@@ -71,8 +69,9 @@ open class TurnLightViewStatus @JvmOverloads constructor(
override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
super.onAutopilotLightSwitchData(lightSwitch)
lightSwitch?.let {
turnLightView.visibility = View.VISIBLE
setTurnLight(it)
ThreadUtils.runOnUiThread {
setTurnLight(it)
}
}
}
@@ -83,27 +82,37 @@ open class TurnLightViewStatus @JvmOverloads constructor(
if (!isAttachedToWindow) {
return
}
GlobalScope.launch(Dispatchers.Main) {
//根据左右进行显示和隐藏,实际要判断每个来的时间和频度
when (directionLight) {
Chassis.LightSwitch.LIGHT_LEFT -> { //左转向
CallerVisualAngleManager.changeAngle(Turning(true))
//根据左右进行显示和隐藏,实际要判断每个来的时间和频度
when (directionLight.number) {
Chassis.LightSwitch.LIGHT_LEFT_VALUE -> { //左转向
if (!isLeftLight) {
isLeftLight = true
isRightLight = false
isDisappear = false
showNormalAnimation()
left_select_image.visibility = View.VISIBLE
right_select_image.visibility = View.GONE
right_select_image.clearAnimation()
setAnimation(left_select_image)
}
Chassis.LightSwitch.LIGHT_RIGHT -> { //右转向
CallerVisualAngleManager.changeAngle(Turning(true))
}
Chassis.LightSwitch.LIGHT_RIGHT_VALUE -> { //右转向
if (!isRightLight) {
isRightLight = true
isLeftLight = false
isDisappear = false
showNormalAnimation()
left_select_image.visibility = View.GONE
right_select_image.visibility = View.VISIBLE
left_select_image.clearAnimation()
setAnimation(right_select_image)
}
else -> { //消失
CallerVisualAngleManager.changeAngle(Turning(false))
}
Chassis.LightSwitch.LIGHT_NONE_VALUE -> { //消失
if (!isDisappear) {
isDisappear = true
isLeftLight = false
isRightLight = false
animationDisappear()
}
}
@@ -154,8 +163,10 @@ open class TurnLightViewStatus @JvmOverloads constructor(
}
override fun onAnimationEnd(p0: Animation?) {
left_nor_image.visibility = View.GONE
right_nor_image.visibility = View.GONE
if (!visible) {
left_nor_image.visibility = View.GONE
right_nor_image.visibility = View.GONE
}
}
})
@@ -167,10 +178,9 @@ open class TurnLightViewStatus @JvmOverloads constructor(
}
override fun onAnimationEnd(p0: Animation?) {
if (visible) {
if (!visible) {
turn_light_layout.visibility = View.GONE
}
stopAnimate()
}
})
}
@@ -179,19 +189,13 @@ open class TurnLightViewStatus @JvmOverloads constructor(
private fun setAnimation(imageView: ImageView) {
val animationSet = AnimatorSet()
val valueAnimator = ObjectAnimator.ofFloat(imageView, "alpha", 0f, 1.0f)
val valueAnimatorDisappare = ObjectAnimator.ofFloat(imageView, "alpha", 1.0f, 0f)
val valueAnimatorDisappear = ObjectAnimator.ofFloat(imageView, "alpha", 1.0f, 0f)
valueAnimator.duration = 1000
valueAnimatorDisappare.duration = 800
valueAnimatorDisappear.duration = 800
valueAnimator.repeatCount = -1
valueAnimatorDisappare.repeatCount = -1
animationSet.playTogether(valueAnimatorDisappare, valueAnimator)
valueAnimatorDisappear.repeatCount = -1
animationSet.playTogether(valueAnimatorDisappear, valueAnimator)
animationSet.start()
}
private fun stopAnimate() {
turn_light_layout.clearAnimation()
left_nor_image.clearAnimation()
right_nor_image.clearAnimation()
}
}

View File

@@ -10,8 +10,7 @@ import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lat
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lon
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
@@ -80,7 +79,10 @@ class AutoPilotStatusView constructor(
currentAutopilot.endName = "HYJC"
currentAutopilot.isSpeakVoice = false
currentAutopilot.startLatLon =
AutopilotControlParameters.AutoPilotLonLat(getCurWgs84Lat(), getCurWgs84Lon())
AutopilotControlParameters.AutoPilotLonLat(
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude,
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude
)
currentAutopilot.endLatLon =
AutopilotControlParameters.AutoPilotLonLat(26.819716071924688, 112.57715442110867)
currentAutopilot.vehicleType = 10

View File

@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui.widget
import android.content.Context
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
@@ -12,6 +13,7 @@ import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import kotlinx.android.synthetic.main.view_limiting_speed_vr.view.*
/**
@@ -37,13 +39,16 @@ class LimitingVelocityView constructor(
}
override fun onLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
if (limitingVelocity > 0) {
this.visibility = View.VISIBLE
tvLimitingVelocity.text = "$limitingVelocity"
tvLimitingSource.text = sourceType.name
} else {
this.visibility = View.GONE
tvLimitingSource.text = ""
ThreadUtils.runOnUiThread {
if (limitingVelocity > 0) {
visibility = View.VISIBLE
tvLimitingVelocity.text = "$limitingVelocity"
Log.d("emArrow","limit : ${ DataSourceType.getName(sourceType)}")
tvLimitingSource.text = DataSourceType.getName(sourceType)
} else {
visibility = View.GONE
tvLimitingSource.text = ""
}
}
}

View File

@@ -53,6 +53,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
CallerMsgBoxManager.INSTANCE.queryAllMessages(this);
}
CallerDevaToolsManager.INSTANCE.updateUpgradeProgress();
CallerDevaToolsManager.INSTANCE.updateObuUpgradeStatus();
}
@Override

View File

@@ -23,14 +23,12 @@
android:id="@+id/tvLimitingSource"
android:layout_width="120dp"
android:layout_height="35dp"
android:layout_marginEnd="40dp"
android:gravity="center"
android:text=""
android:text="123"
android:textColor="@color/color_FFFFFF"
android:textSize="@dimen/dp_30"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvLimitingVelocity"
android:visibility="gone" />
app:layout_constraintTop_toBottomOf="@+id/tvLimitingVelocity" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -4,10 +4,13 @@ import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_IDENTIFY
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.api.base.IMoGoSubscriber
import com.mogo.eagle.core.function.api.map.marker.IMoGoIdentifyListener
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.eagle.core.function.call.obu.CallerObuWarningListenerManager
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import mogo.telematics.pad.MessagePad
import mogo.telematics.pad.MessagePad.TrackedObject
@@ -21,7 +24,7 @@ import mogo.yycp.api.proto.SocketDownData
*/
@Route(path = PATH_IDENTIFY)
class MapIdentifySubscriber private constructor() : IMoGoIdentifyListener, IMoGoSubscriber,
IMoGoAutopilotIdentifyListener {
IMoGoAutopilotIdentifyListener, IMoGoObuStatusListener {
private val TAG = "MapIdentifySubscriber"
@@ -37,11 +40,12 @@ class MapIdentifySubscriber private constructor() : IMoGoIdentifyListener, IMoGo
override fun onCrate() {
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
CallerObuWarningListenerManager.addListener(TAG, this)
}
override fun onDestroy() {
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
CallerObuWarningListenerManager.removeListener(TAG)
}
override fun onAutopilotIdentifyDataUpdate(trafficData: List<TrackedObject>?) {
@@ -62,7 +66,6 @@ class MapIdentifySubscriber private constructor() : IMoGoIdentifyListener, IMoGo
try {
if (FunctionBuildConfig.isDrawAiCloudFusion) {
ThreadUtils.getSinglePool().execute {
// aiCloudDataDrawer.renderAiCloudResult(cloudData)
IdentifyFactory.renderAiCloudResult(cloudData)
}
} else {
@@ -74,7 +77,6 @@ class MapIdentifySubscriber private constructor() : IMoGoIdentifyListener, IMoGo
}
fun clearAiCloudRoma() {
// aiCloudDataDrawer.clearAiMarker()
IdentifyFactory.clearAiMarker()
}
@@ -92,6 +94,47 @@ class MapIdentifySubscriber private constructor() : IMoGoIdentifyListener, IMoGo
}
}
override fun updateTrackerFusionData(trackObject: TrackedObject?) {
super.updateTrackerFusionData(trackObject)
try {
if (FunctionBuildConfig.isObuWarningFusionUnion) {
ThreadUtils.getSinglePool().execute {
//todo emArrow
}
} else {
}
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun updateTrackerWarningInfo(trafficData: TrafficData) {
super.updateTrackerWarningInfo(trafficData)
try {
if (FunctionBuildConfig.isObuWarningFusionUnion) {
ThreadUtils.getSinglePool().execute {
IdentifyFactory.renderOBUWarningObj(true, trafficData)
}
} else {
IdentifyFactory.renderOBUWarningObj(false, trafficData)
}
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun removeTrackerWarningInfo(trafficData: TrafficData) {
super.removeTrackerWarningInfo(trafficData)
try {
ThreadUtils.getSinglePool().execute {
IdentifyFactory.renderOBUWarningObj(false, trafficData)
}
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun getIdentifyObj(uuid: String): TrackedObject? {
return IdentifyFactory.getIdentifyObj(uuid)
}

View File

@@ -5,16 +5,20 @@ import android.graphics.Color;
import android.os.Handler;
import android.os.HandlerThread;
import android.util.Log;
import androidx.core.util.Pools;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager;
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils;
import com.mogo.map.MogoOverlayManager;
import com.mogo.map.overlay.IMogoOverlayManager;
import com.mogo.map.overlay.IMogoPolyline;
import com.mogo.map.overlay.MogoPolylineOptions;
import java.util.LinkedList;
import java.util.List;
import mogo.telematics.pad.MessagePad;
public class RouteOverlayDrawer {
@@ -128,8 +132,8 @@ public class RouteOverlayDrawer {
pps.add(acquire);
RouteStrategy.INSTANCE.check(route.getVelocity(), route.getAcceleration(), routeList.size());
}
double lon = CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon();
double lat = CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat();
double lon = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLongitude();
double lat = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLatitude();
if (points.size() > 0) {
MogoLatLng top = null;
while (points.size() != 0) {
@@ -140,8 +144,8 @@ public class RouteOverlayDrawer {
if (first == top) {
break;
}
lon = CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon();
lat = CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat();
lon = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLongitude();
lat = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLatitude();
long angle = isPointOnCarFront(lon, lat, bearing, first.lon, first.lat);
if (angle >= 90) {
RouteStrategy.INSTANCE.remove(first.acc);

View File

@@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.view
import android.content.Context
import android.os.Bundle
import android.util.AttributeSet
import android.util.Log
import androidx.lifecycle.LifecycleObserver
import chassis.Chassis
import com.mogo.eagle.core.data.map.MogoLocation
@@ -12,14 +13,16 @@ import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
import com.mogo.map.MogoMapView
class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context, attrs), IMoGoSkinModeChangeListener,
IMoGoChassisLocationWGS84Listener, IMoGoChassisLamplightListener , LifecycleObserver {
companion object{
class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context, attrs),
IMoGoSkinModeChangeListener,
IMoGoChassisLocationWGS84Listener, IMoGoChassisLamplightListener, LifecycleObserver {
companion object {
private const val TAG = "MapBizView"
}
@@ -34,7 +37,7 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
}
private fun initMapView(){
private fun initMapView() {
map?.uiSettings?.let {
//设置所有手势是否可用
it.setAllGesturesEnabled(true)
@@ -84,23 +87,47 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
setExtraGPSData(gnssInfo)
}
@Volatile
private var isVisualAngleChanged = false
override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
super.onAutopilotLightSwitchData(lightSwitch)
lightSwitch?.let {
when (it.number) {
1 -> { //左转灯
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(4, 500)
Chassis.LightSwitch.LIGHT_LEFT_VALUE -> { //左转灯
CallerVisualAngleManager.showTurning(true)
showTurn(1)
}
2 -> { //右转灯
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500)
Chassis.LightSwitch.LIGHT_RIGHT_VALUE -> { //右转灯
CallerVisualAngleManager.showTurning(true)
showTurn(2)
}
else -> {
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500)
Chassis.LightSwitch.LIGHT_NONE_VALUE -> {
CallerVisualAngleManager.showTurning(false)
hideTurn()
}
}
}
}
private fun showTurn(lightNum: Int) {
if (!isVisualAngleChanged) {
isVisualAngleChanged = true
when (lightNum) {
1 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(4, 500)
2 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500)
}
}
}
private fun hideTurn() {
if (isVisualAngleChanged) {
isVisualAngleChanged = false
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500)
}
}
override fun onDestroy() {
// 先取消注册数据再onDestroy
CallerSkinModeListenerManager.removeListener(TAG)

View File

@@ -196,6 +196,20 @@ class OverMapView @JvmOverloads constructor(
}
}
/**
* 清空线路并隐藏起、终点
*/
fun clearCustomPolyline() {
if (mBottomPolyline != null) {
mBottomPolyline!!.remove()
}
if (mCoveredPolyline != null) {
mCoveredPolyline!!.remove()
}
mStartMarker?.isVisible = false
mEndMarker?.isVisible = false
}
private fun initView(context: Context) {
mContext = context
val smpView = LayoutInflater.from(context).inflate(R.layout.module_overview_map_view, this)
@@ -413,15 +427,6 @@ class OverMapView @JvmOverloads constructor(
return false
}
fun clearCustomPolyline() {
if (mBottomPolyline != null) {
mBottomPolyline!!.remove()
}
if (mCoveredPolyline != null) {
mCoveredPolyline!!.remove()
}
}
/**
* 绘制新基建Markers(比如:摄像头)
*
@@ -615,6 +620,7 @@ class OverMapView @JvmOverloads constructor(
mCoveredPolyline = mAMap!!.addPolyline(polylineOptions)
if (mBottomPolyline != null) {
mBottomPolyline!!.remove()
mBottomPolyline = null
}
}
}

View File

@@ -11,7 +11,7 @@ import com.mogo.commons.utils.Trigonometric;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.data.v2x.DrawLineInfo;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoPersonWarnPolylineManager;
@@ -44,8 +44,8 @@ public class V2XWarningMarker implements IV2XMarker {
private final List fillPoints = new ArrayList();//停止线经纬度合集
private boolean isFirstLocation = false;
private MogoLatLng carLocation = new MogoLatLng(
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat(),
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon()
CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLatitude(),
CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLongitude()
);
/*

View File

@@ -3,7 +3,7 @@ package com.mogo.eagle.core.function.v2x.events.utils
import android.content.Context
import android.graphics.Rect
import com.mogo.eagle.core.data.map.MogoLatLng
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.util.WindowUtils
@@ -24,8 +24,8 @@ class MapUtils {
mBoundRect.right = WindowUtils.dip2px(context, 100f)
// 当前车辆位置
val carLocation = MogoLatLng(
CallerAutoPilotStatusListenerManager.getCurWgs84Lat(),
CallerAutoPilotStatusListenerManager.getCurWgs84Lon()
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude,
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude
)
// 调整自适应的地图镜头
CallerMapUIServiceManager.getMapUIController()

View File

@@ -1,11 +1,26 @@
package com.mogo.eagle.core.data.enums
enum class DataSourceType(name: String) {
DEFAULT("defalut"),
OBU("OBU"),
MAP("MAP"),
TELEMATIC("TELEMATIC"),
AICLOUD("AI云"),
SUMMARY("汇总")// V2X事件汇总
SUMMARY("汇总");// V2X事件汇总
companion object{
fun getName(type :DataSourceType):String{
return when(type){
OBU -> "OBU"
MAP -> "MAP"
TELEMATIC -> "TELEMATIC"
AICLOUD -> "AI云"
SUMMARY -> "汇总"
else -> "defalut"
}
}
}
}

View File

@@ -114,6 +114,11 @@ interface IDevaToolsProvider : IProvider {
*/
fun updateUpgradeProgress()
/**
* obu下载进度
*/
fun updateObuUpgradeStatus()
/**
* 展示状态栏
*/

View File

@@ -1,7 +1,7 @@
package com.mogo.eagle.core.function.api.obu
import com.mogo.eagle.core.data.obu.ObuStatusInfo
import com.mogo.eagle.core.data.traffic.TrafficData
import mogo.telematics.pad.MessagePad
/**
* @author xiaoyuzhou
@@ -17,6 +17,13 @@ interface IMoGoObuStatusListener {
}
/**
* obu Tracker data
*/
fun updateTrackerFusionData(trackObject: MessagePad.TrackedObject?){
}
/**
* 更新obu Tracker 预警信息
*/

View File

@@ -1,5 +1,6 @@
package com.mogo.eagle.core.function.call.autopilot
import android.util.Log
import chassis.Chassis
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
import com.mogo.eagle.core.function.call.base.CallerBase
@@ -17,24 +18,24 @@ object CallerChassisLamplightListenerManager : CallerBase<IMoGoChassisLamplightL
* @param lightSwitch
*/
fun invokeAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch) {
val switch = getTurnLightState(lightSwitch)
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotLightSwitchData(getTurnLightState(lightSwitch))
listener.onAutopilotLightSwitchData(switch)
}
}
private fun getTurnLightState(turn_light: Chassis.LightSwitch): Chassis.LightSwitch? {
if (turn_light == Chassis.LightSwitch.LIGHT_NONE) {
return if (isOnTurnLight) {
if (turn_light.number == Chassis.LightSwitch.LIGHT_NONE.number) {
if (isOnTurnLight) {
if (turnLightTimes >= 10) {
isOnTurnLight = false
return turn_light
} else {
turnLightTimes++
null
}
turnLightTimes++
return null
} else {
null
return null
}
} else {
turnLightTimes = 0

View File

@@ -14,9 +14,9 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils
object CallerChassisLocationWGS84ListenerManager : CallerBase<IMoGoChassisLocationWGS84Listener>() {
@Volatile
private var mGnssInfo: MogoLocation? = null
private var mGnssInfo: MogoLocation = MogoLocation()
fun getChassisLocationWGS84(): MogoLocation? {
fun getChassisLocationWGS84(): MogoLocation {
return mGnssInfo
}
@@ -40,27 +40,26 @@ object CallerChassisLocationWGS84ListenerManager : CallerBase<IMoGoChassisLocati
@Synchronized
fun invokeChassisLocationWGS84(gnssInfo: MogoLocation, sourceType: DataSourceType) {
this.mGnssInfo = gnssInfo.clone()
mGnssInfo?.let {
M_LISTENERS.forEach {
val tag = it.key
// 获取数据监听需要的HZ
val hz = M_LISTENERS_HZ[tag]
if (hz != null && hz > 0) {
val hzTime = (1.0 / hz.toDouble()) * 1000
// 获取最后一次回调的时间
val hzLastSendTime = M_LISTENERS_HZ_LAST_SEND_TIME[tag]
if (hzLastSendTime != null && hzLastSendTime > 0) {
// 计算是否进入下一次回调周期
val nowTime = TimeUtils.getNowMills()
if (nowTime - hzLastSendTime > hzTime) {
syncLocationCallback(tag, it, mGnssInfo!!, sourceType)
}
} else {
syncLocationCallback(tag, it, mGnssInfo!!, sourceType)
M_LISTENERS.forEach {
val tag = it.key
// 获取数据监听需要的HZ
val hz = M_LISTENERS_HZ[tag]
if (hz != null && hz > 0) {
val hzTime = (1.0 / hz.toDouble()) * 1000
// 获取最后一次回调的时间
val hzLastSendTime = M_LISTENERS_HZ_LAST_SEND_TIME[tag]
if (hzLastSendTime != null && hzLastSendTime > 0) {
// 计算是否进入下一次回调周期
val nowTime = TimeUtils.getNowMills()
if (nowTime - hzLastSendTime > hzTime) {
syncLocationCallback(tag, it, mGnssInfo, sourceType)
}
} else {
syncLocationCallback(tag, it, mGnssInfo!!, sourceType)
syncLocationCallback(tag, it, mGnssInfo, sourceType)
}
} else {
syncLocationCallback(tag, it, mGnssInfo, sourceType)
}
}
}

View File

@@ -154,6 +154,13 @@ object CallerDevaToolsManager {
devaToolsProviderApi?.updateUpgradeProgress()
}
/**
* obu下载状态
*/
fun updateObuUpgradeStatus() {
devaToolsProviderApi?.updateObuUpgradeStatus()
}
/**
* 展示状态栏
*/

View File

@@ -14,6 +14,9 @@ object CallerVisualAngleManager {
.navigation() as? IMoGoVisualAngleChangeProvider
}
@Volatile
private var isVisualAngleChanged = false
fun changeAngle(scene: Scene) {
provider?.changeAngle(scene)
}
@@ -21,4 +24,18 @@ object CallerVisualAngleManager {
fun updateLongSightLevel(level: Boolean) {
provider?.updateLongSightLevel(level)
}
fun showTurning(open: Boolean) {
if (open) {
if (!isVisualAngleChanged) {
isVisualAngleChanged = true
changeAngle(Turning(true))
}
} else {
if (isVisualAngleChanged) {
isVisualAngleChanged = false
changeAngle(Turning(false))
}
}
}
}

View File

@@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.call.obu
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
import com.mogo.eagle.core.function.call.base.CallerBase
import mogo.telematics.pad.MessagePad
/**
* OBU 监听管理
@@ -19,6 +20,13 @@ object CallerObuWarningListenerManager : CallerBase<IMoGoObuStatusListener>() {
}
}
fun invokeTrackerFusionData(trackObject: MessagePad.TrackedObject?){
M_LISTENERS.forEach {
val listener = it.value
listener.updateTrackerFusionData(trackObject)
}
}
fun invokeTrackerWarningInfo(trafficData: TrafficData) {
M_LISTENERS.forEach {
val listener = it.value

View File

@@ -13,5 +13,8 @@ public class Config {
public final static String downLoadPath = Environment.getExternalStorageDirectory().getAbsolutePath()
+ "/downloads/";
public final static String downLoadObuPath = Environment.getExternalStorageDirectory().getAbsolutePath()
+ "/obu/";
public final static String DOWN_LOAD_TAG = "Package-DownLoad";
}

View File

@@ -618,6 +618,7 @@ public final class DeviceUtils {
// // 联想PAD 获取SN,2022-2023款PAD无法获取暂时不启用
// serial = (String) get.invoke(c, "ro.odm.lenovo.gsn");
// }
Log.d("getSerialNumber()", "serial = " + serial);
} catch (Exception e) {
e.printStackTrace();
}
@@ -702,7 +703,8 @@ public final class DeviceUtils {
* @return 当前的设备SN信息优先使用设备固定的sn
*/
public static String getDeviceSN() {
String devicesSN = SPUtils.getInstance().getString(KEY_DEVICE_ID);
// String devicesSN = SPUtils.getInstance().getString(KEY_DEVICE_ID);
String devicesSN = "";
if (TextUtils.isEmpty(devicesSN)) {
// 获取设备唯一SN
devicesSN = getSerialNumber();

View File

@@ -7,7 +7,6 @@ import android.content.pm.PackageManager
import android.hardware.display.DisplayManager
import android.util.Log
import android.view.Display
import androidx.appcompat.app.AppCompatActivity
/**
* 多屏幕操作工具类
@@ -15,7 +14,74 @@ import androidx.appcompat.app.AppCompatActivity
object MultiDisplayUtils {
private val TAG: String = "MultiDisplayUtils"
// 获取 是否支持扩展屏幕打开应用
/**
* 定昌电子6屏幕异显 对应的lcd匹配数组, 当前数组只对应于6屏异显,
* 如果是其他屏幕个数, 需要自己重新对应下相关的索引
* display 里面查看port对应的值
*/
private var lcd_sub_port_six_lcd_mode = arrayOf(
// main lcd // HDMI-1
//-------------------begin 定昌电子 RK3588 -------------------
"port=240", // HDMI-2
"port=3", // HDMI-3
"port=243", // HDMI-4
"port=2", // HDMI-5
"port=1", // HDMI-6
//-------------------end 定昌电子 RK3588 -------------------
)
/**
* 获取其他的屏幕
*/
fun getOtherDisplay(): Array<Display?> {
val mDisplayManager =
Utils.getApp().getSystemService(Context.DISPLAY_SERVICE) as DisplayManager
// 获取除了内置屏幕(主屏幕)的其它屏幕
val displays = mDisplayManager.getDisplays(DisplayManager.DISPLAY_CATEGORY_PRESENTATION)
// 初始化新的集合进行接收排序后的屏幕信息
var displaysList = arrayOfNulls<Display>(displays.size)
// 判断副屏个数
if (displays.isNotEmpty()) {
displaysList = arrayOfNulls(displays.size)
// 循环出来副屏幕进行重新排序
for (i in displays.indices) {
// 这里如果需要固定某个屏幕, 使用 if( display.toString().indexOf("port=1")!=-1) ) 而不是使用 display[i]
val strDisplayString: String = displays[i].toString()
for (j in lcd_sub_port_six_lcd_mode.indices) { // 这里增加port的匹配, 如果不需要对应的匹配 可看下面的other LCD
if (strDisplayString.indexOf(lcd_sub_port_six_lcd_mode[j]) != -1) { // 查找我们实际屏幕的匹配port
displaysList[j] = displays[i]
break
}
}
}
// 没有匹配到的显示
for (i in displays.indices) {
if (displaysList[i] == null) {
displaysList[i] = displays[i]
}
}
}
// 处理EB5副屏幕
else {
if (mDisplayManager.displays.isNotEmpty()) {
displaysList = arrayOfNulls(1)
// EB5目前副屏幕ID为固定4096
for (i in mDisplayManager.displays.indices) {
if (mDisplayManager.displays[i].displayId == 4096) {
displaysList[0] = mDisplayManager.displays[i]
}
}
}
}
return displaysList
}
/**
* 获取 是否支持扩展屏幕打开应用
*/
fun isSupportMultiDisplay(context: Context): Boolean {
// 先检查一下是不是支持在第二屏上显示activity这个特性
// 在ActivityOptions.java setLaunchDisplayId 上面有相关的说明
@@ -23,13 +89,6 @@ object MultiDisplayUtils {
return packageManager.hasSystemFeature(PackageManager.FEATURE_ACTIVITIES_ON_SECONDARY_DISPLAYS)
}
// 获取 当前接入的屏幕集合(含主屏幕)
fun getMultiDisplay(context: Context): Array<out Display> {
// 多次创建副屏 则副屏的id都是增加的所以不一定是1这里还是获取一下
val displayManager =
context.getSystemService(AppCompatActivity.DISPLAY_SERVICE) as DisplayManager
return displayManager.displays
}
/**
* 在指定ID的屏幕打开Activity当前应用的当前进程
@@ -37,11 +96,9 @@ object MultiDisplayUtils {
* @param activity 要在第二个屏幕启动的页面
*/
fun startActWithSecond(context: Context, activity: Class<*>) {
val launchDisplayId: Int
if (isSupportMultiDisplay(context)) {
if (getMultiDisplay(context).size > 1) {
launchDisplayId = getMultiDisplay(context)[1].displayId
if (getOtherDisplay().isNotEmpty() && getOtherDisplay()[0] != null) {
val launchDisplayId = getOtherDisplay()[0]!!.displayId
// 要加上Intent.FLAG_ACTIVITY_NEW_TASK
val options = ActivityOptions.makeBasic()
options.launchDisplayId = launchDisplayId
@@ -62,7 +119,7 @@ object MultiDisplayUtils {
* @param launchDisplayId 指定屏幕ID
* @param activity 要在副屏幕启动的页面
*/
fun startActWithProcess(context: Context, launchDisplayId: Int, activity: Class<*>) {
fun startActWithOther(context: Context, launchDisplayId: Int, activity: Class<*>) {
// 要加上Intent.FLAG_ACTIVITY_NEW_TASK
val options = ActivityOptions.makeBasic()
options.launchDisplayId = launchDisplayId

View File

@@ -137,7 +137,8 @@ public class AutopilotAbilityManager {
}
}
}
if (version > 1) {
//如果 maser version 大于1还需要判断AutoPilotReady字段是否存在以确保MAP版本和SSM Maser版本不陪配情况逻辑能正常执行
if (version > 1 && statusInfo.hasAutoPilotReady()) {
isAutopilotAbility = statusInfo.getAutoPilotReady();
if (!isAutopilotAbility) {
SystemStatusInfo.NodeFaultList nodeFaultList = statusInfo.getAutoPilotUnreadyList();
@@ -150,12 +151,12 @@ public class AutopilotAbilityManager {
if (state < NODE_INFO_STATE.length) {
builder.append(NODE_INFO_STATE[state]);
} else {
builder.append("未知 ");
builder.append("未知异常 ");
}
}
unableAutopilotReason = builder.toString();
} else {
unableAutopilotReason = "未知";
unableAutopilotReason = "未知异常节点";
}
}
} else {
@@ -169,7 +170,9 @@ public class AutopilotAbilityManager {
} else if (systemState == SystemStatusInfo.SystemState.SYS_FAULT) {
unableAutopilotReason = "系统异常";
} else if (systemState == SystemStatusInfo.SystemState.AUTO_PILOT_STARTING) {
unableAutopilotReason = "正在开始自动驾驶";
//如果第一次下发了启动自动驾驶,没起来或者存在干预 此时systemState是AUTO_PILOT_STARTING 需要二次下发启动自驾命令 所以需要排除此状态
isAutopilotAbility = true;
//unableAutopilotReason = "正在开始自动驾驶";
} else if (systemState == SystemStatusInfo.SystemState.AUTO_PILOT_RUNNING) {
unableAutopilotReason = "自动驾驶运行中";
} else if (systemState == SystemStatusInfo.SystemState.REMOTE_PILOT_STARTING) {
@@ -177,7 +180,7 @@ public class AutopilotAbilityManager {
} else if (systemState == SystemStatusInfo.SystemState.REMOTE_PILOT_RUNNING) {
unableAutopilotReason = "平行驾驶运行中";
} else {
unableAutopilotReason = "未知";
unableAutopilotReason = "未知系统状态";
}
}
}