[3.4.0] change the crossid get before traffic light request cross road and adjust time to 1000

This commit is contained in:
zhongchao
2023-08-04 18:48:35 +08:00
parent 8523c609a0
commit ebaf5608a9
2 changed files with 5 additions and 6 deletions

View File

@@ -20,8 +20,6 @@ import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandl
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_CROSS_ROAD
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_TRAFFIC_LIGHT
import com.mogo.eagle.function.biz.v2x.trafficlight.network.TrafficLightNetWorkModel
import com.mogo.map.MogoData
import com.mogo.map.MogoData.Companion.mogoMapData
class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
@@ -60,9 +58,8 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
}
firstLoopCrossRoad = false
mLocation?.let { it ->
val tileId = mogoMapData.get().getTileId(it.longitude, it.latitude)
trafficLightNetWorkModel.requestRoadID(
tileId, it.latitude, it.longitude, it.heading,
it.latitude, it.longitude, it.heading,
{
mThreadHandler?.sendEmptyMessage(MSG_WHAT_STOP_SEARCH_CROSS_ROAD)
roadIDResult = it

View File

@@ -4,6 +4,7 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.constants.HostConst
import com.mogo.eagle.core.data.BaseResponse
import com.mogo.eagle.core.data.biz.trafficlight.*
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.eagle.core.network.apiCall
import com.mogo.eagle.core.network.cancel
@@ -18,7 +19,6 @@ class TrafficLightNetWorkModel {
}
fun requestRoadID(
tileID: Long,
lat: Double,
lon: Double,
bearing: Double,
@@ -28,8 +28,10 @@ class TrafficLightNetWorkModel {
request<BaseResponse<RoadIDResult>>("requestRoadID") {
loader {
apiCall {
val tileId = CallerMapUIServiceManager.getMapUIController()
?.getTileId(lon, lat) ?: 0
val map = hashMapOf<String, String>()
val roadIDRequestData = RoadIDRequestData(tileID, lat, lon, bearing)
val roadIDRequestData = RoadIDRequestData(tileId, lat, lon, bearing)
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["data"] = GsonUtils.toJson(roadIDRequestData)
getNetWorkApi().getFrontRoadID(map)