Merge remote-tracking branch 'origin/dev_robotaxi-d-app-module_290_220715_2.9.0' into dev_robotaxi-d-app-module_290_220715_2.9.0

This commit is contained in:
wangmingjun
2022-07-21 18:03:57 +08:00
33 changed files with 404 additions and 190 deletions

View File

@@ -11,6 +11,7 @@ import android.view.WindowManager
import androidx.appcompat.widget.AppCompatTextView
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.common.module.wigets.OCHGradientTextView
import com.mogo.och.taxi.passenger.R
/**
@@ -31,11 +32,16 @@ object FloatingDistanceInfoUtils {
private var overlayView: View?=null
private var actvDistancew: AppCompatTextView?=null
// 距离
private var actvDistancew: OCHGradientTextView?=null
// 距离单位
private var actvDistancewUnit: AppCompatTextView?=null
private var actvSurplusTime: AppCompatTextView?=null
private var actvArrivedTime: AppCompatTextView?=null
private var actvSpeed: AppCompatTextView?=null
// 剩余时间
private var actvSurplusTime: OCHGradientTextView?=null
// 到达时间
private var actvArrivedTime: OCHGradientTextView?=null
private var actvSpeed: OCHGradientTextView?=null
/**
@@ -66,6 +72,25 @@ object FloatingDistanceInfoUtils {
actvSurplusTime = view.findViewById(R.id.actv_surplus_time)
actvArrivedTime = view.findViewById(R.id.actv_arrived_time)
val intArrayOf = intArrayOf(
context.resources.getColor(R.color.taxi_p_video_gradient_start),
context.resources.getColor(R.color.taxi_p_video_gradient_end)
)
actvSpeed?.setVertrial(true)
actvSpeed?.setmColorList(intArrayOf)
actvDistancew?.setVertrial(true)
actvDistancew?.setmColorList(intArrayOf)
actvSurplusTime?.setVertrial(true)
actvSurplusTime?.setmColorList(intArrayOf)
actvArrivedTime?.setVertrial(true)
actvArrivedTime?.setmColorList(intArrayOf)
// 如果正在展示中并且lastOverlayView不为null先做移除操作保证覆盖在最上面的View只有一个防止叠加导致无法移除
dismissOverlayView()
@@ -90,13 +115,14 @@ object FloatingDistanceInfoUtils {
it.alpha = 1.0f
it.gravity = Gravity.END or Gravity.TOP
it.x = 0
it.y = 0
it.y = 199
it.format = PixelFormat.RGBA_8888
// 设置窗口类型为应用子窗口和PopupWindow同类型
it.type = WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL
// 没有边界限制,允许窗口扩展到屏幕外
it.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS or
WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE or
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
if (ani != -1) {
it.windowAnimations = ani
@@ -115,7 +141,7 @@ object FloatingDistanceInfoUtils {
fun setDistance(remainDis: String?, disUnit: String, time: Int, arriveTime: String) {
UiThreadHandler.getsUiHandler().post {
actvDistancew?.text = "$remainDis"
actvDistancewUnit?.text = disUnit
actvDistancewUnit?.text = "距离($disUnit)"
actvSurplusTime?.text = "$time"
actvArrivedTime?.text = arriveTime
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:startColor="#99000000" android:endColor="#00000000" android:angle="90"/>
<solid android:color="#59141A2D"/>
<corners android:radius="8px"/>
</shape>

View File

@@ -67,9 +67,14 @@
<!--局部播放器-->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_bottom"
android:layout_width="match_parent"
android:layout_width="0px"
android:background="@drawable/bg_taxi_p_video_bg"
android:layout_height="158px"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginStart="148px"
android:layout_marginEnd="148px"
android:layout_marginBottom="51px"
android:layout_height="99px"
app:layout_constraintBottom_toBottomOf="parent">
<ImageView

View File

@@ -13,14 +13,14 @@
android:layout_height="wrap_content"
app:bgColor="@color/taxi_p_map_bg"
app:blurRadius="@dimen/dp_60"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:shadowColor="#80000000"
app:shadowRadius="60px"
app:shadow_position="outer"
app:xOffset="0px"
app:yOffset="0px"
tools:visibility="visible">
app:yOffset="0px">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_comment_contain"
@@ -30,7 +30,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent">
<androidx.appcompat.widget.AppCompatTextView
<com.mogo.och.common.module.wigets.OCHGradientTextView
android:id="@+id/actv_speed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -66,116 +66,114 @@
app:blurRadius="@dimen/dp_60"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/och_speed_layout"
app:shadowColor="#80000000"
app:shadowColor="#BA000000"
app:shadowRadius="60px"
app:shadow_position="outer"
app:xOffset="0px"
app:yOffset="0px"
tools:visibility="visible">
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/cl_distance_contain"
android:layout_width="@dimen/dp_230"
android:layout_height="@dimen/dp_690"
android:layout_width="@dimen/dp_180"
android:layout_height="@dimen/dp_554"
android:orientation="vertical"
android:weightSum="3"
android:background="@drawable/bg_taxi_p_arrived_info"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_distancew"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="--"
android:textColor="@color/taxi_order_status_textColor"
android:textSize="88px"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintBottom_toTopOf="@+id/actv_distancew_unit"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_distancew_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="距离(KM)"
android:textColor="@color/taxi_order_status_textColor"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="@+id/v_second_floor"
app:layout_constraintTop_toBottomOf="@+id/actv_distancew" />
<View
android:id="@+id/v_second_floor"
<androidx.appcompat.widget.LinearLayoutCompat
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@color/taxi_order_status_textColor"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintVertical_bias="0.333"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:layout_weight="1"
android:gravity="center"
android:layout_height="0dp">
<com.mogo.och.common.module.wigets.OCHGradientTextView
android:id="@+id/actv_distancew"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="__"
android:textColor="@color/taxi_order_status_textColor"
android:textSize="56px"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintBottom_toTopOf="@+id/actv_distancew_unit"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<androidx.appcompat.widget.AppCompatTextView
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_distancew_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="距离(KM)"
android:textSize="28px"
android:textColor="@color/taxi_p_video_unit"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/actv_distancew" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_weight="1"
android:gravity="center"
android:layout_height="0dp">
<com.mogo.och.common.module.wigets.OCHGradientTextView
android:id="@+id/actv_surplus_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="--"
android:text="__"
android:textColor="@color/taxi_order_status_textColor"
android:textSize="88px"
android:textSize="56px"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintBottom_toTopOf="@+id/actv_surplus_time_unit"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/v_second_floor" />
app:layout_constraintStart_toStartOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_surplus_time_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="剩余(分)"
android:textColor="@color/taxi_order_status_textColor"
android:textSize="28px"
android:textColor="@color/taxi_p_video_unit"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="@+id/v_third_floor"
app:layout_constraintTop_toBottomOf="@+id/actv_surplus_time" />
</androidx.appcompat.widget.LinearLayoutCompat>
<View
android:id="@+id/v_third_floor"
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@color/taxi_order_status_textColor"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintVertical_bias="0.666"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatTextView
<androidx.appcompat.widget.LinearLayoutCompat
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_weight="1"
android:gravity="center"
android:layout_height="0dp">
<com.mogo.och.common.module.wigets.OCHGradientTextView
android:id="@+id/actv_arrived_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="--"
android:text="__"
android:textColor="@color/taxi_order_status_textColor"
android:textSize="88px"
android:textSize="56px"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintBottom_toTopOf="@+id/actv_arrived_time_unit"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/v_third_floor" />
app:layout_constraintStart_toStartOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_arrived_time_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="到达"
android:textColor="@color/taxi_order_status_textColor"
android:textSize="28px"
android:textColor="@color/taxi_p_video_unit"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/actv_arrived_time" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</com.mogo.och.common.module.wigets.OCHBorderShadowLayout>

View File

@@ -53,5 +53,7 @@
<color name="taxi_p_start_autopilot_txt_un_color">#4DFFFFFF</color>
<color name="taxi_p_start_autopilot_txt_color">#FFFFFF</color>
<color name="taxi_p_video_unit">#8FB3EF</color>
<color name="taxi_p_video_gradient_start">#E1F3FE</color>
<color name="taxi_p_video_gradient_end">#FFFFFF</color>
</resources>

View File

@@ -28,6 +28,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CL
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.call.analytics.AnalyticsManager
import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
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
@@ -38,8 +39,7 @@ import com.mogo.eagle.core.utilcode.util.ThreadPoolService
import com.mogo.eagle.core.utilcode.util.TimeUtils
import com.mogo.module.common.constants.HostConst
import com.rousetime.android_startup.AndroidStartup
import com.zhjt.mogo_core_function_devatools.env.*
import com.zhjt.mogo_core_function_devatools.env.EnvChangeManager.EnvConfig
import com.zhjt.mogo_core_function_devatools.env.EnvChangeManager
import com.zhjt.service.chain.ChainLog
import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD
@@ -64,7 +64,10 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
override fun waitOnMainThread() = false
override fun dependenciesByName(): List<String> {
return listOf("com.mogo.launcher.stageone.APMStartup", "com.mogo.launcher.stageone.ConfigStartUp")
return listOf(
"com.mogo.launcher.stageone.APMStartup",
"com.mogo.launcher.stageone.ConfigStartUp"
)
}
override fun create(context: Context): Boolean {
@@ -183,6 +186,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
override fun onTokenGot(token: String, sn: String) {
CallerLogger.d(SceneConstant.M_HMI + TAG, "onTokenGot ")
clientConfig.token = token
CallerCloudListenerManager.invokeCloudTokenGot(token)
// 异步初始化NetConfig
asyncInit()
// HttpDns ttl回调 --- socketTTL
@@ -264,8 +268,9 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
private fun startSocketService() {
CallerLogger.d(SceneConstant.M_HMI + TAG, "startSocketService")
val location = CallerMapUIServiceManager.getSingletonLocationClient(AbsMogoApplication.getApp())!!
.lastKnowLocation
val location =
CallerMapUIServiceManager.getSingletonLocationClient(AbsMogoApplication.getApp())!!
.lastKnowLocation
// 关闭长链服务
MogoAiCloudSocketManager.getInstance(context).destroy()
MogoAiCloudSocketManager.getInstance(context)

View File

@@ -6,9 +6,11 @@ import com.mogo.commons.debug.DebugConfig
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.cloud.IMoGoCloudListener
import com.mogo.eagle.core.function.autopilot.network.AdasServiceModel
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.cloud.CallerCloudListenerManager
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.mogo.eagle.core.utilcode.util.ToastUtils
@@ -26,7 +28,7 @@ import java.util.concurrent.TimeUnit
* ADAS-SDK与工控机连接状态回调
*/
class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
IMoGoAutopilotStatusListener {
IMoGoAutopilotStatusListener, IMoGoCloudListener {
private val TAG = "ConnectStatus"
//自动驾驶状态
@@ -37,8 +39,15 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
private var connectStatus = false
init {
CallerCloudListenerManager.registerCloudListener(TAG, this)
}
override fun onConnectionIPCStatus(ipcConnectionStatus: Int, reason: String?) {
CallerAutoPilotStatusListenerManager.invokeAutoPilotIPCStatusChanged(ipcConnectionStatus, reason)
CallerAutoPilotStatusListenerManager.invokeAutoPilotIPCStatusChanged(
ipcConnectionStatus,
reason
)
if (ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.CONNECTED) {
CallerLogger.d("$M_ADAS_IMPL$TAG", "webSocket 连接成功")
connectStatus = true
@@ -55,7 +64,7 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
//每次工控机连接成功后,需同步当前设置的美化模式状态
CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode)
//当连接状态是关闭美化模式时,同步给工控机
if(!FunctionBuildConfig.isDemoMode){
if (!FunctionBuildConfig.isDemoMode) {
CallerAutoPilotManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
}
//每次工控机连接成功后,需同步当前设置的雨天模式状态
@@ -85,8 +94,9 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
} else if (ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.NOT_FOUND_ADDRESS) {
CallerLogger.d("$M_ADAS_IMPL$TAG", "webSocket 找不到可用IP 传入的IP不可用或固定IP列表中所有IP不可用")
}
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().ipcConnStatus = ipcConnectionStatus
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectStatusDescribe=reason
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().ipcConnStatus =
ipcConnectionStatus
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectStatusDescribe = reason
CallerAutoPilotStatusListenerManager.invokeAutoPilotStatus()
}
@@ -119,7 +129,7 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
/**
* 同步SN信息给工控机
*/
private fun syncBasicInfoToAutopilot() {
private fun syncBasicInfoToAutopilot(sn: String? = null) {
CallerLogger.d("$M_ADAS_IMPL$TAG", "同步PAD的SN给工控机……")
// 设置PAD-SN给工控,网络环境
AdasManager.getInstance()
@@ -142,5 +152,8 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
}
}
override fun tokenGot(sn: String) {
syncBasicInfoToAutopilot(sn)
}
}

View File

@@ -4,10 +4,10 @@ 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.api.cloud.IMoGoCloudListener
import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
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.LogLevel
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
import com.mogo.eagle.core.utilcode.util.DeviceUtils
import com.mogo.eagle.core.utilcode.util.Utils
@@ -15,7 +15,7 @@ import com.zhidao.loglib.fw.FileWriteManager
import com.zhidao.loglib.fw.FwBuild
import com.zhjt.service.chain.core.ChainTraceStarter
class TraceManager {
class TraceManager : IMoGoCloudListener {
private val traceInfoCache = hashMapOf<Int, ChainLogParam>()
private val fwBuildMap: MutableMap<Int, FwBuild> = HashMap()
@@ -33,24 +33,25 @@ class TraceManager {
// 初始化Trace抓取服务
val pkgName = Utils.getApp().packageName
ChainTraceStarter.start(pkgName, DeviceUtils.getMacAddress(), false)
CallerCloudListenerManager.registerCloudListener(TAG, this)
// Trace过程中进行日志抓取对日志进行配置
fwBuildMap[ChainConstant.CHAIN_LINK_LOG_CONNECT_STATUS] =
FwBuild(true, -1,pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_INIT)
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_INIT)
fwBuildMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_GNSSINFO] =
FwBuild(true, -1,pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_GNSS)
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_GNSS)
fwBuildMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT] =
FwBuild(true, -1,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, 30,pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_DATA_TRACK)
FwBuild(false, 30, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_DATA_TRACK)
fwBuildMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_TRAJECTORY] =
FwBuild(false, 30,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, 30,pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_VEHICLE)
FwBuild(false, 30, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_VEHICLE)
fwBuildMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_TRAFFIC_LIGHT] =
FwBuild(false, 30,pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_TRAFFIC_LIGHT)
FwBuild(false, 30, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_TRAFFIC_LIGHT)
fwBuildMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_PLANNING_OBJECTS] =
FwBuild(false, 30,pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_PLANNING_OBJECTS)
FwBuild(false, 30, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_PLANNING_OBJECTS)
traceInfoCache[ChainConstant.CHAIN_LINK_LOG_CONNECT_STATUS] =
ChainLogParam(true, "ADAS连接状态")
@@ -79,11 +80,15 @@ class TraceManager {
}
}
fun setTraceLogEnable(enable:Boolean){
override fun tokenGot(sn: String) {
FileWriteManager.getInstance().updateDeviceId(sn)
}
fun setTraceLogEnable(enable: Boolean) {
FileWriteManager.getInstance().logger = enable
}
fun getTraceLogStatus():Boolean{
fun getTraceLogStatus(): Boolean {
return FileWriteManager.getInstance().logger
}
@@ -93,7 +98,7 @@ class TraceManager {
fun refreshTraceInfo(map: HashMap<Int, ChainLogParam>) {
map.forEach { (type, param) ->
if(type != ChainConstant.CHAIN_LINK_LOG_CONNECT_STATUS){
if (type != ChainConstant.CHAIN_LINK_LOG_CONNECT_STATUS) {
val fwBuild = this.fwBuildMap[type]
fwBuild?.let {
CallerLogger.d("$M_DEVA$TAG", "param : ${param.des} , record : ${param.record}")
@@ -103,4 +108,5 @@ class TraceManager {
}
FileWriteManager.getInstance().operateChainMap(fwBuildMap)
}
}

View File

@@ -164,10 +164,10 @@ import java.util.*
}
}
/*ivCameraIcon?.setOnLongClickListener {
activity?.let { it1 -> CarcorderPreviewView.show(it1) }
ivCameraIcon?.setOnLongClickListener {
showSmallFragment()
true
}*/
}
ivToolsIcon?.setOnClickListener {
if (toolsViewFloat == null) {

View File

@@ -40,10 +40,13 @@ class RoadVideoDialog(context: Context) : BaseFloatDialog(context), LifecycleObs
init {
setContentView(R.layout.road_video_dialog)
setCanceledOnTouchOutside(true)
roadVideoPB.indeterminateDrawable.colorFilter = PorterDuffColorFilter(
ContextCompat.getColor(context, R.color.notice_blue),
PorterDuff.Mode.MULTIPLY
)
setCanceledOnTouchOutside(false)
roadVideoClose.setOnClickListener {
stopLive()
dismiss()
}
@@ -52,12 +55,14 @@ class RoadVideoDialog(context: Context) : BaseFloatDialog(context), LifecycleObs
fun show(url: String, isFlvUrl: Boolean) {
show()
roadVideoPB.visibility = View.VISIBLE
if (!isFlvUrl) {
// 打开指定ip的摄像头直播流
CallerMonitorManager.openCameraStream(url, { flvUrl ->
gsyVideoPlay(flvUrl)
}) {
ToastUtils.showShort(it.message)
dismiss()
}
} else {
gsyVideoPlay(url)
@@ -93,10 +98,6 @@ class RoadVideoDialog(context: Context) : BaseFloatDialog(context), LifecycleObs
}
}
})
roadVideoPB.indeterminateDrawable.colorFilter = PorterDuffColorFilter(
ContextCompat.getColor(context, R.color.notice_blue),
PorterDuff.Mode.MULTIPLY
)
}
private fun gsyVideoPlay(flvUrl: String) {

View File

@@ -33,7 +33,6 @@ 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;

View File

@@ -1,33 +0,0 @@
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;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

@@ -7,6 +7,7 @@
android:minWidth="1736px"
android:minHeight="974px"
app:roundLayoutRadius="30px"
android:background="@drawable/road_video_bg"
tools:ignore="MissingDefaultResource">
<com.mogo.eagle.core.widget.media.video.SimpleVideoPlayer

View File

@@ -12,12 +12,14 @@ import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths;
import com.mogo.eagle.core.data.map.CenterLine;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener;
import com.mogo.eagle.core.function.api.map.hd.IMoGoMapFragmentProvider;
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
import com.mogo.eagle.core.function.call.map.CallerHDMapManager;
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager;
import com.mogo.eagle.core.function.overview.InfStructureManager;
import com.mogo.eagle.core.function.overview.Infrastructure;
import com.mogo.eagle.core.function.overview.ViewModelExtKt;
import com.mogo.eagle.core.function.overview.vm.OverViewModel;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
@@ -28,6 +30,13 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
import com.zhidaoauto.map.sdk.open.MapAutoApi;
import com.zhidaoauto.map.sdk.open.business.PointCloudHelper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import ch.hsr.geohash.GeoHash;
import mogo.telematics.pad.MessagePad;
/**
* @author donghongyu
* @since 2021-11-09
@@ -37,7 +46,8 @@ import com.zhidaoauto.map.sdk.open.business.PointCloudHelper;
*/
@Route(path = MoGoFragmentPaths.PATH_FRAGMENT_MAP)
public class MapFragment extends MvpFragment<MapView, MapPresenter>
implements MapView, IMoGoMapFragmentProvider, IMoGoSkinModeChangeListener {
implements MapView, IMoGoMapFragmentProvider, IMoGoSkinModeChangeListener,
IMoGoAutopilotPlanningListener {
private static final String TAG = "MapFragment";
@@ -330,4 +340,31 @@ public class MapFragment extends MvpFragment<MapView, MapPresenter>
public void setDebugMode(boolean debugMode) {
MapAutoApi.INSTANCE.setDebugMode(debugMode);
}
@Override
public void onAutopilotTrajectory(@NonNull List<MessagePad.TrajectoryPoint> trajectoryInfos) {
}
@Override
public void onAutopilotRotting(@Nullable MessagePad.GlobalPathResp globalPathResp) {
if (globalPathResp != null) {
HashMap<String, ArrayList<Infrastructure>> pathMap = new HashMap();
String geoHash;
ArrayList<Infrastructure> infList;
for (MessagePad.Location location : globalPathResp.getWayPointsList()) {
geoHash = GeoHash.withCharacterPrecision(location.getLatitude(), location.getLongitude(), 7).toBase32();
// 网格内的轨迹点只取一次
if (!pathMap.containsKey(geoHash)) {
// 从缓存的新基建数据中去取对应geoHash的新基建数据集合
infList = InfStructureManager.INSTANCE.getData().get(geoHash);
if (infList != null) {
pathMap.put(geoHash, infList);
}
}
}
// 全局路径规划只回调一次保存供全览模式所在Fragment使用
InfStructureManager.INSTANCE.savePathData(pathMap);
}
}
}

View File

@@ -10,6 +10,11 @@ object InfStructureManager {
HashMap<String, ArrayList<Infrastructure>>()
}
// 全局路径规划中所有点的GeoHash网格对应的新基建数据集合
private val _pathMap by lazy {
HashMap<String, ArrayList<Infrastructure>>()
}
fun saveData(map: HashMap<String, java.util.ArrayList<Infrastructure>>) {
if (_infMap.isNotEmpty()) {
_infMap.clear()
@@ -18,4 +23,13 @@ object InfStructureManager {
}
fun getData(): Map<String, ArrayList<Infrastructure>> = _infMap
fun savePathData(map: HashMap<String, java.util.ArrayList<Infrastructure>>) {
if (_pathMap.isNotEmpty()) {
_pathMap.clear()
}
_pathMap.putAll(map)
}
fun getPathData(): Map<String, ArrayList<Infrastructure>> = _pathMap
}

View File

@@ -3,7 +3,6 @@ package com.mogo.eagle.core.function.overview
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
import java.util.*
@Entity(tableName = "t_device")
data class Infrastructure(

View File

@@ -1,12 +1,9 @@
package com.mogo.eagle.core.function.overview.vm
import android.util.Log
import androidx.lifecycle.*
import com.mogo.eagle.core.function.overview.Infrastructure
import com.mogo.eagle.core.function.overview.OverviewDao
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import java.lang.Exception
class OverViewModel(
@@ -48,7 +45,6 @@ class OverViewModel(
// overviewDao.listAllInfStructures()
} catch (e: Exception) {
e.printStackTrace()
Log.e("cff", "${e.cause}${e.message}")
null
}
data?.let {
@@ -63,7 +59,6 @@ class OverViewModel(
overviewDao.updateGeoHash(id, geoHash)
} catch (e: Exception) {
e.printStackTrace()
Log.e("cff", "${e.cause}${e.message}")
}
}
}

View File

@@ -65,7 +65,6 @@ import com.mogo.eagle.core.function.overview.Infrastructure;
import com.mogo.eagle.core.function.smp.view.ISmallMapDirectionView;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.mogo.module.common.utils.DrivingDirectionUtils;
import com.zhidao.support.adas.high.AdasManager;
@@ -147,7 +146,8 @@ public class AMapCustomView
CallerMapLocationListenerManager.INSTANCE.addListener(TAG, this);
//设置全览模式
overLayerView.setOnClickListener(v -> {
mAMapNaviView.displayOverview();
CallerHmiManager.INSTANCE.hideSmallFragment();
// mAMapNaviView.displayOverview();
});
// 注册定位监听
CallerMapLocationListenerManager.INSTANCE.addListener(TAG, this);
@@ -732,34 +732,62 @@ public class AMapCustomView
}
}
}
// 绘制新基建数据
if (!posInfMap.isEmpty()) {
posInfMap.clear();
}
ArrayList<MarkerOptions> markerOptionsList = new ArrayList();
for (ArrayList<Infrastructure> structureList : pathMap.values()) {
for (Infrastructure structure : structureList) {
MarkerOptions markerOption = new MarkerOptions();
LatLng latLng = new LatLng(Double.valueOf(structure.getLat()),
Double.valueOf(structure.getLon()));
markerOption.position(latLng);
markerOption.icon(BitmapDescriptorFactory.fromBitmap(
BitmapFactory.decodeResource(getResources(), R.drawable.video_nor)
));
posInfMap.put(latLng, structure);
markerOptionsList.add(markerOption);
}
}
mAMap.addMarkers(markerOptionsList, false);
mAMap.setOnMarkerClickListener(marker -> {
Infrastructure infrastructure = posInfMap.get(marker.getPosition());
// 如果是摄像头
if (0 == infrastructure.getCategory() && infrastructure.getIp() != null) {
CallerHmiManager.INSTANCE.showVideoDialog(infrastructure.getIp());
return true;
}
return false;
});
drawInfMarkers(pathMap);
}
}
public void drawInfMarkers(Map<String, ArrayList<Infrastructure>> infStruMap) {
// 绘制新基建数据
if (!posInfMap.isEmpty()) {
posInfMap.clear();
}
ArrayList<MarkerOptions> markerOptionsList = new ArrayList();
for (ArrayList<Infrastructure> structureList : infStruMap.values()) {
int firstQuadrantCt = 0, secondQuadrantCt = 0, thirdQuadrantCt = 0, forthQuadrantCt = 0;
// 每个GeoHash内根据坐标系象限分散开摄像头icon显示
for (Infrastructure structure : structureList) {
MarkerOptions markerOption = new MarkerOptions();
LatLng latLng = new LatLng(Double.valueOf(structure.getLat()),
Double.valueOf(structure.getLon()));
markerOption.position(latLng);
if (structure.getHeading() >= 0 && structure.getHeading() <= 90) {
markerOption.anchor(0.5f * firstQuadrantCt, 0.5f + 0.5f * firstQuadrantCt);
markerOption.icon(BitmapDescriptorFactory.fromBitmap(
BitmapFactory.decodeResource(getResources(),R.drawable.video_icon_right)
));
firstQuadrantCt++;
} else if (structure.getHeading() >= 90 && structure.getHeading() <= 180) {
markerOption.anchor(0.5f * secondQuadrantCt, 0.5f * secondQuadrantCt);
markerOption.icon(BitmapDescriptorFactory.fromBitmap(
BitmapFactory.decodeResource(getResources(),R.drawable.video_icon_right)
));
secondQuadrantCt++;
} else if (structure.getHeading() >= 180 && structure.getHeading() <= 270) {
markerOption.anchor(0.5f + 0.5f * thirdQuadrantCt, 0.5f * thirdQuadrantCt);
markerOption.icon(BitmapDescriptorFactory.fromBitmap(
BitmapFactory.decodeResource(getResources(),R.drawable.video_icon_left)
));
thirdQuadrantCt++;
} else {
markerOption.anchor(0.75f + 0.25f * forthQuadrantCt, 0.75f + 0.25f * forthQuadrantCt);
markerOption.icon(BitmapDescriptorFactory.fromBitmap(
BitmapFactory.decodeResource(getResources(),R.drawable.video_icon_left)
));
forthQuadrantCt++;
}
posInfMap.put(latLng, structure);
markerOptionsList.add(markerOption);
}
}
mAMap.addMarkers(markerOptionsList, false);
mAMap.setOnMarkerClickListener(marker -> {
Infrastructure infrastructure = posInfMap.get(marker.getPosition());
// 如果是摄像头
if (0 == infrastructure.getCategory() && infrastructure.getIp() != null) {
CallerHmiManager.INSTANCE.showVideoDialog(infrastructure.getIp());
return true;
}
return false;
});
}
}

View File

@@ -17,12 +17,15 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.map.smp.IMogoSmallMapProvider;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
import com.mogo.eagle.core.function.map.R;
import com.mogo.eagle.core.function.overview.InfStructureManager;
import com.mogo.eagle.core.function.overview.Infrastructure;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import mogo.telematics.pad.MessagePad;
import mogo_msg.MogoReportMsg;
@@ -102,6 +105,10 @@ public class SmallMapFragment extends BaseFragment
if (mAMapCustomView != null) {
mAMapCustomView.onResume();
}
Map<String, ArrayList<Infrastructure>> map = InfStructureManager.INSTANCE.getPathData();
if (!map.isEmpty()) {
mAMapCustomView.drawInfMarkers(map);
}
}
@Override

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

