@@ -4,7 +4,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.module.share.bean.event.MarkerInfo;
|
||||
import com.mogo.module.share.constant.ShareConstants;
|
||||
import com.mogo.service.share.IMogoTanluUiProvider;
|
||||
|
||||
@@ -15,7 +15,7 @@ import android.view.animation.LinearInterpolator;
|
||||
import com.mogo.cloud.tanlu.bean.MarkerExploreWayCloud;
|
||||
import com.mogo.cloud.tanlu.bean.MarkerExploreWayItemCloud;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.module.share.manager
|
||||
|
||||
import com.mogo.map.MogoLatLng
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.map.search.traffic.IMogoTrafficSearchListener
|
||||
import com.mogo.map.search.traffic.MogoTrafficResult
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
@@ -32,7 +32,11 @@ class TrafficUploadManager : IMogoTrafficSearchListener {
|
||||
val location = TanluServiceManager.getLocationClient().lastKnowLocation
|
||||
trafficSearchApi.registerTrafficSearchListener(this)
|
||||
Logger.d(TAG, "verityTrafficStatus searchTrafficByCircleArea")
|
||||
trafficSearchApi.searchTrafficByCircleArea(MogoLatLng(location.latitude, location.longitude), TRAFFIC_SEARCH_AREA)
|
||||
trafficSearchApi.searchTrafficByCircleArea(
|
||||
MogoLatLng(
|
||||
location.latitude,
|
||||
location.longitude
|
||||
), TRAFFIC_SEARCH_AREA)
|
||||
}
|
||||
|
||||
override fun onTrafficSearchError(errorMsg: String?) {
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.mogo.module.share.manager
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.map.MogoLatLng
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.module.common.enums.EventTypeEnum
|
||||
import com.mogo.module.share.R
|
||||
import com.mogo.module.share.constant.ShareConstants.*
|
||||
@@ -50,7 +50,10 @@ object UploadHelper {
|
||||
// TanluManager.getInstance(context).shareSuccess(type.eventType, type.location)
|
||||
ServiceApisManager.serviceApis.tanluUiApi.shareSuccess(type.eventType, type.location)
|
||||
val location = ServiceApisManager.serviceApis.mapServiceApi.getSingletonLocationClient(context).lastKnowLocation
|
||||
val latLon = MogoLatLng(location.latitude, location.longitude)
|
||||
val latLon = com.mogo.eagle.core.data.map.MogoLatLng(
|
||||
location.latitude,
|
||||
location.longitude
|
||||
)
|
||||
type.location = latLon
|
||||
Logger.d("UploadHelper", "upload type----> $type")
|
||||
ServiceApisManager.serviceApis.tanluApi.uploadRoadCondition(type)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.module.share.strategyreceiver
|
||||
|
||||
import com.mogo.map.MogoLatLng
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.module.share.constant.S_TAG
|
||||
import com.mogo.module.share.strategyreceiver.AccidentStrategyPushWrapper.Companion.TYPE_ACCIDENT
|
||||
import com.mogo.module.share.strategyreceiver.AccidentStrategyPushWrapper.Companion.TYPE_BLOCK
|
||||
@@ -23,11 +23,15 @@ class AccidentStrategyReceiver(private val apis: IMogoServiceApis) : IMogoOnMess
|
||||
when (obj.type) {
|
||||
TYPE_ACCIDENT -> {
|
||||
// 收集事故视频
|
||||
apis.tanluApi.uploadRoadCondition(TanluUploadParams(IMogoTanluProvider.TYPE_ACCIDENT, IMogoTanluProvider.UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO, it.id, MogoLatLng(it.lat, it.lon)))
|
||||
apis.tanluApi.uploadRoadCondition(TanluUploadParams(IMogoTanluProvider.TYPE_ACCIDENT, IMogoTanluProvider.UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO, it.id,
|
||||
com.mogo.eagle.core.data.map.MogoLatLng(it.lat, it.lon)
|
||||
))
|
||||
}
|
||||
TYPE_BLOCK -> {
|
||||
// 收集拥堵视频
|
||||
apis.tanluApi.uploadRoadCondition(TanluUploadParams(IMogoTanluProvider.TYPE_BLOCK, IMogoTanluProvider.UPLOAD_FROM_STRATEGY_CLOUD_CHECK, it.id, MogoLatLng(it.lat, it.lon)))
|
||||
apis.tanluApi.uploadRoadCondition(TanluUploadParams(IMogoTanluProvider.TYPE_BLOCK, IMogoTanluProvider.UPLOAD_FROM_STRATEGY_CLOUD_CHECK, it.id,
|
||||
com.mogo.eagle.core.data.map.MogoLatLng(it.lat, it.lon)
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.mogo.module.share.strategyreceiver
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.os.SystemClock
|
||||
import com.mogo.map.MogoLatLng
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.module.share.manager.ServiceApisManager
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.service.share.IMogoTanluProvider
|
||||
@@ -132,8 +132,8 @@ class BlockStrategy(private val context: Context, private val apis: IMogoService
|
||||
var blockFromSpeed = false
|
||||
var blockFromDistance = false
|
||||
|
||||
var latLonFromSpeed: MogoLatLng? = null
|
||||
var latLonFromDistance: MogoLatLng? = null
|
||||
var latLonFromSpeed: com.mogo.eagle.core.data.map.MogoLatLng? = null
|
||||
var latLonFromDistance: com.mogo.eagle.core.data.map.MogoLatLng? = null
|
||||
|
||||
val p = TanluUploadParams(IMogoTanluProvider.TYPE_BLOCK, IMogoTanluProvider.UPLOAD_FROM_STRATEGY_BLOCK_AUTO)
|
||||
// 到达时间限制,上报速度,数据清空
|
||||
@@ -148,7 +148,10 @@ class BlockStrategy(private val context: Context, private val apis: IMogoService
|
||||
blockFromSpeed = ave in 1..10
|
||||
// 上报平均速度
|
||||
val location = ServiceApisManager.serviceApis.mapServiceApi.getSingletonLocationClient(context).lastKnowLocation
|
||||
latLonFromSpeed = MogoLatLng(location.latitude, location.longitude)
|
||||
latLonFromSpeed = com.mogo.eagle.core.data.map.MogoLatLng(
|
||||
location.latitude,
|
||||
location.longitude
|
||||
)
|
||||
} else {
|
||||
Logger.d(TAG, "判定为停车,不进行上报")
|
||||
}
|
||||
@@ -156,7 +159,8 @@ class BlockStrategy(private val context: Context, private val apis: IMogoService
|
||||
// 超过阈值,准备判断是否拥堵
|
||||
if (tripDistance in 100..1000 && isClose() && currentSpeed < 40) {
|
||||
Logger.d(TAG, "根据距离,判定为拥堵,准备上报, tripDistance: $tripDistance, frontDistance: $frontDistance, currentSpeed: $currentSpeed")
|
||||
latLonFromDistance = MogoLatLng(lat, lon)
|
||||
latLonFromDistance =
|
||||
com.mogo.eagle.core.data.map.MogoLatLng(lat, lon)
|
||||
blockFromDistance = true
|
||||
} else {
|
||||
Logger.d(TAG, "根据距离,没有判定为拥堵, tripDistance: $tripDistance, frontDistance: $frontDistance, currentSpeed: $currentSpeed")
|
||||
|
||||
Reference in New Issue
Block a user