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

[2.13.0-arhc-opt] fix bug of traffic light

See merge request zhjt/AndroidApp/MoGoEagleEye!519
This commit is contained in:
wangmingjun
2023-02-14 06:25:27 +00:00
7 changed files with 29 additions and 80 deletions

View File

@@ -137,13 +137,6 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
}
}
fun getTrafficLightCurrentState(): TrafficLightDetail? {
trafficLightResult?.let {
return it.laneList
}
return null
}
fun getRoadResult(): RoadIDResult? {
return roadIDResult
}

View File

@@ -1,21 +1,16 @@
package com.mogo.eagle.core.function.startup.stageone
import android.content.Context
import com.mogo.aicloud.services.httpdns.HttpDnsConst
import com.mogo.aicloud.services.httpdns.IMogoHttpDns
import com.mogo.aicloud.services.httpdns.MogoHttpDnsHandler
import com.mogo.aicloud.services.locationinfo.MogoLocationInfoServices
import com.mogo.aicloud.services.socket.IMogoLifecycleListener
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
import com.mogo.cloud.httpdns.MogoHttpDnsConfig
import com.mogo.cloud.httpdns.bean.HttpDnsSimpleLocation
import com.mogo.cloud.httpdns.listener.IHttpDnsCurrentLocation
import com.mogo.cloud.httpdns.listener.OnAddressChangedListener
import com.mogo.cloud.passport.IMoGoTokenCallback
import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.constants.HostConst
import com.mogo.commons.constants.SharedPrefsConstants
import com.mogo.commons.debug.DebugConfig
import com.mogo.commons.module.status.MogoStatusManager
@@ -25,7 +20,6 @@ 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_HTTP_DNS_CHANGED
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
import com.mogo.eagle.core.data.map.MogoLocation
@@ -58,8 +52,6 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
// 缓存IP地址
private var cacheIp: String? = null
private lateinit var mogoHttpDns: IMogoHttpDns
private var context: Context? = null
private var gotToken = false
@@ -77,7 +69,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
override fun create(context: Context): Boolean {
this.context = context
initGDLoc()
initHttpDns()
preparePassportEnvironment()
return true
}
@@ -85,15 +77,6 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
CallerMapUIServiceManager.getGDLocationServer(context!!)?.start()
}
/**
* 初始化 HttpDNS ,这里会通过一个接口获取所有鹰眼中使用的微服务域名以及端口号
* 后续的网络请求会通过 HttpDnsInterceptor 进行拦截替换
*/
private fun initHttpDns() {
mogoHttpDns = MogoHttpDnsHandler.getHttpDnsApi()
preparePassportEnvironment()
}
private fun preparePassportEnvironment() {
// 设置网络环境HTTP_DNS_ENV_QA、HTTP_DNS_ENV_RELEASE、HTTP_DNS_ENV_DEV
when (DebugConfig.getNetMode()) {
@@ -116,7 +99,6 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
// clientConfig.socketTechUrl
// 设置是否是直播推流的主播
clientConfig.isAnchor = true
clientConfig.loopCheckDelay = (60 * 60 * 2 * 1000).toLong() //todo arrow
when (DebugConfig.getCarMachineType()) {
DebugConfig.CAR_MACHINE_TYPE_LENOVO -> clientConfig.thirdPartyAppKey = "pfieouqg"
else -> clientConfig.thirdPartyAppKey = "wbvpzgar"
@@ -146,7 +128,8 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
return HttpDnsSimpleLocation(envConfig.cityCode, envConfig.lat, envConfig.lon)
}
var mogoLocation: MogoLocation? = null
val locationClient = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
val locationClient =
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
if (locationClient != null) {
mogoLocation = locationClient
}
@@ -214,8 +197,6 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
CallerCloudListenerManager.invokeCloudTokenGot(token, sn)
// 异步初始化NetConfig
asyncInit()
// HttpDns ttl回调 --- socketTTL
// registerSocketHttpDnsTTL()
startSocketService()
// 开启每5s/次定位上报
uploadLocPerFiveSecond()
@@ -252,35 +233,6 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
}
}
/**
* 请求获取最新的 DNS 微服务 域名信息
*/
private fun registerSocketHttpDnsTTL() {
mogoHttpDns.addressChangedListener(object : OnAddressChangedListener {
@ChainLog(
linkChainLog = CHAIN_LINK_LOG_CONNECT_STATUS,
linkCode = CHAIN_LINK_CLOUD,
endpoint = PAD,
nodeAliasCode = CHAIN_ALIAS_CODE_HTTP_DNS_CHANGED,
paramIndexes = [0, 1],
clientPkFileName = "sn"
)
override fun onAddressChanged(cityCode: String, address: Map<String, String>?) {
val dnsCacheIp = mogoHttpDns.getCachedHttpDnsIps(
HostConst.SOCKET_CENTER_DOMAIN,
HttpDnsConst.HTTP_DNS_ADDRESS_TYPE_HTTP
) ?: return
if (dnsCacheIp != cacheIp) {
CallerLogger.d(
SceneConstant.M_MAIN + TAG,
"获取缓存Dns IP : $dnsCacheIp , 原缓存 IP $cacheIp"
)
cacheIp = dnsCacheIp
}
}
})
}
/**
* 上传自车位置信息到云端
*/

