Merge branch 'dev_robotaxi-d-app-module_2110_220915_2.11.0' of gitlab.zhidaoauto.com:zhjt/AndroidApp/MoGoEagleEye into dev_robotaxi-d-app-module_2110_220915_2.11.0

# Conflicts:
#	OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerRouteFragment.java
This commit is contained in:
wangmingjun
2022-09-26 15:36:54 +08:00
28 changed files with 545 additions and 113 deletions

View File

@@ -26,6 +26,7 @@ import com.mogo.och.bus.passenger.bean.BusPassengerStation;
import com.mogo.och.bus.passenger.callback.IBusPassengerMapViewCallback;
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
import com.mogo.och.bus.passenger.presenter.BaseBusPassengerPresenter;
import com.mogo.och.bus.passenger.ui.layoutmanager.CenterLayoutManager;
import com.mogo.och.bus.passenger.utils.BPRouteDataTestUtils;
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
@@ -91,7 +92,7 @@ public class BusPassengerRouteFragment extends
mRouteInfoView = findViewById(R.id.bus_p_line_cl);
mStationsListRv = findViewById(R.id.bus_p_line_stations_rl);
LinearLayoutManager manager = new LinearLayoutManager(getContext());
CenterLayoutManager manager = new CenterLayoutManager(getContext());
mStationsListRv.setLayoutManager(manager);
mAdapter = new BusPassengerLineStationsAdapter(getContext(), mStationsList);
mStationsListRv.setAdapter(mAdapter);

View File

@@ -0,0 +1,42 @@
package com.mogo.och.bus.passenger.ui.layoutmanager;
import android.content.Context;
import android.util.AttributeSet;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.LinearSmoothScroller;
import androidx.recyclerview.widget.RecyclerView;
public class CenterLayoutManager extends LinearLayoutManager {
public CenterLayoutManager(Context context) {
super(context);
}
public CenterLayoutManager(Context context, int orientation, boolean reverseLayout) {
super(context, orientation, reverseLayout);
}
public CenterLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
@Override
public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state, int position) {
RecyclerView.SmoothScroller smoothScroller = new CenterSmoothScroller(recyclerView.getContext());
smoothScroller.setTargetPosition(position);
startSmoothScroll(smoothScroller);
}
private static class CenterSmoothScroller extends LinearSmoothScroller {
CenterSmoothScroller(Context context) {
super(context);
}
@Override
public int calculateDtToFit(int viewStart, int viewEnd, int boxStart, int boxEnd, int snapPreference) {
return (boxStart + (boxEnd - boxStart) / 2) - (viewStart + (viewEnd - viewStart) / 2);
}
}
}

View File

@@ -10,6 +10,7 @@ import android.widget.ImageView
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.PagerSnapHelper
import androidx.recyclerview.widget.RecyclerView
import com.mogo.commons.mvp.MvpActivity
import com.mogo.eagle.core.utilcode.util.SharedPrefs
@@ -70,6 +71,7 @@ class BusSwitchLineActivity : MvpActivity<BusSwitchLineView?, BusLinePresenter?>
mLineCommitBtn.setOnClickListener(this)
mLinesListView = findViewById(R.id.switch_line_rv)
linearLayoutManager = LinearLayoutManager(this)
PagerSnapHelper().attachToRecyclerView(mLinesListView)
mLinesListView.setLayoutManager(linearLayoutManager)
mLinesListView.setItemAnimator(OpenItemAnimator())
mAdapter = SwitchLineAdapter(applicationContext, mData)

View File

