Merge branch 'dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0' into dev_robobus-m1-p-app-module_1.1.0_230112_1.1.0

This commit is contained in:
yangyakun
2023-02-28 21:22:57 +08:00
29 changed files with 232 additions and 212 deletions

View File

@@ -17,7 +17,9 @@
app:resetDrawableMarginBottom="@dimen/dp_54"
app:carDrawable = "@drawable/m2_map_car_icon"
app:startPointDrawable="@drawable/m2_map_start_icon"
app:endPointDrawable="@drawable/m2_map_end_icon"/>
app:endPointDrawable="@drawable/m2_map_end_icon"
app:leftPadding="400"
/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/img_drive_bg"

View File

@@ -2,7 +2,6 @@ package com.mogo.och.common.module.manager
import android.Manifest
import android.content.Context
import com.mogo.commons.debug.DebugConfig
import com.mogo.commons.module.status.IMogoStatusChangedListener
import com.mogo.commons.module.status.MogoStatusManager
import com.mogo.commons.module.status.StatusDescriptor
@@ -17,6 +16,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import java.util.concurrent.TimeUnit
import kotlin.properties.Delegates
/**
* @author: wangmingjun
@@ -26,26 +26,40 @@ object AbnormalFactorsLoopManager : IMogoStatusChangedListener {
const val TAG = "AbnormalFactorsLoopManager"
private const val LOOP_TIME = 10 *1000L
private const val LOOP_TIME = 10 * 1000L
private const val LOOP_DELAY = 5 * 1000L
private var socketStatus: Boolean = false
private var socketStatus by Delegates.observable(false) { _, _, newValue ->
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
return@observable
}
if (FunctionBuildConfig.isDemoMode) {
return@observable
}
if (newValue) {
ToastUtils.showLong("长链接状态恢复")
} else {
ToastUtils.showLong("长链接异常,请开启相应权限或者查看网络")
}
}
private var looperDisposable : Disposable? = null
private var looperDisposable: Disposable? = null
fun startLoopAbnormalFactors(context: Context){
if (looperDisposable != null && !looperDisposable!!.isDisposed){
fun startLoopAbnormalFactors(context: Context) {
if (looperDisposable != null && !looperDisposable!!.isDisposed) {
return
}
i(TAG, "startLoopAbnormalFactors()")
looperDisposable = Observable.interval(LOOP_DELAY, LOOP_TIME, TimeUnit.MILLISECONDS)
.map { aLong -> aLong+1 }
.map { aLong -> aLong + 1 }
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe{ aLong -> checkAbnormalFactors(context)}
.subscribe { aLong -> checkAbnormalFactors(context) }
//长链接监听
MogoStatusManager.getInstance().registerStatusChangedListener(TAG,
StatusDescriptor.CLOUD_SOCKET,this)
MogoStatusManager.getInstance().registerStatusChangedListener(
TAG,
StatusDescriptor.CLOUD_SOCKET, this
)
}
private fun checkAbnormalFactors(context: Context) {
@@ -54,14 +68,15 @@ object AbnormalFactorsLoopManager : IMogoStatusChangedListener {
var networkStatus = false
//定位权限
locationStatusPermsStatus = !(!PermissionUtil.isLocServiceEnable(context) || !PermissionUtil.checkPermission(
context, *arrayOf(
Manifest.permission.ACCESS_FINE_LOCATION
)
))
locationStatusPermsStatus =
!(!PermissionUtil.isLocServiceEnable(context) || !PermissionUtil.checkPermission(
context, *arrayOf(
Manifest.permission.ACCESS_FINE_LOCATION
)
))
//网络状态或者网络权限是否打开
if (NetworkUtils.isConnected(context)){
if (NetworkUtils.isConnected(context)) {
networkStatus = true
}
//长链接状态 socketStatus
@@ -70,28 +85,27 @@ object AbnormalFactorsLoopManager : IMogoStatusChangedListener {
if (!locationStatusPermsStatus) toastStr += "定位服务异常 "
if (!networkStatus) toastStr += " 网络异常 "
//乘客屏不显示长链接异常
if (!socketStatus && !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) toastStr += " 长链接异常 "
i(TAG, "abnormal_factors_Str = $toastStr")
if (!FunctionBuildConfig.isDemoMode && toastStr !== ""){
if (!FunctionBuildConfig.isDemoMode && toastStr !== "") {
ToastUtils.showLong(toastStr + "请开启相应权限或者查看网络")
}
}
fun stopLoopAbnormalFactors(){
fun stopLoopAbnormalFactors() {
looperDisposable!!.dispose()
looperDisposable == null
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG,
StatusDescriptor.CLOUD_SOCKET,this)
MogoStatusManager.getInstance().unregisterStatusChangedListener(
TAG,
StatusDescriptor.CLOUD_SOCKET, this
)
}
override fun onStatusChanged(descriptor: StatusDescriptor?, isTrue: Boolean) {
//长链接监听、
if (StatusDescriptor.CLOUD_SOCKET == descriptor){
if (StatusDescriptor.CLOUD_SOCKET == descriptor) {
socketStatus = isTrue
}
}

View File

@@ -49,7 +49,7 @@ project.android.productFlavors {
// 构建 是否支持多屏异显异交互
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'false'
//M1不能启动自驾的档位
buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR', 'null'
//Bus不能启动自驾的档位
buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR', 'new java.util.HashSet<chassis.Chassis.GearPosition>(){{add(chassis.Chassis.GearPosition.GEAR_N);add(chassis.Chassis.GearPosition.GEAR_R);}}'
}
}

View File

@@ -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?) {

View File

@@ -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)

View File

@@ -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>
/**
* 上报自动驾驶调度处理结果 服务于业务调度

View File

@@ -748,27 +748,29 @@ class MoGoAutopilotControlProvider :
}
override fun connectSpecifiedServer(ip: String) {
NSDNettyManager.getInstance().connectSpecifiedServer(
ip,
NettyTcpServer.SERVER_PORT,
MoGoAiCloudClientConfig.getInstance().sn,
object : NettyClientListener<MogoProtocolMsg> {
override fun onMessageResponseClient(
msg: MogoProtocolMsg?,
sign: String?,
channel: Channel
) {
msgHandler.handleMsgFromServer(msg, channel)
}
ThreadUtils.getIoPool().submit {
NSDNettyManager.getInstance().connectSpecifiedServer(
ip,
NettyTcpServer.SERVER_PORT,
MoGoAiCloudClientConfig.getInstance().sn,
object : NettyClientListener<MogoProtocolMsg> {
override fun onMessageResponseClient(
msg: MogoProtocolMsg?,
sign: String?,
channel: Channel
) {
msgHandler.handleMsgFromServer(msg, channel)
}
override fun onClientStatusConnectChanged(
statusCode: Int,
sign: String?,
channel: Channel
) {
msgHandler.handleClientConnStatus(statusCode, sign, channel)
}
})
override fun onClientStatusConnectChanged(
statusCode: Int,
sign: String?,
channel: Channel
) {
msgHandler.handleClientConnStatus(statusCode, sign, channel)
}
})
}
}
/**

View File

@@ -684,12 +684,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)

View File

@@ -172,8 +172,10 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
* obu的升级,只需要司机屏连接
*/
fun queryObuUpgrade(obuVersionName: String) {
CallerLogger.d("${SceneConstant.M_OBU}${MogoObuConst.TAG_UPGRADE_OBU}","queryObuUpgrade isConnected = ${CallerObuApiManager.isConnected()} --- mAddress = $mAddress")
ObuUpgradeAppNetWorkManager.getInstance().getObuUpgradeInfo(mContext, mAddress, obuVersionName)
if (screenType == 1) {
CallerLogger.d("${SceneConstant.M_OBU}${MogoObuConst.TAG_UPGRADE_OBU}","queryObuUpgrade isConnected = ${CallerObuApiManager.isConnected()} --- mAddress = $mAddress")
ObuUpgradeAppNetWorkManager.getInstance().getObuUpgradeInfo(mContext, mAddress, obuVersionName)
}
}
}