View File

@@ -15,15 +15,17 @@ fun TrafficLightResult.toTrafficLightDetail():MessagePad.TrafficLightDetail{
val left = trafficLightBuilder.leftBuilder
val mid = trafficLightBuilder.midBuilder
val right = trafficLightBuilder.rightBuilder
left.phaseNo = this.laneList.left.phaseNo
left.color = this.laneList.left.color
left.remain = this.laneList.left.remain
mid.phaseNo = this.laneList.mid.phaseNo
mid.color = this.laneList.mid.color
mid.remain = this.laneList.mid.remain
right.phaseNo = this.laneList.right.phaseNo
right.color = this.laneList.right.color
right.remain = this.laneList.right.remain
if(this.laneList != null){
left.phaseNo = this.laneList.left.phaseNo
left.color = this.laneList.left.color
left.remain = this.laneList.left.remain
mid.phaseNo = this.laneList.mid.phaseNo
mid.color = this.laneList.mid.color
mid.remain = this.laneList.mid.remain
right.phaseNo = this.laneList.right.phaseNo
right.color = this.laneList.right.color
right.remain = this.laneList.right.remain
}
return trafficLightBuilder.build()
}
@@ -39,7 +41,7 @@ data class TrafficLightResult(
val lightId: Int, //红绿灯ID
val laneNo: Int, //车道号
val arrowNo: Int, //当前车道对应地面要素转向
val laneList: TrafficLightDetail, //灯态具体信息
val laneList: TrafficLightDetail?, //灯态具体信息
val flashYellow: Int,// 黄灯总时间
val timeStamp: Long //当前卫星时间,单位:ms
) {

View File

@@ -4,6 +4,9 @@ object TrafficLightStatusHelper {
fun getCurrentRoadTrafficLight(trafficLightResult: TrafficLightResult): TrafficLightStatus? {
val arrowNo = trafficLightResult.arrowNo
if(trafficLightResult.laneList == null){
return null
}
if (RoadArrow.isLeft(arrowNo) && trafficLightResult.laneNo == -1) {
return trafficLightResult.laneList.left
}

View File

@@ -10,7 +10,7 @@
org.gradle.daemon=true
org.gradle.configureondemand=true
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx3048m
org.gradle.jvmargs=-Xmx3072m
#开启gradle缓存
org.gradle.caching=true
android.enableBuildCache=true
@@ -66,23 +66,23 @@ SERVICE_BIZ_VERSION=1.2.4
LOGLIB_VERSION=1.5.10
######## MogoAiCloudSDK Version ########
# 网络请求LOGLIB_VERSION
MOGO_NETWORK_VERSION=1.4.4.1
MOGO_NETWORK_VERSION=1.4.4.2
# 鉴权
MOGO_PASSPORT_VERSION=1.4.4.1
MOGO_PASSPORT_VERSION=1.4.4.2
# 常链接
MOGO_SOCKET_VERSION=1.4.4.1
MOGO_SOCKET_VERSION=1.4.4.2
# 数据采集
MOGO_REALTIME_VERSION=1.4.4.1
MOGO_REALTIME_VERSION=1.4.4.2
# 探路,道路事件发布,获取
MOGO_TANLU_VERSION=1.4.4.1
MOGO_TANLU_VERSION=1.4.4.2
# 直播推流
MOGO_LIVE_VERSION=1.4.4.1
MOGO_LIVE_VERSION=1.4.4.2
# 直播拉流
MOGO_TRAFFICLIVE_VERSION=1.4.4.1
MOGO_TRAFFICLIVE_VERSION=1.4.4.2
# 定位服务
MOGO_LOCATION_VERSION=1.4.4.1
MOGO_LOCATION_VERSION=1.4.4.2
# 远程通讯模块
MOGO_TELEMATIC_VERSION=1.4.4.1
MOGO_TELEMATIC_VERSION=1.4.4.2
######## MogoAiCloudSDK Version ########
# 自研地图
MAP_SDK_VERSION=2.10.0.2_test_01

View File

@@ -126,7 +126,7 @@ public class AMapViewWrapper implements IMogoMapView,
private void initViews() {
// 初始化首次地图进入的时候的样式, MapAutoApi.INSTANCE.init(context, mapParams);将影响这里的数据
int mapStyle = MapAutoApi.INSTANCE.getMapParams().getStyleMode();
CallerLogger.INSTANCE.e(M_MAP + TAG, "默认配置地图模式mapStyle=" + mapStyle);
CallerLogger.INSTANCE.d(M_MAP + TAG, "默认配置地图模式mapStyle=" + mapStyle);
switch (mapStyle) {
case MapAutoApi.MAP_STYLE_DAY:
mCurrentUI = EnumMapUI.MAP_STYLE_DAY;

View File

@@ -89,7 +89,6 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
}
public void setExtraGPSData(MogoLocation gnssInfo) {
getMap().getUIController().setExtraGPSData(gnssInfo);
}