Merge branch 'dev_arch_opt_3.0' of gitlab.zhidaoauto.com:zhjt/AndroidApp/MoGoEagleEye into dev_arch_opt_3.0
This commit is contained in:
@@ -41,6 +41,7 @@ class DispatchAutoPilotManager private constructor() :
|
||||
private const val MSG_SOCKET_TYPE = 501000
|
||||
private const val MSG_TYPE_SHOW_DIALOG = 0
|
||||
private const val MSG_TYPE_UPLOAD_AUTOPILOT_STATUS = 1
|
||||
private const val MSG_TYPE_UPLOAD_AUTOPILOT_ROTTING = 2
|
||||
|
||||
val dispatchAutoPilotManager by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
DispatchAutoPilotManager()
|
||||
@@ -68,6 +69,16 @@ class DispatchAutoPilotManager private constructor() :
|
||||
getAutoPilotStatusInfo().reason
|
||||
)
|
||||
sendEmptyMessageDelayed(MSG_TYPE_UPLOAD_AUTOPILOT_STATUS, 1000L)
|
||||
} else if(msg.what == MSG_TYPE_UPLOAD_AUTOPILOT_ROTTING){
|
||||
val data = msg.obj as MessagePad.GlobalPathResp
|
||||
val list: MutableList<AutopilotRouteInfo.RouteModels> = ArrayList()
|
||||
for (location in data.wayPointsList) {
|
||||
val routeModels = AutopilotRouteInfo.RouteModels()
|
||||
routeModels.lat = location.latitude
|
||||
routeModels.lon = location.longitude
|
||||
list.add(routeModels)
|
||||
}
|
||||
dispatchServiceModel.uploadAutopilotRoute(list)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -165,14 +176,10 @@ class DispatchAutoPilotManager private constructor() :
|
||||
if (globalPathResp == null || globalPathResp.wayPointsList.isEmpty()) {
|
||||
return
|
||||
}
|
||||
val list: MutableList<AutopilotRouteInfo.RouteModels> = ArrayList()
|
||||
for (location in globalPathResp.wayPointsList) {
|
||||
val routeModels = AutopilotRouteInfo.RouteModels()
|
||||
routeModels.lat = location.latitude
|
||||
routeModels.lon = location.longitude
|
||||
list.add(routeModels)
|
||||
}
|
||||
dispatchServiceModel.uploadAutopilotRoute(list)
|
||||
val message = Message()
|
||||
message.what = MSG_TYPE_UPLOAD_AUTOPILOT_ROTTING
|
||||
message.obj = globalPathResp
|
||||
handler.sendMessage(message)
|
||||
}
|
||||
|
||||
override fun onAutopilotArriveAtStation(arrivalNotification: MessagePad.ArrivalNotification?) {
|
||||
|
||||
@@ -76,7 +76,7 @@ class DispatchServiceModel private constructor() {
|
||||
fun uploadAutopilotRoute(list: List<RouteModels?>?) {
|
||||
val sn = MoGoAiCloudClientConfig.getInstance().sn
|
||||
val reportedRoute = ReportedRoute(sn, GsonUtil.jsonFromObject(list))
|
||||
val map: MutableMap<String, Any> = HashMap()
|
||||
val map: MutableMap<String, String> = HashMap()
|
||||
map["sn"] = sn
|
||||
map["data"] = GsonUtil.jsonFromObject(reportedRoute)
|
||||
mAdasApiService.uploadAutopilotRoute(map)
|
||||
|
||||
@@ -15,7 +15,7 @@ interface IDispatchAdasApiService {
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("eagle-eye-dns/eagle-eye-dns/dataService/autoDriver/receiveCarPreSetPath")
|
||||
fun uploadAutopilotRoute(@FieldMap parameters: Map<String, Any>): Observable<BaseData>
|
||||
fun uploadAutopilotRoute(@FieldMap parameters: Map<String, String>): Observable<BaseData>
|
||||
|
||||
/**
|
||||
* 上报自动驾驶调度处理结果 服务于业务调度
|
||||
|
||||
@@ -107,7 +107,7 @@ class MoGoAutopilotControlProvider :
|
||||
.setIpcConnectionMode(AdasOptions.IPC_CONNECTION_MODE.FIXATION)
|
||||
.setIpcFixationIP(AdasManager.getInstance().getIPCFixationIPList(mContext))
|
||||
.setClient(false)
|
||||
.setIdentityMode(FunctionBuildConfig.appIdentityMode)
|
||||
.setUnableLaunchAutopilotGear(FunctionBuildConfig.unableLaunchAutopilotGear)
|
||||
// .setSubscribeInterfaceOptions(subscribeInterfaceOptions)//
|
||||
.build()
|
||||
|
||||
@@ -198,7 +198,7 @@ class MoGoAutopilotControlProvider :
|
||||
val options = AdasOptions
|
||||
.Builder()
|
||||
.setClient(true)
|
||||
.setIdentityMode(FunctionBuildConfig.appIdentityMode)
|
||||
.setUnableLaunchAutopilotGear(FunctionBuildConfig.unableLaunchAutopilotGear)
|
||||
.build()
|
||||
AdasManager.getInstance()
|
||||
.create(options, MoGoAdasMsgConnectStatusListenerImpl())
|
||||
@@ -226,7 +226,7 @@ class MoGoAutopilotControlProvider :
|
||||
.setIpcConnectionMode(AdasOptions.IPC_CONNECTION_MODE.FIXATION)
|
||||
.setIpcFixationIP(AdasManager.getInstance().getIPCFixationIPList(mContext))
|
||||
.setClient(false)// 乘客端直连工控机改为false
|
||||
.setIdentityMode(FunctionBuildConfig.appIdentityMode)
|
||||
.setUnableLaunchAutopilotGear(FunctionBuildConfig.unableLaunchAutopilotGear)
|
||||
.build()
|
||||
AdasManager.getInstance().create(options, MoGoAdasMsgConnectStatusListenerImpl())
|
||||
//////////////////////////////////注意先后顺序,AdasManager.getInstance().create后才可以设置监听/////////////////////////////////////////////
|
||||
|
||||
@@ -682,12 +682,9 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
when (appId) {
|
||||
//前向碰撞预警
|
||||
MogoObuConstants.V2X_WARNING_TYPE.FCW.toString() -> {
|
||||
if (FunctionBuildConfig.isObuWarningFusionUnion) {
|
||||
if (FunctionBuildConfig.isObuWarningFusionUnion && level == 3) {
|
||||
alertContent = "前车距离过近"
|
||||
ttsContent = "前车距离过近"
|
||||
CallerObuWarningListenerManager.invokeTrackerFusionData(
|
||||
ObuManager.getInstance().obuRvToTrackedObject(info)
|
||||
)
|
||||
} else {
|
||||
alertContent =
|
||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
|
||||
|
||||
@@ -6,13 +6,11 @@ import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.LinearLayout
|
||||
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.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.main.AppListActivity
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ActivityUtils
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
@@ -41,11 +39,8 @@ class VersionNameView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun initView(){
|
||||
//版本水印只在司机端展示
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
showCurrentPadVersion()
|
||||
showCurrentMapVersion()
|
||||
}
|
||||
showCurrentPadVersion()
|
||||
showCurrentMapVersion()
|
||||
|
||||
// 调试入口,应对M1、M2没有安装Launcher的情况
|
||||
setOnLongClickListener {
|
||||
@@ -72,7 +67,7 @@ class VersionNameView @JvmOverloads constructor(
|
||||
UiThreadHandler.post {
|
||||
tvMapVersionName?.let {
|
||||
if (!dockerVersion.isNullOrEmpty()) {
|
||||
it.text = " ; MAP:${dockerVersion}"
|
||||
it.text = "MAP:${dockerVersion}"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,18 +75,12 @@ class VersionNameView @JvmOverloads constructor(
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
//版本水印只在司机端展示
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
}
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
//版本水印只在司机端展示
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
}
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAppVersionName"
|
||||
@@ -10,6 +10,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/dp_28"
|
||||
android:textColor="#FFBEC6EF"
|
||||
android:layout_gravity="center_horizontal"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -18,6 +19,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/dp_28"
|
||||
android:textColor="#FFBEC6EF"
|
||||
android:layout_gravity="center_horizontal"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -102,7 +102,6 @@ class IdentifyOriginDataDrawer : Identify {
|
||||
@SuppressLint("NewApi")
|
||||
private fun filterTrafficData(trafficData: List<TrackedObject>): HashMap<String, TrackedObject> {
|
||||
mFilterTrafficData.clear()
|
||||
trafficDataUuidList.clear()
|
||||
for (data in trafficData) {
|
||||
// 过滤掉未知感知数据
|
||||
if (TrackerSourceColorHelper.filterData(data)) {
|
||||
@@ -110,13 +109,12 @@ class IdentifyOriginDataDrawer : Identify {
|
||||
}
|
||||
var temp: TrackedObject = data
|
||||
val uuid = "" + data.uuid
|
||||
//首次过来的数据不添加,首次未添加的感知物在调用完绘制方法后再塞入cache map
|
||||
val cacheData = mMarkersCaches[uuid]
|
||||
if (cacheData != null) {
|
||||
val color = TrackerSourceColorHelper.getDefaultColor(data)
|
||||
temp = data.toBuilder().setColor(color).build()
|
||||
mFilterTrafficData[uuid] = temp
|
||||
}
|
||||
mFilterTrafficData[uuid] = temp
|
||||
mMarkersCaches[uuid] = temp
|
||||
trafficDataUuidList.add(uuid)
|
||||
}
|
||||
|
||||
@@ -94,21 +94,6 @@ 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 {
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.business.identify;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
|
||||
@@ -71,6 +71,10 @@ class OverMapView @JvmOverloads constructor(
|
||||
private var resetDrawableMarginRight: Int = -1
|
||||
private var resetDrawableMarginBottom: Int = -1
|
||||
private var isClearArrived: Boolean = false
|
||||
private var leftPadding: Int = 100
|
||||
private var topPadding: Int = 100
|
||||
private var rightPadding: Int = 100
|
||||
private var bottomPadding: Int = 100
|
||||
|
||||
private var mMapView: TextureMapView? = null
|
||||
private var mAMap: AMap? = null
|
||||
@@ -136,6 +140,10 @@ class OverMapView @JvmOverloads constructor(
|
||||
AutoSizeUtils.dp2px(context, 40f)
|
||||
)
|
||||
isClearArrived = typedArray.getBoolean(R.styleable.OverMapView_isClearArrived, false)
|
||||
leftPadding = typedArray.getInt(R.styleable.OverMapView_leftPadding, 100)
|
||||
topPadding = typedArray.getInt(R.styleable.OverMapView_topPadding, 100)
|
||||
rightPadding = typedArray.getInt(R.styleable.OverMapView_rightPadding, 100)
|
||||
bottomPadding = typedArray.getInt(R.styleable.OverMapView_bottomPadding, 100)
|
||||
typedArray.recycle()
|
||||
initView(context)
|
||||
} catch (e: Exception) {
|
||||
@@ -559,10 +567,10 @@ class OverMapView @JvmOverloads constructor(
|
||||
mAMap!!.moveCamera(
|
||||
CameraUpdateFactory.newLatLngBoundsRect(
|
||||
boundsBuilder.build(),
|
||||
100,
|
||||
100,
|
||||
100,
|
||||
100
|
||||
AutoSizeUtils.dp2px(context, leftPadding.toFloat()),
|
||||
AutoSizeUtils.dp2px(context, rightPadding.toFloat()),
|
||||
AutoSizeUtils.dp2px(context, topPadding.toFloat()),
|
||||
AutoSizeUtils.dp2px(context, bottomPadding.toFloat())
|
||||
)
|
||||
)
|
||||
mAMap!!.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition))
|
||||
|
||||
@@ -24,5 +24,10 @@
|
||||
<attr name="resetDrawableMarginBottom" format="dimension" />
|
||||
<!-- 是否擦除已走过的路线 -->
|
||||
<attr name="isClearArrived" format="boolean" />
|
||||
<!-- 规定屏幕范围的padding -->
|
||||
<attr name="leftPadding" format="integer" />
|
||||
<attr name="topPadding" format="integer" />
|
||||
<attr name="rightPadding" format="integer" />
|
||||
<attr name="bottomPadding" format="integer" />
|
||||
</declare-styleable>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user