@@ -27,6 +27,8 @@ if (!isAndroidTestBuild()) {
enableTraceToServer false
enableLoggerToLocal true
}
apply plugin: 'biz.config.hook'
}
if (!isAndroidTestBuild()) {

View File

@@ -52,6 +52,7 @@ import com.zhidao.support.adas.high.common.CupidLogUtils
import com.zhidao.support.adas.high.common.MogoReport
import com.zhjt.service.chain.ChainLog
import com.zhjt.service.chain.TracingConstants
import com.zhjt.service_biz.BizConfig
import io.netty.channel.Channel
import mogo.telematics.pad.MessagePad
import java.util.*

View File

@@ -69,7 +69,7 @@ class FuncConfigCenter : IMogoOnMessageListener<FuncConfig> {
BizManager.updateBizConfigData(funcConfig)
funcConfig.business.forEach { business ->
CallerDevaToolsFuncConfigListenerManager.invokeDevaToolsFuncConfigBizUpdate(
business.biz,
business.biz.uppercase(),
business.data
)
}

View File

@@ -54,7 +54,7 @@ class FuncConfigConst {
v2nSubList.add(SubBiz(BIZ_VIP, lock = false, state = true, dependNode = "", data = ""))
v2nSubList.add(SubBiz(BIZ_OPT_LINE, lock = false, state = false, dependNode = "", data = ""))
v2nSubList.add(SubBiz(BIZ_VRU, lock = false, state = true, dependNode = "", data = ""))
v2nSubList.add(SubBiz(BIZ_VRU_RI, lock = false, state = true, dependNode = "", data = ""))
v2nSubList.add(SubBiz(BIZ_VRU_RI, lock = false, state = false, dependNode = "", data = ""))
v2nSubList.add(SubBiz(BIZ_HLW, lock = false, state = true, dependNode = "", data = ""))
businessList.add(Business(V2N, v2nSubList))
@@ -79,12 +79,12 @@ class FuncConfigConst {
businessList.add(Business(V2V,v2vSubList))
val foundationSubList = mutableListOf<SubBiz>()
foundationSubList.add(SubBiz(BIZ_BEAUTY_MODE, lock = true, state = false, dependNode = "", data = ""))
foundationSubList.add(SubBiz(BIZ_RAIN_MODE, lock = true, state = false, dependNode = "", data = ""))
foundationSubList.add(SubBiz(BIZ_BEAUTY_MODE, lock = false, state = false, dependNode = "", data = ""))
foundationSubList.add(SubBiz(BIZ_RAIN_MODE, lock = false, state = false, dependNode = "", data = ""))
foundationSubList.add(SubBiz(BIZ_FULL_LOG, lock = false, state = false, dependNode = "", data = ""))
foundationSubList.add(SubBiz(BIZ_TRACE_LOG, lock = false, state = true, dependNode = "", data = ""))
foundationSubList.add(SubBiz(BIZ_BAG_RECORD, lock = true, state = true, dependNode = "", data = ""))
foundationSubList.add(SubBiz(BIZ_WARNING_UPLOAD, lock = true, state = true, dependNode = "", data = ""))
foundationSubList.add(SubBiz(BIZ_BAG_RECORD, lock = false, state = true, dependNode = "", data = ""))
foundationSubList.add(SubBiz(BIZ_WARNING_UPLOAD, lock = false, state = true, dependNode = "", data = ""))
foundationSubList.add(SubBiz(BIZ_LIMIT_SPEED_SET, lock = false, state = true, dependNode = "", data = ""))
foundationSubList.add(SubBiz(BIZ_BYPASS, lock = false, state = true, dependNode = "", data = ""))
foundationSubList.add(SubBiz(BIZ_AUTOPILOT_LANE_SELECTION, lock = false, state = true, dependNode = "", data = ""))

View File

@@ -8,23 +8,29 @@ import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.FOUNDATIO
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListener
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsFuncConfigListenerManager
object FuncConfigImpl : IMoGoDevaToolsFuncConfigListener {
object FuncConfigImpl {
private const val TAG = "FuncConfigImpl"
fun init() {
CallerDevaToolsFuncConfigListenerManager.registerDevaToolsFuncConfigListener(
FOUNDATION,
CallerDevaToolsFuncConfigListenerManager.registerDevaToolsFuncConfigListener(FOUNDATION,
TAG,
this
object : IMoGoDevaToolsFuncConfigListener {
override fun updateBizData(
type: String,
state: Boolean,
lock: Boolean,
data: String?
) {
when (type) {
BIZ_BEAUTY_MODE -> FunctionBuildConfig.isDemoMode = state
BIZ_RAIN_MODE -> FunctionBuildConfig.isRainMode = state
BIZ_WARNING_UPLOAD -> FunctionBuildConfig.isReportWarning = state
}
}
}
)
}
override fun updateBizData(type: String, state: Boolean, lock: Boolean, data: String?) {
when (type) {
BIZ_BEAUTY_MODE -> FunctionBuildConfig.isDemoMode = state
BIZ_RAIN_MODE -> FunctionBuildConfig.isRainMode = state
BIZ_WARNING_UPLOAD -> FunctionBuildConfig.isReportWarning = state
}
}
}

View File

@@ -1,6 +1,5 @@
package com.zhjt.mogo_core_function_devatools.funcconfig.network
import android.util.Log
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.BaseResponse
import com.mogo.eagle.core.network.MoGoRetrofitFactory
@@ -34,13 +33,9 @@ class FuncConfigNetWorkModel {
if (error == null) {
error = onError
}
//todo test
// map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["sn"] = "X20202203105S688HZ"
// map["mac"] = DeviceUtils.getMacAddress()
map["mac"] = "48:b0:2d:3a:bc:78"
// map["channelVersion"] = FuncConfigConst.getChannelCode()
map["channelVersion"] = 1
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["mac"] = DeviceUtils.getMacAddress()
map["channelVersion"] = FuncConfigConst.getChannelCode()
}
loader {
apiCall {

View File

@@ -12,6 +12,8 @@ import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_FULL_LOG
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.FOUNDATION
import com.mogo.eagle.core.function.api.map.deva.IMoGoMapDevaProvider
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
@@ -34,6 +36,7 @@ import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchConst.Companio
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchConst.Companion.LOG_PUSH_TYPE
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchConst.Companion.START_CATCH_LOG
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchConst.Companion.STOP_CATCH_LOG
import com.zhjt.service_biz.BizConfig
import java.io.File
@SuppressLint("StaticFieldLeak")
@@ -136,6 +139,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
return false
}
@BizConfig(FOUNDATION, "", BIZ_FULL_LOG)
fun startCatchLog(duration: Int = 10, logPrefixName: String? = null) {
if (catchingList.contains(manualContent.pkgName + logPrefixName)) {
TipToast.shortTip("已经在抓取日志了,请稍后再试")
@@ -156,7 +160,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
private fun startCatchLog(content: RemoteLogPushContent, logPrefixName: String? = null) {
CallerLogger.d("$M_DEVA$TAG", "startCatchLog path : ${content.pkgName + logPrefixName}")
if(MoGoAiCloudClientConfig.getInstance().sn == null){
if (MoGoAiCloudClientConfig.getInstance().sn == null) {
ThreadUtils.runOnUiThread {
TipToast.shortTip("缺少设备唯一ID请检查网络")
}
@@ -247,14 +251,14 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
}
override fun uploadFile(filePath: String) {
if(!mapCacheUpload){
if (!mapCacheUpload) {
return
}
val file = File(filePath)
if (file.isFile) {
CallerLogger.d("$M_DEVA$TAG", "uploadFile path : $filePath")
LogInfoManagerFactory.handleSingleUploadFile(filePath)
}else{
} else {
CallerLogger.d("$M_DEVA$TAG", "file absPath : ${file.absolutePath}")
}
}

View File

@@ -9,7 +9,6 @@ import android.graphics.Color
import android.os.Build
import android.text.Html
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.widget.*
@@ -30,6 +29,7 @@ import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_BAG_RECORD
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_BEAUTY_MODE
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_FULL_LOG
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_RAIN_MODE
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_WARNING_UPLOAD
import com.mogo.eagle.core.data.deva.chain.ChainConstant
@@ -1868,6 +1868,19 @@ class DebugSettingView @JvmOverloads constructor(
btnRecordBag.requestFocus()
}
}
BIZ_FULL_LOG -> {
if(state){
tbLogCatch.visibility = View.VISIBLE
}else{
tbLogCatch.visibility = View.GONE
}
if (lock) {
tbLogCatch.isClickable = false
} else {
tbLogCatch.isClickable = true
tbLogCatch.requestFocus()
}
}
}
}

View File

@@ -22,8 +22,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="162px"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/v_second_group"
@@ -40,10 +40,10 @@
android:layout_width="0dp"
android:layout_height="@dimen/dp_216"
android:layout_marginTop="@dimen/dp_90"
android:orientation="horizontal"
android:gravity="center_vertical"
app:layout_constraintStart_toStartOf="@+id/tv_check_title"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/tv_check_title"
app:layout_constraintTop_toBottomOf="@+id/v_second_group">
<RelativeLayout
@@ -153,10 +153,9 @@
android:text="检测"
android:textColor="@color/color_FFFFFF"
android:textSize="42px"
app:layout_constraintStart_toEndOf="@+id/v_second_group"
app:layout_constraintTop_toTopOf="@+id/v_second_group"
app:layout_constraintBottom_toBottomOf="@+id/v_second_group"
/>
app:layout_constraintStart_toEndOf="@+id/v_second_group"
app:layout_constraintTop_toTopOf="@+id/v_second_group" />
<View
android:layout_width="14px"
@@ -201,6 +200,8 @@
android:layout_weight="1"
android:background="@null"
android:gravity="center"
android:maxLength="3"
android:maxLines="1"
android:textColor="#FFFFFFFF"
android:textSize="80px"
tools:ignore="SpeakableTextPresentCheck" />
@@ -294,21 +295,20 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actvLoginout"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/systemVersionView"
app:layout_constraintBottom_toBottomOf="parent"
android:gravity="center"
android:background="@drawable/taxi_loginout_bg"
android:layout_width="790px"
android:layout_height="126px"
android:layout_marginBottom="40px"
android:background="@drawable/taxi_loginout_bg"
android:gravity="center"
android:text="退出登录"
android:visibility="gone"
tools:visibility="visible"
android:textColor="@android:color/white"
android:textSize="42px"
android:layout_width="790px"
android:layout_height="126px"/>
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/systemVersionView"
tools:visibility="visible" />
<com.mogo.eagle.core.function.hmi.ui.tools.SpeedKeyboardView

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.core.function.map.identify
import android.annotation.SuppressLint
import android.util.Log
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.eagle.core.data.traffic.threatLevelColor
@@ -96,6 +97,7 @@ object WarningHelper {
return
}
if (exist) {
Log.i("EmArrow0926","obu color uuid : ${obuTrafficData.uuid}")
obuWarningTrafficData[obuTrafficData.uuid!!] = obuTrafficData
} else {
obuWarningTrafficData.remove(obuTrafficData.uuid)
@@ -115,6 +117,7 @@ object WarningHelper {
if (pncWarningBeautyTrafficData.containsKey(uuid)) {
val planningTrack = pncWarningBeautyTrafficData[uuid]
if (planningTrack != null && !timeOut(planningTrack.time)) {
Log.i("EmArrow0926","pnc color uuid : $uuid")
return planningTrack.color
} else {
pncWarningBeautyTrafficData.remove(uuid)

View File

@@ -45,6 +45,8 @@ import com.mogo.eagle.core.function.v2x.events.network.V2XRefreshCallback
import com.mogo.eagle.core.function.v2x.events.observer.V2XOptimalRouteObserver
import com.mogo.eagle.core.function.v2x.events.receiver.SceneBroadcastReceiver
import com.mogo.eagle.core.function.v2x.events.scenario.impl.V2XScenarioManager
import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.*
import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker.Marker
import com.mogo.eagle.core.function.v2x.events.utils.*
import com.mogo.eagle.core.function.v2x.events.voice.V2XVoiceManager
import com.mogo.eagle.core.network.utils.GsonUtil
@@ -62,7 +64,6 @@ import com.mogo.module.common.drawer.TrafficMarkerDrawer
import com.mogo.module.common.entity.*
import com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum
import com.mogo.module.common.enums.EventTypeEnum
import com.mogo.module.common.enums.EventTypeEnum.FOURS_BLOCK_UP
import com.mogo.module.common.enums.EventTypeHelper
import com.mogo.service.statusmanager.IMogoStatusChangedListener
import com.mogo.service.statusmanager.StatusDescriptor
@@ -108,6 +109,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
BridgeApi.init(context)
if (hasInit.compareAndSet(false, true)) {
if (!V2XManager.hasInit()) {
AiRoadMarker.init(context)
V2XManager.init(V2XConfig.Builder().also {
it.aiCloudConfig(MoGoAiCloudClientConfig.getInstance())
it.context(context)
@@ -483,6 +485,9 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
val p = CoordinateUtils.transformWgsToGcj(this.roadwork?.center?.point?.lat ?: 0.0, this.roadwork?.center?.point?.lon ?: 0.0)
l4.lon = p[0]
l4.lat = p[1]
AiRoadMarker.enqueue(Marker(this.roadwork?.center?.point?.lat ?: 0.0, this.roadwork?.center?.point?.lon ?: 0.0, this.roadwork?.polygonList?.takeIf { it.isNotEmpty() }?.map { d ->
android.util.Pair(d.lon, d.lat)
}))
l4.angle = this.roadwork?.center?.road?.bearing?.toDouble() ?: 0.0
}
})

View File

@@ -0,0 +1,324 @@
package com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad
import android.content.*
import android.graphics.*
import android.util.*
import androidx.lifecycle.*
import androidx.lifecycle.Lifecycle.Event
import androidx.lifecycle.Lifecycle.Event.ON_CREATE
import androidx.lifecycle.Lifecycle.Event.ON_DESTROY
import com.mogo.cloud.commons.utils.*
import com.mogo.eagle.core.data.map.*
import com.mogo.eagle.core.data.map.MapRoadInfo.StopLine
import com.mogo.eagle.core.function.api.map.listener.*
import com.mogo.eagle.core.function.call.map.*
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager.OnRoadListener
import com.mogo.eagle.core.utilcode.kotlin.*
import com.mogo.eagle.core.utilcode.mogo.logger.*
import com.mogo.map.*
import com.mogo.map.overlay.*
import com.mogo.module.common.utils.*
import io.netty.util.internal.*
import java.util.*
import java.util.concurrent.*
import java.util.concurrent.atomic.*
/**
* Ai云道路施工事件道路颜色标记类
*/
object AiRoadMarker {
private const val TAG = "AiRoadMarker"
private val queue by lazy { LinkedBlockingQueue<Marker>() }
private val pool by lazy { Executors.newFixedThreadPool(2) }
private val marker by lazy { AtomicReference<Marker>() }
private val curStopLine by lazy { AtomicReference<StopLine>() }
private val lastStopLine by lazy { AtomicReference<StopLine>() }
private val carLocation by lazy { AtomicReference<Triple<Double, Double, Double>>() }
private val overlayManager by lazy { MogoOverlayManager.getInstance() }
private val redLine by lazy { AtomicReference<IMogoPolyline>() }
private val redLineColors = arrayListOf(Color.parseColor("#002ABAD9"), Color.parseColor("#FF7A30"))
// private val blueLine by lazy { AtomicReference<IMogoPolyline>() }
//
// private val blueLineColors = arrayListOf(Color.parseColor("#002ABAD9"), Color.parseColor("#30A3FF"))
private val markerCache = ConcurrentSet<Marker>()
private val redLineOptions by lazy {
MogoPolylineOptions().apply {
zIndex(40000f)
setGps(true)
width(30f)
useGradient(true)
colorValues(redLineColors)
}
}
// private val blueLineOptions by lazy {
// MogoPolylineOptions().apply {
// zIndex(30000f)
// setGps(true)
// width(40f)
// useGradient(true)
// colorValues(blueLineColors)
// }
// }
fun init(ctx: Context) {
ctx.lifeCycleOwner.lifecycle.addObserver(object : LifecycleEventObserver {
override fun onStateChanged(source: LifecycleOwner, event: Event) {
if (event == ON_CREATE) {
onCreate()
}
if (event == ON_DESTROY) {
onDestroy()
}
}
})
pool.execute {
var interrupted = false
Logger.d(TAG, "--- consumer --- 0 ---")
while (!interrupted) {
try {
Logger.d(TAG, "--- consumer --- 1 ---")
val top = queue.take() ?: continue
Logger.d(TAG, "--- consumer --- 2 ---")
val location = carLocation.get() ?: continue
val isFrontOfCar = isFrontOfCar(top.poi_lon, top.poi_lat, location.first, location.second, location.third)
val isSameRoad = isSameRoad(top.poi_lon, top.poi_lat, location.first, location.second, location.third)
Logger.d(TAG, "--- consumer --- 3 ---isFrontOfCar: $isFrontOfCar, isSameRoad: $isSameRoad")
if (isFrontOfCar && isSameRoad) {
marker.set(top)
marker(top)
} else {
markerCache.remove(top)
}
interrupted = Thread.currentThread().isInterrupted
} catch (e: InterruptedException) {
e.printStackTrace()
break
}
}
}
}
private fun isSameRoad(x1: Double, y1: Double, x2: Double, y2: Double, angle: Double): Boolean {
val c1 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(x1, y1, angle.toFloat(), 10f)
val c2 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(x2, y2, angle.toFloat(), 10f)
Logger.d(TAG, "isSameRoad--: $c1 ==> $c2")
return c1 != null && c2 != null && c1.road_id.isNotEmpty() && c1.road_id == c2.road_id
}
private val onRoadListener = object : OnRoadListener {
private var roadId = ""
private var hasCrossRoad = false
override fun onRoadIdInfo(roadId: String) {
Logger.d(TAG, "--- onRoadInfo --- roadId: $roadId")
val oldRoadId = this.roadId
if (oldRoadId != roadId) {
if (hasCrossRoad) {
hasCrossRoad = false
lastStopLine.set(curStopLine.get())
}
}
this.roadId = roadId
}
override fun onStopLineInfo(info: StopLine) {
Logger.d(TAG, "--- onStopLineInfo --- info: $info")
curStopLine.set(info)
if (!hasCrossRoad) {
hasCrossRoad = true
}
}
}
private val onLocationListener = object : IMoGoMapLocationListener {
override fun onLocationChanged(location: MogoLocation?, from: Int) {
if (location == null) {
return
}
try {
val loc = CoordinateUtils.transformGcj02toWgs84(location.latitude, location.longitude)
Logger.d(TAG, "x:${loc[0]}, y:${loc[1]}, angle: ${location.bearing}")
carLocation.set(Triple(loc[0], loc[1], location.bearing.toDouble()))
val marker = marker.get() ?: return
val isOutOfRange = isOutOfRange(marker.poi_lon, marker.poi_lat, carLocation.get().first, carLocation.get().second, carLocation.get().third)
Logger.d(TAG, "--- onLocationChanged: isOutOfRange: $isOutOfRange")
if (isOutOfRange) {
unMarker(marker)
}
} catch (t: Throwable) {
Logger.e(TAG, "error: ${t.message}")
}
}
}
//
// private fun drawBlueLine(points: List<Pair<Double, Double>>, location: MogoLocation) {
// val line = blueLine.get()
// blueLineOptions.points(points.filter {
// DrivingDirectionUtils.getDegreeOfCar2Poi2(location.longitude, location.latitude, it.first, it.second, location.bearing.toDouble()) < 90L
// }.map {
// MogoLatLng(it.second, it.first)
// })
// if (line == null || line.isDestroyed) {
// overlayManager.addPolyline(blueLineOptions)
// } else {
// line.setOption(blueLineOptions)
// }
// }
private fun onCreate() {
CallerMapRoadListenerManager.registerRoadListener(TAG, onRoadListener)
CallerMapLocationListenerManager.addListener(TAG, onLocationListener)
}
private fun onDestroy() {
CallerMapRoadListenerManager.unRegisterRoadListener(TAG)
CallerMapLocationListenerManager.removeListener(TAG)
pool.shutdownNow()
}
fun enqueue(marker: Marker) {
Logger.d(TAG, "--- enqueue --- 1 ---")
if (markerCache.contains(marker)) {
Logger.d(TAG, "--- enqueue --- cache hit ---")
return
}
Logger.d(TAG, "--- enqueue --- 2 ---")
markerCache += marker
pool.execute {
Logger.d(TAG, "--- enqueue --- 3 ---${Thread.currentThread().name}::${Thread.currentThread().id}")
queue.put(marker)
}
}
private fun marker(marker: Marker) {
Logger.d(TAG, "--- marker --- 1 ---")
val location = carLocation.get() ?: return
Logger.d(TAG, "--- marker --- 2 ---")
removeRedLine()
//施工中心点前方的自车行驶方向上300米距离
val l1 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(marker.poi_lon, marker.poi_lat, location.third.toFloat(), 300f)
//施工中心点后方的自车行驶方向上300米距离
Logger.d(TAG, "--- marker --- 3 --- l1: $l1")
val l2 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(marker.poi_lon, marker.poi_lat, location.third.toFloat(), -300f)
Logger.d(TAG, "--- marker --- 4 --- l2: $l2")
val points = LinkedList<MogoLatLng>()
if (l2 != null && l2.points.isNotEmpty()) {
points.addAll(l2.points.map {
MogoLatLng(it.second, it.first)
})
}
val centerX= marker.poi_lon
val centerY = marker.poi_lat
Logger.d(TAG, "--- marker --- 5 --- marker: $marker")
val farthestPoint = marker.polygon?.let {
var find: Pair<Double, Double> = Pair(centerX, centerY)
var min = Long.MAX_VALUE
for (p in it) {
val angle = DrivingDirectionUtils.getDegreeOfCar2Poi2(centerX, centerY, p.first, p.second, location.third)
if (angle < min) {
min = angle
find = p
}
}
MogoLatLng(find.second, find.second)
} ?: MogoLatLng(centerY, centerX)
marker.farthestPoint = Pair(farthestPoint.lon, farthestPoint.lat)
Logger.d(TAG, "--- marker --- 6 --- marker: $marker")
if (l1 != null && l1.points.isNotEmpty()) {
for (l in l1.points) {
if (DrivingDirectionUtils.getDegreeOfCar2Poi2(farthestPoint.lon, farthestPoint.lat, l.first, l.second, location.third) < 90L) {
points.add(l.let { MogoLatLng(it.second, it.first) })
}
}
}
var line = redLine.get()
redLineOptions.points(points)
Logger.d(TAG, "--- marker --- 7 --- points: ${points.size}")
if (line == null || line.isDestroyed) {
val l = overlayManager.addPolyline(redLineOptions)
this.redLine.set(l)
line = l
} else {
line.setOption(redLineOptions)
}
if (!line.isVisible) {
line.isVisible = true
}
}
private fun removeRedLine() {
val old = redLine.get()
Logger.d(TAG, "--- removeRedLine --- 1 ---")
if (old != null) {
Logger.d(TAG, "--- removeRedLine --- 2 ---")
redLine.set(null)
old.isVisible = false
old.remove()
}
}
// private fun removeBlueLine() {
// val old = blueLine.get()
// Logger.d(TAG, "--- removeBlueLine --- 1 ---")
// if (old != null) {
// Logger.d(TAG, "--- removeBlueLine --- 2 ---")
// blueLine.set(null)
// old.isVisible = false
// old.remove()
// }
// }
private fun unMarker(marker: Marker) {
markerCache -= marker
removeRedLine()
}
private fun isOutOfRange(markerLon: Double, markerLat: Double, carLon: Double, carLat: Double, carAngle: Double): Boolean {
return !isFrontOfCar(markerLon, markerLat, carLon, carLat, carAngle)
}
private fun isFrontOfCar(markerLon: Double, markerLat: Double, carLon: Double, carLat: Double, carAngle: Double): Boolean {
val degree = DrivingDirectionUtils.getDegreeOfCar2Poi2(carLon, carLat, markerLon, markerLat, carAngle)
return degree < 90
}
data class Marker(
val poi_lat: Double,
val poi_lon: Double,
val polygon: List<Pair<Double, Double>>?,
var farthestPoint: Pair<Double, Double>? = null
) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as Marker
if (poi_lat != other.poi_lat) return false
if (poi_lon != other.poi_lon) return false
return true
}
override fun hashCode(): Int {
var result = poi_lat.hashCode()
result = 31 * result + poi_lon.hashCode()
return result
}
}
}

View File

@@ -91,34 +91,6 @@ public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
t.printStackTrace();
}
}
// if (polygons.size() > 1) {
// if (overlayManager == null) {
// overlayManager = MogoOverlayManager.getInstance();
// }
// MogoPolylineOptions options = new MogoPolylineOptions();
// List<Integer> colors = new ArrayList<>();
// colors.add(Color.argb(204, 237, 172, 21));
// colors.add(Color.argb(0, 255, 255, 255));
// options.colorValues(colors);
// List<MogoLatLng> points = new ArrayList<>();
// for (int i = 0; i < polygons.size(); i++) {
// Pair<Double, Double> p = polygons.get(i);
// points.add(new MogoLatLng(p.second, p.first));
// }
// if (points.size() > 2) {
// points.add(points.get(0));
// }
// options.points(points);
// options.useGradient(true);
// options.useFacade(true);
// options.setGps(false);
// options.width(5f);
// options.zIndex(75000f);
// options.maxIndex(800000f);
// polyline = overlayManager.addPolyline(options);
// polyline.setVisible(true);
// }
}
}
}

View File

@@ -1,5 +1,8 @@
package com.mogo.eagle.core.function.v2x.speedlimit;
import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.BIZ_SLW;
import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.V2I;
import android.location.Location;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
@@ -8,58 +11,64 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.MogoMapUIController;
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
import com.mogo.module.common.MogoApisHandler;
import com.zhjt.service_biz.BizConfig;
import java.util.Timer;
import java.util.TimerTask;
/**
* 限速
*
* @author mogoauto
*/
public class SpeedLimitDataManager implements IMogoCarLocationChangedListener2 {
private static SpeedLimitDataManager instance ;
private static SpeedLimitDataManager instance;
private Location mLocation;
// private static Context mContext;
private Timer mTimer;
private SpeedLimitDataManager(){
private SpeedLimitDataManager() {
}
public static SpeedLimitDataManager getInstance(){
if (instance == null){
synchronized (SpeedLimitDataManager.class){
if (instance == null){
public static SpeedLimitDataManager getInstance() {
if (instance == null) {
synchronized (SpeedLimitDataManager.class) {
if (instance == null) {
instance = new SpeedLimitDataManager();
}
}
}
return instance;
}
private class SpeedTimerTask extends TimerTask{
private class SpeedTimerTask extends TimerTask {
@Override
public void run() {
if (mLocation != null){
if (mLocation != null) {
if (MogoMapUIController.getInstance() != null) {
int speedLimmit = MogoMapUIController.getInstance().getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), mLocation.getBearing());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (speedLimmit > 0) {
CallerHmiManager.INSTANCE.showLimitingVelocity(speedLimmit);
CallLimitingVelocityListenerManager.INSTANCE.invokeOnLimitingVelocityChange(speedLimmit);
}
}
});
getSpeedLimit();
}
}
}
};
public void start(){
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().registerCarLocationChangedListener("SpeedLimitDataManager",this);
mTimer = new Timer();
mTimer.schedule(new SpeedTimerTask(), 3000,1000);
@BizConfig(biz = V2I,dependentBizNode = "",bizNode = BIZ_SLW)
private void getSpeedLimit() {
int speedLimit = MogoMapUIController.getInstance().getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), mLocation.getBearing());
UiThreadHandler.post(() -> {
if (speedLimit > 0) {
CallerHmiManager.INSTANCE.showLimitingVelocity(speedLimit);
CallLimitingVelocityListenerManager.INSTANCE.invokeOnLimitingVelocityChange(speedLimit);
}
});
}
}
public void start() {
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().registerCarLocationChangedListener("SpeedLimitDataManager", this);
Timer mTimer = new Timer();
mTimer.schedule(new SpeedTimerTask(), 3000, 1000);
}
@Override
public void onCarLocationChanged2(Location latLng) {
mLocation = latLng;

View File

@@ -33,11 +33,11 @@ class FuncBizConfig {
// Foundation
const val BIZ_BEAUTY_MODE = "BIZ_BEAUTY_MODE" // 美化模式
const val BIZ_RAIN_MODE = "BIZ_RAIN_MODE" // 雨天模式
const val BIZ_FULL_LOG = "BIZ_FULL_LOG" // 全量日志 todo
const val BIZ_TRACE_LOG = "BIZ_TRACE_LOG" // 链路日志 todo
const val BIZ_FULL_LOG = "BIZ_FULL_LOG" // 全量日志
const val BIZ_TRACE_LOG = "BIZ_TRACE_LOG" // 链路日志 todo 暂未有场景,未实现
const val BIZ_BAG_RECORD = "BIZ_BAG_RECORD" // Bag录制
const val BIZ_WARNING_UPLOAD = "BIZ_WARNING_UPLOAD" // 异常上报
const val BIZ_LIMIT_SPEED_SET = "BIZ_LIMIT_SPEED_SET" // 限速设置 todo
const val BIZ_LIMIT_SPEED_SET = "BIZ_LIMIT_SPEED_SET" // 限速设置 todo 暂未有场景,未实现
const val BIZ_BYPASS = "BIZ_BYPASS" // 绕障 todo 暂未实现
const val BIZ_AUTOPILOT_LANE_SELECTION = "BIZ_AUTOPILOT_LANE_SELECTION" // 择机变道 todo 暂未实现

View File

@@ -4,6 +4,7 @@ import android.os.SystemClock
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_EAGLE_START_AUTOPILOT
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_ADAS
@@ -14,6 +15,7 @@ import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.zhjt.service.chain.ChainLog
import com.zhjt.service.chain.TracingConstants
import com.zhjt.service_biz.BizConfig
import kotlin.random.Random
/**
@@ -98,12 +100,14 @@ object CallerAutoPilotManager {
/**
* 开启域控制器录制bag包
*/
@BizConfig(FuncBizConfig.FOUNDATION,"", FuncBizConfig.BIZ_BAG_RECORD)
fun recordPackage() {
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
providerApi?.recordPackage(1, Random(SystemClock.elapsedRealtime()).nextInt())
}
}
@BizConfig(FuncBizConfig.FOUNDATION,"", FuncBizConfig.BIZ_BAG_RECORD)
fun recordPackage(duration: Int) {
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
providerApi?.recordPackage(1, Random(SystemClock.elapsedRealtime()).nextInt(), duration)

View File

@@ -1,6 +1,5 @@
package com.mogo.eagle.core.function.call.devatools
import android.util.Log
import androidx.annotation.Nullable
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListener
import com.zhjt.service_biz.SubBiz

View File

@@ -59,8 +59,8 @@ bytex.ASM_API=ASM7
HOOK_LOG_VERSION=1.6.1
SERVICE_CHAIN_VERSION=1.1.0
BIZCONFIG_VERSION=1.2.7
SERVICE_BIZ_VERSION=1.2.0
BIZCONFIG_VERSION=1.2.8
SERVICE_BIZ_VERSION=1.2.1
################ 外部依赖引用 ################
# loglib
LOGLIB_VERSION=1.3.38
@@ -85,7 +85,7 @@ MOGO_LOCATION_VERSION=1.4.3.26
MOGO_TELEMATIC_VERSION=1.4.3.26
######## MogoAiCloudSDK Version ########
# 自研地图
MAP_SDK_VERSION=2.4.2.3
MAP_SDK_VERSION=2.5.1.9
MAP_SDK_OPERATION_VERSION=1.1.2.4
# websocket
WEBSOCKET_VERSION=1.1.7

View File

@@ -1,5 +1,6 @@
package com.mogo.map;
import com.mogo.map.center.CenterLine;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.map.overlay.IMogoPolyline;
@@ -170,8 +171,18 @@ public interface IMogoMap {
IMogoPolyline addPolyline( MogoPolylineOptions options );
/**
* 获取地图版本
* 获取地图版本
* @return
*/
String getMapVersion();
/**
* 获取行驶方向一定长度的中心线
* @param lon 经度
* @param lat 纬度
* @param angle 航向角
* @param distance 获取车道中心线的长度,> 0: 行驶方向前方距离, <0 行驶方向后方距离
* @return 中心线相关数据
*/
CenterLine getCenterLineRangeInfo(double lon, double lat, float angle, float distance);
}

View File

@@ -0,0 +1,13 @@
package com.mogo.map.center
import android.util.Pair
data class CenterLine(
var id: String = "", //id
var tile_id: String = "", //瓦片id
var road_id: String = "", //道路id
var lane_id: String = "", //车道id
var points: List<Pair<Double, Double>> = emptyList(),
var angle: Double = 0.0
)

View File

@@ -677,7 +677,6 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void changeMapViewAngle(int type) {
Log.d("XXXX", "--- 1 -----");
if (checkAMapView()) {
//mMapView.getMapAutoViewHelper().testMapViewAngle(type);
}

View File

@@ -3,9 +3,12 @@ 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;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.map.center.CenterLine;
import com.mogo.map.marker.AMapInfoWindowAdapter;
import com.mogo.map.marker.AMapMarkerWrapper;
import com.mogo.map.marker.IMogoMarker;
@@ -33,6 +36,7 @@ import com.zhidaoauto.map.sdk.open.view.MapAutoView;
import com.zhidaoauto.map.sdk.open.view.MapAutoViewHelper;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -112,6 +116,7 @@ public class AMapWrapper implements IMogoMap {
optionsArrayList.forEach((s, trackedObject) -> {
MarkerSimpleData markerOptions = ObjectUtils.fromTrafficData(trackedObject);
if (markerOptions != null) {
Log.i("EmArrow0926","markerOpt : " + markerOptions.toString());
markerOptionsArrayList.add(markerOptions);
}
});
@@ -319,6 +324,27 @@ public class AMapWrapper implements IMogoMap {
return singlePointRoadInfo != null ? singlePointRoadInfo.getLaneWidth() : 0;
}
@Override
public CenterLine getCenterLineRangeInfo(double lon, double lat, float angle, float distance) {
com.zhidaoauto.map.sdk.open.road.CenterLine info = MapDataApi.INSTANCE.getCenterLineRangeInfo(lon, lat, angle, distance);
CenterLine ret = null;
if (info != null) {
ret = new CenterLine(info.id, info.tile_id, info.road_id, info.lane_id, convert(info.points), info.angle == null ? 0f : info.angle);
}
return ret;
}
private List<Pair<Double, Double>> convert(List<LonLatPoint> points) {
if (points == null || points.isEmpty()) {
return Collections.emptyList();
}
List<Pair<Double, Double>> ret = new ArrayList<>(points.size());
for (LonLatPoint p : points) {
ret.add(Pair.create(p.longitude, p.latitude));
}
return ret;
}
private Context getContext() {
return mMapView.getContext();
}

View File

@@ -54,7 +54,6 @@ public class CustomMapApiBuilder implements IMogoMapApiBuilder {
@Override
public IMogoMapView getMapView(Context context) {
Log.d(TAG, "setDebugMode==true");
MapParams mapParams = MapParams.Companion.init();
mapParams.setDebugMode(false)
//todo 1-使用本地地图数据0-使用在线地图数据

View File

@@ -132,6 +132,8 @@ public class ObjectUtils {
markerOptions.setLon(trafficData.getLongitude());
if(trafficData.getColor()!=null && !trafficData.getColor().isEmpty()){
markerOptions.setColor(trafficData.getColor());
}else{
markerOptions.setColor("#00000000");
}
} catch (Exception e) {
e.printStackTrace();

View File

@@ -26,7 +26,7 @@ public class DrivingDirectionUtils {
return Math.sqrt(Math.pow(x1 - x2, 2.0) + Math.pow(y1 - y2, 2.0));
}
private static double getAngle(double sx, double sy, double x1, double y1, double x2, double y2) {
public static double getAngle(double sx, double sy, double x1, double y1, double x2, double y2) {
x1 = x1 - sx;
y1 = y1 - sy;
x2 = x2 - sx;