add new field
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ASMIdeaPluginConfiguration">
|
||||
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
|
||||
<asm skipDebug="true" skipFrames="true" skipCode="false" expandFrames="false" />
|
||||
<groovy codeStyle="LEGACY" />
|
||||
</component>
|
||||
<component name="ASMPluginConfiguration">
|
||||
|
||||
@@ -4,18 +4,18 @@ apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'android-aspectjx'
|
||||
apply plugin: 'bugly'
|
||||
////apply ByteX宿主
|
||||
//apply plugin: 'bytex'
|
||||
//ByteX {
|
||||
// enable true
|
||||
// enableInDebug true
|
||||
// logLevel "DEBUG"
|
||||
//}
|
||||
//
|
||||
//apply plugin: 'chain.log.hook'
|
||||
//hooklog{
|
||||
// enableLoggerToServer true
|
||||
//}
|
||||
//apply ByteX宿主
|
||||
apply plugin: 'bytex'
|
||||
ByteX {
|
||||
enable true
|
||||
enableInDebug true
|
||||
logLevel "DEBUG"
|
||||
}
|
||||
|
||||
apply plugin: 'chain.log.hook'
|
||||
hooklog{
|
||||
enableLoggerToServer true
|
||||
}
|
||||
bugly {
|
||||
appId = 'ac71228f85' // 注册时分配的App ID
|
||||
appKey = '3c736249-d6be-4066-b577-b7a6dc975cf7' // 注册时分配的App Key
|
||||
|
||||
20
build.gradle
20
build.gradle
@@ -4,14 +4,15 @@ apply from: "javadoc.gradle"
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
// maven { url "https://artifact.bytedance.com/repository/byteX/" }
|
||||
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
|
||||
maven { url "https://artifact.bytedance.com/repository/byteX/" }
|
||||
maven { url 'http://nexus.zhidaoauto.com/repository/maven-releases/' }
|
||||
maven { url 'http://nexus.zhidaoauto.com/repository/maven-public/' }
|
||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
||||
maven { url 'https://maven.aliyun.com/repository/jcenter' }
|
||||
maven { url 'https://nexus.zhidaoauto.com/repository/maven-releases/' }
|
||||
maven { url 'https://nexus.zhidaoauto.com/repository/maven-public/' }
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
@@ -20,8 +21,8 @@ buildscript {
|
||||
classpath "com.alibaba:arouter-register:1.0.9-mogo"
|
||||
classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.4'
|
||||
classpath 'com.tencent.bugly:symtabfileuploader:latest.release'
|
||||
// classpath "com.bytedance.android.byteX:base-plugin:0.3.0"
|
||||
// classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}"
|
||||
classpath "com.bytedance.android.byteX:base-plugin:0.3.0"
|
||||
classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}"
|
||||
|
||||
// classpath ("com.tencent.matrix:matrix-gradle-plugin:0.6.6") { changing = true }
|
||||
}
|
||||
@@ -30,14 +31,15 @@ buildscript {
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
maven { url "https://artifact.bytedance.com/repository/byteX/" }
|
||||
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
|
||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
|
||||
maven { url 'http://nexus.zhidaoauto.com/repository/maven-releases/' }
|
||||
maven { url 'http://nexus.zhidaoauto.com/repository/maven-public/' }
|
||||
maven { url "https://artifact.bytedance.com/repository/byteX/" }
|
||||
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
||||
maven { url 'https://maven.aliyun.com/repository/jcenter' }
|
||||
maven { url 'http://nexus.zhidaoauto.com/repository/maven-releases/' }
|
||||
maven { url 'http://nexus.zhidaoauto.com/repository/maven-public/' }
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
|
||||
|
||||
@@ -4,16 +4,16 @@ import android.content.Context
|
||||
import android.location.Location
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.eagle.core.data.trafficlight.RoadIDResult
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightDetail
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.data.trafficlight.isInRange
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.TrafficLightHMIManager
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_LOOP_SEARCH_CROSS_ROAD
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_LOOP_SEARCH_TRAFFIC_LIGHT
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_CROSS_ROAD
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_TRAFFIC_LIGHT
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.network.TrafficLightNetWorkModel
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
@@ -33,9 +33,11 @@ class MogoTrafficLightManager : IMogoCarLocationChangedListener2 {
|
||||
private var mContext: Context? = null
|
||||
private val trafficLightNetWorkModel = TrafficLightNetWorkModel()
|
||||
private var mLocation: Location? = null
|
||||
private var roadId: String? = null
|
||||
private var roadIDResult: RoadIDResult? = null
|
||||
private var trafficLightResult: TrafficLightResult? = null
|
||||
|
||||
private var inRange: Boolean = false
|
||||
|
||||
private var mThreadHandler: Handler? = null
|
||||
|
||||
fun initServer(context: Context) {
|
||||
@@ -53,9 +55,10 @@ class MogoTrafficLightManager : IMogoCarLocationChangedListener2 {
|
||||
val tileId = MogoApisHandler.getInstance().apis
|
||||
.mapServiceApi.mapUIController.getTileId(it.longitude, it.latitude)
|
||||
trafficLightNetWorkModel.requestRoadID(
|
||||
tileId, it.latitude, it.longitude, it.bearing.toDouble(), {
|
||||
tileId, it.latitude, it.longitude, it.bearing.toDouble(),
|
||||
{
|
||||
mThreadHandler?.sendEmptyMessage(MSG_WHAT_STOP_SEARCH_CROSS_ROAD)
|
||||
roadId = it
|
||||
roadIDResult = it
|
||||
},
|
||||
{
|
||||
Logger.e(TAG, "request road id error : $it")
|
||||
@@ -69,7 +72,8 @@ class MogoTrafficLightManager : IMogoCarLocationChangedListener2 {
|
||||
}, {
|
||||
//start loop traffic light
|
||||
mLocation?.let {
|
||||
val road = if (roadId.isNullOrBlank()) "" else roadId!!
|
||||
val road =
|
||||
if (roadIDResult?.rsCrossId.isNullOrBlank()) "" else roadIDResult?.rsCrossId
|
||||
trafficLightNetWorkModel.requestTrafficLight(
|
||||
it.latitude, it.longitude, it.bearing.toDouble(), road, { result ->
|
||||
trafficLightResult = result
|
||||
@@ -97,6 +101,28 @@ class MogoTrafficLightManager : IMogoCarLocationChangedListener2 {
|
||||
mThreadHandler?.sendEmptyMessageDelayed(MSG_WHAT_LOOP_SEARCH_CROSS_ROAD, 5_000L)
|
||||
}
|
||||
|
||||
private fun checkOutOfRange() {
|
||||
mLocation?.let { loc ->
|
||||
roadIDResult?.let {
|
||||
// 检测是否开过路口,开过路口则停止读灯。并重置 trafficLightResult 值为 null
|
||||
// trafficLightResult != null &&
|
||||
if (it.isInRange(loc.latitude, loc.longitude)) {
|
||||
inRange = true
|
||||
Logger.d("arrowtest", "进入路口")
|
||||
return
|
||||
}
|
||||
if (inRange) {
|
||||
Logger.d("arrowtest", "离开路口")
|
||||
inRange = false
|
||||
trafficLightResult = null
|
||||
TrafficLightHMIManager.INSTANCE.hideTrafficLight()
|
||||
CallTrafficLightListenerManager.resetTrafficLightData()
|
||||
mThreadHandler?.sendEmptyMessage(TrafficLightThreadHandler.MSG_WHAT_STOP_SEARCH_TRAFFIC_LIGHT)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun getTrafficLightCurrentState(): TrafficLightDetail? {
|
||||
trafficLightResult?.let {
|
||||
return it.laneList
|
||||
@@ -121,20 +147,7 @@ class MogoTrafficLightManager : IMogoCarLocationChangedListener2 {
|
||||
override fun onCarLocationChanged2(latLng: Location?) {
|
||||
latLng?.let {
|
||||
mLocation = latLng
|
||||
|
||||
// 检测是否开过路口,开过路口则停止读灯。并重置 trafficLightResult 值为 null
|
||||
if (trafficLightResult != null
|
||||
&& (CoordinateUtils.calculateLineDistance(
|
||||
it.longitude, it.latitude,
|
||||
trafficLightResult!!.lon, trafficLightResult!!.lat
|
||||
) < 10)
|
||||
) {
|
||||
Logger.d(TAG, "开过路口")
|
||||
trafficLightResult = null
|
||||
TrafficLightHMIManager.INSTANCE.hideTrafficLight()
|
||||
CallTrafficLightListenerManager.resetTrafficLightData()
|
||||
mThreadHandler?.sendEmptyMessage(MSG_WHAT_STOP_SEARCH_TRAFFIC_LIGHT)
|
||||
}
|
||||
checkOutOfRange()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +155,6 @@ class MogoTrafficLightManager : IMogoCarLocationChangedListener2 {
|
||||
mThreadHandler = null
|
||||
mContext = null
|
||||
mLocation = null
|
||||
roadId = null
|
||||
trafficLightResult = null
|
||||
}
|
||||
|
||||
|
||||
@@ -4,16 +4,16 @@ import com.google.gson.Gson
|
||||
import com.mogo.cloud.network.RetrofitFactory
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.eagle.core.data.trafficlight.*
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.TrafficLightConst
|
||||
import com.mogo.utils.logger.Logger
|
||||
import com.mogo.module.common.constants.HostConst.CITY_HOST
|
||||
import com.mogo.utils.network.apiCall
|
||||
import com.mogo.utils.network.cancel
|
||||
import com.mogo.utils.network.request
|
||||
|
||||
class TrafficLightNetWorkModel {
|
||||
|
||||
private fun getNetWorkApi(baseUrl: String = TrafficLightConst.getNetHost()): TrafficLightApiService {
|
||||
private fun getNetWorkApi(baseUrl: String = CITY_HOST): TrafficLightApiService {
|
||||
return RetrofitFactory.getInstanceNoCallAdapter(baseUrl)!!
|
||||
.create(TrafficLightApiService::class.java)
|
||||
}
|
||||
@@ -23,7 +23,7 @@ class TrafficLightNetWorkModel {
|
||||
lat: Double,
|
||||
lon: Double,
|
||||
bearing: Double,
|
||||
onSuccess: ((String) -> Unit),
|
||||
onSuccess: ((RoadIDResult) -> Unit),
|
||||
onError: ((String) -> Unit),
|
||||
) {
|
||||
request<BaseResponse<RoadIDResult>>("requestRoadID") {
|
||||
@@ -40,9 +40,9 @@ class TrafficLightNetWorkModel {
|
||||
}
|
||||
onSuccess {
|
||||
if (it.result != null) {
|
||||
if(it.result.rsCrossId.isNotEmpty()){
|
||||
onSuccess.invoke(it.result.rsCrossId)
|
||||
}else{
|
||||
if (it.result.rsCrossId.isNotEmpty() && !it.result.rectLatLngs.isNullOrEmpty()) {
|
||||
onSuccess.invoke(it.result)
|
||||
} else {
|
||||
onError.invoke("requestRoadID result rsCrossId is null")
|
||||
}
|
||||
} else {
|
||||
@@ -65,13 +65,16 @@ class TrafficLightNetWorkModel {
|
||||
lat: Double,
|
||||
lon: Double,
|
||||
bearing: Double,
|
||||
roadId: String,
|
||||
roadId: String?,
|
||||
onSuccess: ((TrafficLightResult) -> Unit),
|
||||
onError: ((String) -> Unit),
|
||||
) {
|
||||
request<BaseResponse<TrafficLightResult>>("requestTrafficLight") {
|
||||
val map = hashMapOf<String, String>()
|
||||
start {
|
||||
if(roadId == null){
|
||||
return@start
|
||||
}
|
||||
val trafficLightRequestData = TrafficLightRequestData(lat, lon, bearing, roadId)
|
||||
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
|
||||
map["data"] = Gson().toJson(trafficLightRequestData)
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.mogo.eagle.core.function.v2x.vip
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
|
||||
class VipConst {
|
||||
|
||||
companion object {
|
||||
const val MODULE_NAME = "MODULE_V2X_VIP"
|
||||
|
||||
private const val HOST_DEV = "http://dzt-test.zhidaozhixing.com"
|
||||
private const val HOST_TEST = "http://dzt-test.zhidaozhixing.com"
|
||||
private const val HOST_DEMO = "http://dzt-show.zhidaozhixing.com"
|
||||
private const val HOST_PRODUCT = "http://dzt.zhidaozhixing.com"
|
||||
|
||||
fun getNetHost(): String {
|
||||
return when (DebugConfig.getNetMode()) {
|
||||
DebugConfig.NET_MODE_DEV -> HOST_DEV
|
||||
DebugConfig.NET_MODE_QA -> HOST_TEST
|
||||
DebugConfig.NET_MODE_DEMO -> HOST_DEMO
|
||||
else -> HOST_PRODUCT
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@ package com.mogo.eagle.core.function.v2x.vip.network
|
||||
import com.mogo.cloud.network.RetrofitFactory
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.eagle.core.function.v2x.vip.VipConst
|
||||
import com.mogo.module.common.constants.HostConst.DATA_SERVICE_HOST
|
||||
import com.mogo.utils.network.apiCall
|
||||
import com.mogo.utils.network.request
|
||||
|
||||
class VipNetWorkModel {
|
||||
|
||||
private fun getNetWorkApi(baseUrl: String = VipConst.getNetHost()): VipApiService {
|
||||
private fun getNetWorkApi(baseUrl: String = DATA_SERVICE_HOST): VipApiService {
|
||||
return RetrofitFactory.getInstanceNoCallAdapter(baseUrl)!!
|
||||
.create(VipApiService::class.java)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
package com.mogo.eagle.core.data.trafficlight
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
|
||||
private fun RoadIDResult.isLatInRange(lat: Double): Boolean {
|
||||
val max = this.rectLatLngs.maxOf { mogoLatLng: MogoLatLng -> mogoLatLng.lat }
|
||||
val min = this.rectLatLngs.minOf { mogoLatLng: MogoLatLng -> mogoLatLng.lat }
|
||||
return (lat > min.coerceAtMost(max) && lat < min.coerceAtLeast(max))
|
||||
}
|
||||
|
||||
private fun RoadIDResult.isLonInRange(lon: Double): Boolean {
|
||||
val max = this.rectLatLngs.maxOf { mogoLatLng: MogoLatLng -> mogoLatLng.lon }
|
||||
val min = this.rectLatLngs.minOf { mogoLatLng: MogoLatLng -> mogoLatLng.lon }
|
||||
return (lon > min.coerceAtMost(max) && lon < min.coerceAtLeast(max))
|
||||
}
|
||||
|
||||
fun RoadIDResult.isInRange(lat: Double, lon: Double): Boolean {
|
||||
return isLatInRange(lat) && isLonInRange(lon)
|
||||
}
|
||||
|
||||
//车辆行驶前方100米范围内的 路口ID 查询结果
|
||||
/**
|
||||
* rSCrossId : RS系统对应路口id
|
||||
@@ -11,6 +29,7 @@ data class RoadIDResult(
|
||||
val rsCrossId: String,
|
||||
val crossId: String,
|
||||
val distance: Double,
|
||||
val baseLaneInfoList: List<BaseLaneInfoList>
|
||||
val baseLaneInfoList: List<BaseLaneInfoList>,
|
||||
val rectLatLngs: List<MogoLatLng>
|
||||
) {
|
||||
}
|
||||
@@ -46,17 +46,18 @@ PASSWORD=xintai2018
|
||||
# 编译模式: false - 依赖本地版本, true - 依赖 maven 版本
|
||||
USE_MAVEN_PACKAGE=false
|
||||
##plugin 插件
|
||||
#android.enableR8.libraries=false
|
||||
#android.enableR8=false
|
||||
#android.enableD8=true
|
||||
#android.enableD8.desugaring=true
|
||||
#android.enableDesugar=true
|
||||
#bytex.enableHtmlLog=true
|
||||
#bytex.forbidUseLenientMutationDuringGetArtifact=true
|
||||
#bytex.verifyProguardConfigurationChanged=false
|
||||
#bytex.ASM_API=ASM7
|
||||
HOOK_LOG_VERSION=1.4.63
|
||||
SERVICE_CHAIN_VERSION=1.0.22
|
||||
android.enableR8.libraries=false
|
||||
android.enableR8=false
|
||||
android.enableD8=true
|
||||
android.enableD8.desugaring=true
|
||||
android.enableDesugar=true
|
||||
bytex.enableHtmlLog=true
|
||||
bytex.forbidUseLenientMutationDuringGetArtifact=true
|
||||
bytex.verifyProguardConfigurationChanged=false
|
||||
bytex.ASM_API=ASM7
|
||||
|
||||
HOOK_LOG_VERSION=1.4.67
|
||||
SERVICE_CHAIN_VERSION=1.0.23
|
||||
################ 外部依赖引用 ################
|
||||
# loglib
|
||||
LOGLIB_VERSION=1.0.4
|
||||
|
||||
@@ -59,6 +59,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
// implementation rootProject.ext.dependencies.mogochainbase
|
||||
|
||||
api rootProject.ext.dependencies.mogoaicloudrealtime
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ public class HostConst {
|
||||
public static final String OPEN_CAMERA_STREAM_HOST = "http://10.0.16.6:18080";
|
||||
public static final String MEC_ETL_HOST = "http://dzt-mecEtl.zhidaozhixing.com";
|
||||
|
||||
public static final String CITY_HOST = "http://dzt-city.zhidaozhixing.com";
|
||||
public static final String SOCKET_CENTER_DOMAIN = "socketRegion";
|
||||
|
||||
// 网约车
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.mogo.utils.ViewUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.carchattingprovider.ICarsChattingProvider;
|
||||
import com.zhidao.carchattingprovider.MogoDriverInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
Reference in New Issue
Block a user