View File

@@ -163,18 +163,26 @@ class BindingCarNetWorkManager private constructor() {
}
d(SceneConstant.M_BINDING + TAG, "updateCarVrIconRes : $brandId")
when (brandId) {
"1" -> {
"1" -> { //东风
CallerMapUIServiceManager.getMapUIController()?.changeCurrentIcon(R.raw.chuzuche)
HdMapBuildConfig.currentCarVrIconRes = R.raw.chuzuche
}
"2" -> {
"2" -> { //红旗
CallerMapUIServiceManager.getMapUIController()?.changeCurrentIcon(R.raw.hq_h9)
HdMapBuildConfig.currentCarVrIconRes = R.raw.hq_h9
}
"3" -> {
"3" -> { //金旅
CallerMapUIServiceManager.getMapUIController()?.changeCurrentIcon(R.raw.xiaobache)
HdMapBuildConfig.currentCarVrIconRes = R.raw.xiaobache
}
"4" -> { //开沃
CallerMapUIServiceManager.getMapUIController()?.changeCurrentIcon(R.raw.xiaobache)
HdMapBuildConfig.currentCarVrIconRes = R.raw.xiaobache
}
"5" -> { //福田
CallerMapUIServiceManager.getMapUIController()?.changeCurrentIcon(R.raw.huanwei)
HdMapBuildConfig.currentCarVrIconRes = R.raw.huanwei
}
else -> {
CallerMapUIServiceManager.getMapUIController()?.changeCurrentIcon(R.raw.chuzuche)
HdMapBuildConfig.currentCarVrIconRes = R.raw.chuzuche
@@ -186,6 +194,8 @@ class BindingCarNetWorkManager private constructor() {
return when (HdMapBuildConfig.currentCarVrIconRes) {
R.raw.chuzuche -> "1"
R.raw.xiaobache -> "3"
R.raw.xiaobache -> "4"
R.raw.huanwei -> "5"
else -> "1"
}
}

View File

@@ -410,14 +410,13 @@ internal class DebugSettingView @JvmOverloads constructor(
//展示OBU控制中心
obuControllerLayout.visibility = View.VISIBLE
tbVehicleStateController.isChecked = true
//展示HMI控制中心
hmiObuLayout.visibility = View.VISIBLE
} else {
buttonView.setCompoundDrawables(null, null, iconRight, null)
//隐藏OBU控制中心
obuControllerLayout.visibility = View.GONE
tbVehicleStateController.isChecked = false
hmiObuLayout.visibility = View.GONE
}
}
@@ -1059,29 +1058,6 @@ internal class DebugSettingView @JvmOverloads constructor(
HmiBuildConfig.isShowSnBindingView = !isChecked
}
/**
* obu弱势交通控制
*/
tbObuWeaknessTraffic.setOnCheckedChangeListener { _, isChecked ->
// 默认开启
HmiBuildConfig.isShowObuWeaknessTrafficView = !isChecked
}
/**
* 云端弱势交通控制
*/
tbCloudWeaknessTraffic.setOnCheckedChangeListener { _, isChecked ->
// 默认关闭
HmiBuildConfig.isShowObuWeaknessTrafficView = isChecked
}
/**
* 限速数据优先使用obu默认打开
*/
tbRoadLimitSpeed.setOnCheckedChangeListener { _, isChecked ->
HmiBuildConfig.isShowObuLimitSpeedView = isChecked
}
/**
* 实时加速度面板控制
*/
@@ -1657,6 +1633,28 @@ internal class DebugSettingView @JvmOverloads constructor(
tbIsDemoMode.text = "开启美化模式"
}
//obu TODO 后面会添加很多os那边需要显示的内容
obuVersionNameTv.text = Html.fromHtml(
"OBU版本号${
if (AppConfigInfo.isConnectObu) {
"<font color='blue'> 1.0"
} else {
"<font color='red'>异常"
}
}"
)
obuConnectStatusTv.text = Html.fromHtml(
"OBU连接状态${
if (AppConfigInfo.isConnectObu) {
"<font color='blue'>正常"
} else {
"<font color='red'>异常"
}
}"
)
}
/**

View File

@@ -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) {

View File

@@ -1078,64 +1078,47 @@
android:id="@+id/tvObuInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:layout_margin="@dimen/dp_5"
android:minLines="4"
android:text="OBU配置信息"
android:textColor="#000"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/obuDivider" />
<View
android:id="@+id/obuDivider2"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0"
app:layout_constraintTop_toBottomOf="@id/tvObuInfo" />
<GridLayout
android:id="@+id/hmiObuLayout"
<LinearLayout
android:id="@+id/obuStatusCenterLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="2"
android:visibility="gone"
android:orientation="vertical"
android:visibility="visible"
tools:visibility="visible"
app:layout_constraintTop_toBottomOf="@id/obuDivider2"
app:layout_constraintTop_toBottomOf="@id/tvObuInfo"
tools:ignore="MissingConstraints">
<ToggleButton
android:id="@+id/tbObuWeaknessTraffic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_columnWeight="1"
android:layout_margin="2dp"
android:gravity="center"
android:textOff="关闭路侧弱势群体预警"
android:textOn="打开路侧弱势群体预警"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/obuVersionNameTv"
style="@style/DebugSettingText"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<ToggleButton
android:id="@+id/tbCloudWeaknessTraffic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_columnWeight="1"
android:layout_margin="2dp"
android:gravity="center"
android:textOff="开启云端弱势群体预警"
android:textOn="关闭云端弱势群体预警"
android:textSize="@dimen/dp_24" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0" />
<ToggleButton
android:id="@+id/tbRoadLimitSpeed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_columnWeight="1"
android:layout_margin="2dp"
android:gravity="center"
android:textOff="获取路侧限速提醒"
android:textOn="关闭路侧限速提醒"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/obuConnectStatusTv"
style="@style/DebugSettingText"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0" />
</LinearLayout>
</GridLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- OBU 配置 end -->

View File

@@ -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>

View File

@@ -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)
}

View File

@@ -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 {

View File

@@ -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;

View File

@@ -101,7 +101,7 @@ class SmallMapView @JvmOverloads constructor(
fun drawablePolyline() {
clearPolyline()
if (mAMap != null) {
if (mCoordinatesLatLng.size > 2) {
if (mCoordinatesLatLng.size >= 2) {
// 设置开始结束Marker位置
mStartMarker!!.position = mCoordinatesLatLng[0]
mEndMarker!!.position = mCoordinatesLatLng[mCoordinatesLatLng.size - 1]

View File

@@ -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))

View File

@@ -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>

View File

@@ -20,6 +20,8 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_CONNECT_FAIL
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_CONNECT_LOST
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_CONNECT_SUCCESS
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_PASSPORT_ERROR
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_PASSPORT_TOKEN
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_RECONNECT
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CLOUD
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS
@@ -166,6 +168,15 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
// 初始化SDK可以设置状态回调来监听
MoGoAiCloudClient.getInstance().init(context, clientConfig).addTokenCallbacks(
object : IMoGoTokenCallback {
@ChainLog(
linkChainLog = CHAIN_LINK_LOG_CONNECT_STATUS,
linkCode = CHAIN_LINK_CLOUD,
endpoint = PAD,
nodeAliasCode = CHAIN_ALIAS_CODE_CLOUD_PASSPORT_TOKEN,
paramIndexes = [0, 1],
clientPkFileName = "sn"
)
override fun onTokenGot(token: String, sn: String) {
clientConfig.token = token
// 由于存在token过期问题在更新后会回调至此处增加二次判定
@@ -181,6 +192,14 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
}
}
@ChainLog(
linkChainLog = CHAIN_LINK_LOG_CONNECT_STATUS,
linkCode = CHAIN_LINK_CLOUD,
endpoint = PAD,
nodeAliasCode = CHAIN_ALIAS_CODE_CLOUD_PASSPORT_ERROR,
paramIndexes = [1],
clientPkFileName = "sn"
)
override fun onError(code: Int, msg: String) {
CallerLogger.d(
"$M_MAIN$TAG",
@@ -335,4 +354,5 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
HttpDnsSimpleLocation("010", 1.0, 1.0)
}
}
}

View File

@@ -96,7 +96,7 @@ object FunctionBuildConfig {
*/
@Volatile
@JvmField
var isObuWarningFusionUnion = false
var isObuWarningFusionUnion = true
/**
* 当前APP的身份模式

View File

@@ -60,6 +60,8 @@ class ChainConstant {
const val CHAIN_ALIAS_CODE_APP_INFO_CONFIG_UPDATE = "CHAIN_ALIAS_CODE_APP_INFO_CONFIG_UPDATE"
const val CHAIN_ALIAS_CODE_FUNC_CONFIG_CHANGED = "CHAIN_ALIAS_CODE_FUNC_CONFIG_CHANGED"
const val CHAIN_ALIAS_CODE_CLOUD_PASSPORT_TOKEN = "CHAIN_ALIAS_CODE_CLOUD_PASSPORT_TOKEN"
const val CHAIN_ALIAS_CODE_CLOUD_PASSPORT_ERROR = "CHAIN_ALIAS_CODE_CLOUD_PASSPORT_ERROR"
const val CHAIN_ALIAS_CODE_CLOUD_CONNECT_FAIL = "CHAIN_ALIAS_CODE_CLOUD_CONNECT_FAIL"
const val CHAIN_ALIAS_CODE_CLOUD_CONNECT_SUCCESS = "CHAIN_ALIAS_CODE_CLOUD_CONNECT_SUCCESS"
const val CHAIN_ALIAS_CODE_CLOUD_RECONNECT = "CHAIN_ALIAS_CODE_CLOUD_RECONNECT"

View File

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

View File

@@ -20,13 +20,6 @@ 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

@@ -53,11 +53,24 @@ public class AIAssist {
private AIAssist(Context context) {
try {
// 暂时换成反射,解决死锁问题
// TODO:("支持切换思必驰和科大讯飞")
Class<?> clazz = Class.forName("com.mogo.tts.pad.PadTTS");
// Class<?> clazz = Class.forName("com.mogo.tts.iflytek.IFlyTekTts");
mTTS = (IMogoTTS) clazz.getConstructor().newInstance();
mTTS.init(context);
Class<?> clazz1 = null;
Class<?> clazz2 = null;
try {
clazz1 = Class.forName("com.mogo.tts.pad.PadTTS");
} catch (Exception ignored) {}
try {
clazz2 = Class.forName("com.mogo.tts.iflytek.IFlyTekTts");
} catch (Exception ignored) {}
if (clazz1 != null) {
mTTS = (IMogoTTS) clazz1.getConstructor().newInstance();
} else if (clazz2 != null) {
mTTS = (IMogoTTS) clazz2.getConstructor().newInstance();
}
if (mTTS != null) {
mTTS.init(context);
}
// mTTS = (IMogoTTS) ARouter.getInstance().build(MogoTTSConstants.API_PATH).navigation(context.getApplicationContext());
} catch (Exception e) {
e.printStackTrace();
@@ -104,7 +117,7 @@ public class AIAssist {
*/
public void speakTTSVoice(String text) {
if (mTTS != null) {
mTTS.speakTTSVoice(text);
mTTS.speakTTSVoiceWithLevel(text, LEVEL0);
}
}

View File

@@ -66,23 +66,23 @@ SERVICE_BIZ_VERSION=1.2.4
LOGLIB_VERSION=1.5.11
######## MogoAiCloudSDK Version ########
# 网络请求LOGLIB_VERSION
MOGO_NETWORK_VERSION=1.4.4.8
MOGO_NETWORK_VERSION=1.4.4.9
# 鉴权
MOGO_PASSPORT_VERSION=1.4.4.8
MOGO_PASSPORT_VERSION=1.4.4.9
# 常链接
MOGO_SOCKET_VERSION=1.4.4.8
MOGO_SOCKET_VERSION=1.4.4.9
# 数据采集
MOGO_REALTIME_VERSION=1.4.4.8
MOGO_REALTIME_VERSION=1.4.4.9
# 探路,道路事件发布,获取
MOGO_TANLU_VERSION=1.4.4.8
MOGO_TANLU_VERSION=1.4.4.9
# 直播推流
MOGO_LIVE_VERSION=1.4.4.8
MOGO_LIVE_VERSION=1.4.4.9
# 直播拉流
MOGO_TRAFFICLIVE_VERSION=1.4.4.8
MOGO_TRAFFICLIVE_VERSION=1.4.4.9
# 定位服务
MOGO_LOCATION_VERSION=1.4.4.8
MOGO_LOCATION_VERSION=1.4.4.9
# 远程通讯模块
MOGO_TELEMATIC_VERSION=1.4.4.8
MOGO_TELEMATIC_VERSION=1.4.4.9
######## MogoAiCloudSDK Version ########
# 自研地图
MAP_SDK_VERSION=2.10.0.9

View File

@@ -3,7 +3,6 @@ package com.mogo.map;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Point;
import android.util.Log;
import android.util.Pair;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
@@ -126,9 +125,6 @@ public class AMapWrapper implements IMogoMap {
MarkerSimpleData markerOptions = ObjectUtils.fromTrafficData(trackedObject);
if (markerOptions != null) {
markerOptionsArrayList.add(markerOptions);
if(markerOptions.id == 65061){
Log.i("emArrow","time :" + markerOptions.time + " , lat : " + markerOptions.lat + " , lon : " + markerOptions.lon);
}
}
});
long time = markerOptionsArrayList.get(0).getTime();

View File

@@ -86,9 +86,12 @@ class IFlyTekTts : IMogoTTS, InitListener {
}
override fun speakTTSVoiceWithLevel(tts: String?, level: Int) {
speakTTSVoiceWithLevel(tts, level, null)
}
override fun speakTTSVoiceWithLevel(tts: String?, level: Int, callBack: IMogoTTSCallback?) {
if (tts.isNullOrEmpty()) return
speakMultiLangTTSWithLevel(MultiLangTtsEntity(listOf(LangTtsEntity(tts, LanguageType.CHINESE))), level, callBack)
}
override fun speakMultiLangTTSWithLevel(