@@ -13,6 +13,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MONITOR
import com.mogo.map.MogoLocationClient
import com.mogo.module.common.constants.HostConst
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
@@ -219,16 +220,28 @@ class CronTaskManager(private var context: Context?) {
}
streamDisposable2 = MoGoRetrofitFactory.getInstance(HostConst.CITY_HOST)
.create(CameraListServices::class.java)
.reqOpenCameraStream(cameraIp)
.reqOpenCameraStreamWithRetry(cameraIp)
.flatMap {
if (it.code != 200 && it.code != 0) {
Observable.error(Throwable(it.msg))
} else {
Observable.just(it)
}
}
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retryWhen(RetryWithDelay())
.subscribe({
CallerLogger.d("$M_MONITOR$TAG", "reqOpenCameraStream返回结果为$it")
val flvString = it.flvUrl
if (!flvString.isNullOrEmpty()) {
success(flvString)
if (it.code == 200 || it.code == 0) {
val flvString = it.flvUrl
if (!flvString.isNullOrEmpty()) {
success(flvString)
} else {
error(Throwable("flvUrl为空"))
}
} else {
error(Throwable("flvUrl为空"))
error(Throwable(it.msg))
}
}, {
CallerLogger.e(

View File

@@ -0,0 +1,25 @@
package com.mogo.eagle.core.function.monitoring;
import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
import io.reactivex.ObservableSource;
import io.reactivex.functions.Function;
public class RetryWithDelay implements Function<Observable<? extends Throwable>, Observable<?>> {
private final int maxRetries = 3;
private final int retryDelayMillis = 5000;
// 计数器
private int retryCount = 0;
@Override
public Observable<?> apply(Observable<? extends Throwable> observable) throws Exception {
return observable.flatMap((Function<Throwable, ObservableSource<?>>) throwable -> {
if (++retryCount <= maxRetries) {
return Observable.timer(retryDelayMillis, TimeUnit.MILLISECONDS);
}
return Observable.error(throwable);
});
}
}

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.core.function.monitoring.net
import com.mogo.eagle.core.data.camera.*
import io.reactivex.Observable
import io.reactivex.Single
import retrofit2.http.*
@@ -22,4 +23,7 @@ interface CameraListServices {
@Query("lon") lon: Double, @Query("lat") lat: Double,
@Query("radiusMeter") radiusMeter: Int
): Single<CameraListInfo?>
@GET("/camera-stream/stream/camera/openStream")
fun reqOpenCameraStreamWithRetry(@Query("ip") cameraIp: String): Observable<OpenCameraStreamEntity>
}

View File

@@ -104,7 +104,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
V2XManager.init(V2XConfig.Builder().also {
it.aiCloudConfig(MoGoAiCloudClientConfig.getInstance())
it.context(context)
it.loggable(true)
it.loggable(false)
it.distanceForTriggerRefresh(200f) //行驶超过200包含刷新道路周边信息短链请求
it.durationForTriggerRefresh(
60,

View File

@@ -0,0 +1,6 @@
package com.mogo.eagle.core.function.api.cloud
interface IMoGoCloudListener {
fun tokenGot(sn:String)
}

View File

@@ -0,0 +1,62 @@
package com.mogo.eagle.core.function.call.cloud
import androidx.annotation.Nullable
import com.mogo.eagle.core.function.api.cloud.IMoGoCloudListener
import java.util.concurrent.ConcurrentHashMap
object CallerCloudListenerManager {
private val M_CLOUD_LISTENER: ConcurrentHashMap<String, IMoGoCloudListener> =
ConcurrentHashMap()
/**
* 添加监听
* @param tag 标记,用来注销监听使用
* @param listener 监听回调
*/
fun registerCloudListener(
@Nullable tag: String,
@Nullable listener: IMoGoCloudListener
) {
if (M_CLOUD_LISTENER.containsKey(tag)) {
return
}
M_CLOUD_LISTENER[tag] = listener
}
/**
* 删除监听
* @param tag 标记,用来注销监听使用
*/
fun unRegisterCloudListener(@Nullable tag: String) {
if (!M_CLOUD_LISTENER.containsKey(tag)) {
return
}
M_CLOUD_LISTENER.remove(tag)
}
/**
* 删除监听
* @param listener 要删除的监听对象
*/
fun unRegisterCloudListener(@Nullable listener: IMoGoCloudListener) {
if (!M_CLOUD_LISTENER.containsValue(listener)) {
return
}
M_CLOUD_LISTENER.forEach {
if (it.value == listener) {
M_CLOUD_LISTENER.remove(it.key)
}
}
}
/**
* 分发获取到的设备sn
*/
fun invokeCloudTokenGot(sn: String) {
M_CLOUD_LISTENER.forEach {
val listener = it.value
listener.tokenGot(sn)
}
}
}

View File

@@ -60,7 +60,7 @@ HOOK_LOG_VERSION=1.6.1
SERVICE_CHAIN_VERSION=1.1.0
################ 外部依赖引用 ################
# loglib
LOGLIB_VERSION=1.3.3
LOGLIB_VERSION=1.3.5
######## MogoAiCloudSDK Version ########
# 网络请求LOGLIB_VERSION
MOGO_NETWORK_VERSION=1.4.3.7
@@ -164,7 +164,7 @@ MOGO_V2X_SDK_VERSION=1.4.3.7
# ADAS LIB Maven配置用于地图部门测试使用鹰眼项目中使用本地依赖 #
ADAS_LIB_GROUP=com.zhidao.support.adas
ADAS_LIB_POM_ARTIFACT_ID=high
ADAS_LIB_CHILD_VERSION=.1
ADAS_LIB_CHILD_VERSION=.0
ADAS_DATA_LIB_GROUP=com.zhjt.mogo.adas.data
ADAS_DATA_LIB_POM_ARTIFACT_ID=adas-data