Merge branch 'dev_arch_opt_3.0' into dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0
This commit is contained in:
@@ -10,6 +10,10 @@ import com.mogo.eagle.function.biz.dispatch.DispatchAutoPilotManager.Companion.d
|
||||
import com.mogo.eagle.function.biz.monitoring.CronTaskManager.Companion.cronTaskManager
|
||||
import com.mogo.eagle.function.biz.notice.NoticeSocketManager.Companion.noticeSocketManager
|
||||
import com.mogo.eagle.function.biz.notice.network.NoticeNetWorkManager
|
||||
import com.mogo.eagle.function.biz.v2x.speedlimit.SpeedLimitDataManager
|
||||
import com.mogo.eagle.function.biz.v2x.trafficlight.core.MogoTrafficLightManager
|
||||
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightDispatcher
|
||||
import com.mogo.eagle.function.biz.v2x.vip.VipCarManager
|
||||
|
||||
@Route(path = MogoServicePaths.PATH_FUNC_BIZ)
|
||||
class FuncBizProvider : IMoGoFuncBizProvider {
|
||||
@@ -21,6 +25,12 @@ class FuncBizProvider : IMoGoFuncBizProvider {
|
||||
noticeSocketManager.init(context)
|
||||
dispatchAutoPilotManager.init(context)
|
||||
cronTaskManager.startCronTask()
|
||||
|
||||
MogoTrafficLightManager.INSTANCE.initServer(context)
|
||||
TrafficLightDispatcher.INSTANCE.initServer(context) //todo 红绿灯中心模块放入dataCenter
|
||||
VipCarManager.INSTANCE.initServer(context)
|
||||
SpeedLimitDataManager.getInstance().start()
|
||||
// RedLightWarningManager.INSTANCE.listenTrafficLight()
|
||||
}
|
||||
|
||||
override fun feedBackNoticeTraffic(infoId: String, sn: String, accept: Int) {
|
||||
@@ -62,5 +72,9 @@ class FuncBizProvider : IMoGoFuncBizProvider {
|
||||
noticeSocketManager.release()
|
||||
dispatchAutoPilotManager.release()
|
||||
cronTaskManager.release()
|
||||
|
||||
VipCarManager.INSTANCE.destroy()
|
||||
TrafficLightDispatcher.INSTANCE.destroy()
|
||||
// RedLightWarningManager.INSTANCE.onDestroy()
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ class DispatchServiceModel private constructor() {
|
||||
}
|
||||
|
||||
private var mAdasApiService: IDispatchAdasApiService =
|
||||
MoGoRetrofitFactory.getInstance(HostConst.DATA_SERVICE_HOST).create(
|
||||
MoGoRetrofitFactory.getInstance(HostConst.getEagleHost()).create(
|
||||
IDispatchAdasApiService::class.java
|
||||
)
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ interface IDispatchAdasApiService {
|
||||
* @return [BaseData]
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/dataService/autoDriver/receiveCarPreSetPath")
|
||||
@POST("eagle-eye-dns/eagle-eye-dns/dataService/autoDriver/receiveCarPreSetPath")
|
||||
fun uploadAutopilotRoute(@FieldMap parameters: Map<String, Any>): Observable<BaseData>
|
||||
|
||||
/**
|
||||
@@ -24,7 +24,7 @@ interface IDispatchAdasApiService {
|
||||
* @return [BaseData]
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/dataService/autoDriver/receiverDestSiteResult")
|
||||
@POST("eagle-eye-dns/dataService/autoDriver/receiverDestSiteResult")
|
||||
fun uploadDispatchResult(@FieldMap parameters: MutableMap<String, Any>): Observable<BaseData>
|
||||
|
||||
/**
|
||||
@@ -34,6 +34,6 @@ interface IDispatchAdasApiService {
|
||||
* @return [BaseData]
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/dataService/autoDriver/receiveAutopilotState")
|
||||
@POST("eagle-eye-dns/dataService/autoDriver/receiveAutopilotState")
|
||||
fun uploadAutopilotState(@FieldMap parameters: MutableMap<String, Any>): Observable<BaseData>
|
||||
}
|
||||
@@ -7,12 +7,12 @@ import com.mogo.commons.constants.HostConst
|
||||
import com.mogo.commons.utils.RetryWithDelay
|
||||
import com.mogo.eagle.core.data.camera.CameraEntity
|
||||
import com.mogo.eagle.core.data.camera.ReqLiveCarBean
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
||||
import com.mogo.eagle.function.biz.monitoring.net.ICameraListServices
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MONITOR
|
||||
import com.mogo.eagle.function.biz.monitoring.net.ICameraListServices
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
@@ -90,8 +90,8 @@ class CronTaskManager {
|
||||
* 请求路口一定范围内的设备信息(包含:摄像头、灯)
|
||||
*/
|
||||
private fun requestDeviceList() {
|
||||
CallerMapLocationListenerManager.getCurrentLocation()?.let { location ->
|
||||
disposable = MoGoRetrofitFactory.getInstance(HostConst.CITY_HOST)
|
||||
CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()?.let { location ->
|
||||
disposable = MoGoRetrofitFactory.getInstance(HostConst.getEagleHost())
|
||||
.create(ICameraListServices::class.java)
|
||||
.getDeviceList(location.longitude, location.latitude, 500)
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -124,8 +124,8 @@ class CronTaskManager {
|
||||
}
|
||||
|
||||
private fun requestCarCameraList() {
|
||||
CallerMapLocationListenerManager.getCurrentLocation()?.let { location ->
|
||||
carDisposable = MoGoRetrofitFactory.getInstance(HostConst.CITY_HOST)
|
||||
CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()?.let { location ->
|
||||
carDisposable = MoGoRetrofitFactory.getInstance(HostConst.getEagleHost())
|
||||
.create(ICameraListServices::class.java)
|
||||
.getCarCameraList(ReqLiveCarBean(location.longitude, location.latitude))
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -193,7 +193,7 @@ class CronTaskManager {
|
||||
streamDisposable?.let {
|
||||
if (!it.isDisposed) it.dispose()
|
||||
}
|
||||
streamDisposable = MoGoRetrofitFactory.getInstance(HostConst.CITY_HOST)
|
||||
streamDisposable = MoGoRetrofitFactory.getInstance(HostConst.getEagleHost())
|
||||
.create(ICameraListServices::class.java)
|
||||
.reqOpenCameraStream(cameraIp)
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -222,7 +222,7 @@ class CronTaskManager {
|
||||
streamDisposable2?.let {
|
||||
if (!it.isDisposed) it.dispose()
|
||||
}
|
||||
streamDisposable2 = MoGoRetrofitFactory.getInstance(HostConst.CITY_HOST)
|
||||
streamDisposable2 = MoGoRetrofitFactory.getInstance(HostConst.getEagleHost())
|
||||
.create(ICameraListServices::class.java)
|
||||
.reqOpenCameraStreamWithRetry(cameraIp)
|
||||
.flatMap {
|
||||
|
||||
@@ -9,21 +9,21 @@ interface ICameraListServices {
|
||||
@GET("/yycp-smartTransportationAiCloud-service/eagle/device/list")
|
||||
fun getCameraList(@Query("roadId") roadId: String?): Single<CameraListInfo?>
|
||||
|
||||
@POST("/yycp-launcherSnapshot/car/queryLiveCarByLocal")
|
||||
@POST("eagle-eye-dns/yycp-launcherSnapshot/car/queryLiveCarByLocal")
|
||||
fun getCarCameraList(@Body reqBody: ReqLiveCarBean): Single<LiveCarCameraInfo?>
|
||||
|
||||
@GET("/openStream/{cameraIp}")
|
||||
fun openCameraStream(@Path("cameraIp") cameraIp: String): Single<CameraStreamEntity>
|
||||
|
||||
@GET("/camera-stream/stream/camera/openStream")
|
||||
@GET("eagle-eye-dns/camera-stream/stream/camera/openStream")
|
||||
fun reqOpenCameraStream(@Query("ip") cameraIp: String): Single<OpenCameraStreamEntity>
|
||||
|
||||
@GET("/mec-etl-server/crossing/geo/device")
|
||||
@GET("eagle-eye-dns/mec-etl-server/crossing/geo/device")
|
||||
fun getDeviceList(
|
||||
@Query("lon") lon: Double, @Query("lat") lat: Double,
|
||||
@Query("radiusMeter") radiusMeter: Int
|
||||
): Single<CameraListInfo?>
|
||||
|
||||
@GET("/camera-stream/stream/camera/openStream")
|
||||
@GET("eagle-eye-dns/camera-stream/stream/camera/openStream")
|
||||
fun reqOpenCameraStreamWithRetry(@Query("ip") cameraIp: String): Observable<OpenCameraStreamEntity>
|
||||
}
|
||||
@@ -27,7 +27,7 @@ public interface INoticeApiService {
|
||||
* @return {@link NoticeTrafficStyleInfo}
|
||||
*/
|
||||
@Headers("Content-Type:application/json;charset=UTF-8")
|
||||
@POST("/deva/accidentInfoManage/queryMyAccidentHandleInfo/server/v1")
|
||||
@POST("eagle-eye-dns/deva/accidentInfoManage/queryMyAccidentHandleInfo/server/v1")
|
||||
Observable<NoticeTrafficStyleInfo> getAccidentInfo(@Body RequestBody requestBody);
|
||||
|
||||
/**
|
||||
@@ -36,7 +36,7 @@ public interface INoticeApiService {
|
||||
* @param accidentParameters 请求数据(infoID事故ID;sn;status接受状态 0否 1是)
|
||||
* @return {@link BaseData}
|
||||
*/
|
||||
@GET("/deva/accidentInfoManage/policeUpdateTroubleStatus")
|
||||
@GET("eagle-eye-dns/deva/accidentInfoManage/policeUpdateTroubleStatus")
|
||||
Observable<BaseData> sendAcceptStatus(@QueryMap Map<String, String> accidentParameters);
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.util.ArrayMap;
|
||||
import com.mogo.cloud.network.NetConstants;
|
||||
import com.mogo.cloud.network.RetrofitFactory;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient;
|
||||
import com.mogo.commons.constants.HostConst;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalDetail;
|
||||
import com.mogo.eagle.core.data.notice.NoticeRequest;
|
||||
@@ -34,7 +35,7 @@ public class NoticeNetWorkManager {
|
||||
private final INoticeApiService mNoticeApiService;
|
||||
|
||||
private NoticeNetWorkManager() {
|
||||
mNoticeApiService = RetrofitFactory.INSTANCE.getInstance(NetConstants.DEVA_HOST)
|
||||
mNoticeApiService = RetrofitFactory.INSTANCE.getInstance(HostConst.getEagleHost())
|
||||
.create(INoticeApiService.class);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.v2x.redlightwarning
|
||||
package com.mogo.eagle.function.biz.v2x.redlightwarning
|
||||
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_IVP
|
||||
@@ -16,16 +16,15 @@ import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.api.vip.IMoGoVipSetListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.MogoTrafficLightManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||
import com.mogo.eagle.core.utilcode.util.LocationUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.function.biz.v2x.trafficlight.core.MogoTrafficLightManager
|
||||
import com.zhjt.service_biz.BizConfig
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import kotlin.math.abs
|
||||
@@ -275,7 +274,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
fun onDestroy() {
|
||||
CallVipSetListenerManager.removeListener(TAG)
|
||||
CallerTrafficLightListenerManager.removeListener(TAG)
|
||||
CallerMapLocationListenerManager.removeListener(TAG, false)
|
||||
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) {
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.v2x.speedlimit;
|
||||
package com.mogo.eagle.function.biz.v2x.speedlimit;
|
||||
|
||||
import static com.mogo.eagle.core.data.config.HmiBuildConfig.isShowObuLimitSpeedView;
|
||||
import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.BIZ_SLW;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.v2x.trafficlight
|
||||
package com.mogo.eagle.function.biz.v2x.trafficlight
|
||||
|
||||
class TrafficLightConst {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.v2x.trafficlight
|
||||
package com.mogo.eagle.function.biz.v2x.trafficlight
|
||||
|
||||
import com.mogo.eagle.core.data.trafficlight.*
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.v2x.trafficlight.core
|
||||
package com.mogo.eagle.function.biz.v2x.trafficlight.core
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
@@ -8,12 +8,12 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Liste
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||
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.eagle.function.biz.v2x.trafficlight.TrafficLightHMIManager
|
||||
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_LOOP_SEARCH_CROSS_ROAD
|
||||
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_LOOP_SEARCH_TRAFFIC_LIGHT
|
||||
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.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||
import mogo.telematics.pad.MessagePad
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.v2x.trafficlight.core
|
||||
package com.mogo.eagle.function.biz.v2x.trafficlight.core
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
@@ -8,7 +8,7 @@ import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.TrafficLightHMIManager
|
||||
import com.mogo.eagle.function.biz.v2x.trafficlight.TrafficLightHMIManager
|
||||
import perception.TrafficLightOuterClass
|
||||
import perception.TrafficLightOuterClass.TrafficLight
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.v2x.trafficlight.core
|
||||
package com.mogo.eagle.function.biz.v2x.trafficlight.core
|
||||
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.v2x.trafficlight.network
|
||||
package com.mogo.eagle.function.biz.v2x.trafficlight.network
|
||||
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.eagle.core.data.trafficlight.RoadIDResult
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.v2x.trafficlight.network
|
||||
package com.mogo.eagle.function.biz.v2x.trafficlight.network
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.v2x.vip
|
||||
package com.mogo.eagle.function.biz.v2x.vip
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
@@ -21,17 +21,17 @@ import com.mogo.eagle.core.data.trafficlight.isRed
|
||||
import com.mogo.eagle.core.data.v2x.VipMessage
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.MogoTrafficLightManager
|
||||
import com.mogo.eagle.core.function.v2x.vip.network.VipNetWorkModel
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.eagle.function.biz.v2x.trafficlight.core.MogoTrafficLightManager
|
||||
import com.mogo.eagle.function.biz.v2x.vip.network.VipNetWorkModel
|
||||
import com.zhjt.service_biz.BizConfig
|
||||
|
||||
class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListener,
|
||||
@@ -156,7 +156,6 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
MSG_WHAT_VIP_CANCEL,
|
||||
cancelDelayTime - System.currentTimeMillis()
|
||||
)
|
||||
CallerHmiManager.vipIdentification(true)
|
||||
CallVipSetListenerManager.invokeVipSetStatus(true)
|
||||
CallerTrafficLightListenerManager.addListener(TAG, this)
|
||||
}
|
||||
@@ -167,7 +166,6 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
handler.removeMessages(MSG_WHAT_VIP_CANCEL)
|
||||
}
|
||||
resetConditions()
|
||||
CallerHmiManager.vipIdentification(false)
|
||||
CallVipSetListenerManager.invokeVipSetStatus(false)
|
||||
CallerTrafficLightListenerManager.removeListener(TAG)
|
||||
}
|
||||
@@ -197,9 +195,9 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
|
||||
fun turnLight(controlTime: Int) {
|
||||
if (result == null || mContext == null) return
|
||||
val mogoLocation = CallerMapLocationListenerManager.getCurrentLocation()
|
||||
val mogoLocation = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
if (mogoLocation != null) {
|
||||
val bearing = mogoLocation.bearing.toDouble()
|
||||
val bearing = mogoLocation.heading
|
||||
CallerLogger.d("$M_V2X$TAG", "-- turnLight -- ")
|
||||
MogoTrafficLightManager.INSTANCE.turnLightToGreen(
|
||||
result!!.lightId, result!!.crossId, bearing, controlTime,
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.v2x.vip.network
|
||||
package com.mogo.eagle.function.biz.v2x.vip.network
|
||||
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.eagle.core.data.v2x.VipRequest
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.v2x.vip.network
|
||||
package com.mogo.eagle.function.biz.v2x.vip.network
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
@@ -15,7 +15,7 @@ import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_DEFAULT
|
||||
import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_VEHICLE_TEAM
|
||||
import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_VOICE
|
||||
import com.mogo.eagle.core.function.api.chat.biz.IMType.*
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.chat.facade.analytics.ChatAnalyticsFacade
|
||||
import com.mogo.eagle.core.function.chat.facade.audio.AudioFocusFacade
|
||||
import com.mogo.eagle.core.function.chat.facade.bridge.BridgeApi
|
||||
@@ -581,7 +581,7 @@ object MoGoChatFacade: IMoGoChatFacade {
|
||||
}
|
||||
//告之服务器给发送方下发接收通话消息
|
||||
try {
|
||||
val location = CallerMapLocationListenerManager.getCurrentLocation()
|
||||
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||
val response = serverApi.requestConnectStatus(ConnectStatusParam(MoGoAiCloudClientConfig.getInstance().sn, sn, roomId, PUSH_MSG_AGREE_ENTER, CALL_TYPE_VOICE.type).also {
|
||||
it.nickName = mySelf.get().name
|
||||
it.headImgUrl = mySelf.get().icon
|
||||
@@ -812,7 +812,7 @@ object MoGoChatFacade: IMoGoChatFacade {
|
||||
}
|
||||
val response = serverApi.inviteJoinVehicleTeam(CallRequestParam().also {
|
||||
val user = mySelf.get()
|
||||
val location = CallerMapLocationListenerManager.getCurrentLocation()
|
||||
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||
it.snSender = mySn
|
||||
it.snReceiver = sn
|
||||
it.nickName = user.name
|
||||
@@ -958,7 +958,7 @@ object MoGoChatFacade: IMoGoChatFacade {
|
||||
}
|
||||
//告之服务器给发送方下发接收通话消息
|
||||
try {
|
||||
val location = CallerMapLocationListenerManager.getCurrentLocation()
|
||||
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||
val response = serverApi.requestConnectStatus(ConnectStatusParam(MoGoAiCloudClientConfig.getInstance().sn, sn, roomId, PUSH_MSG_AGREE_ENTER, CALL_TYPE_VEHICLE_TEAM.type).also {
|
||||
it.nickName = mySelf.get().name
|
||||
it.headImgUrl = mySelf.get().icon
|
||||
|
||||
@@ -3,13 +3,12 @@ package com.mogo.eagle.core.function.chat.facade.net
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.JsonObject
|
||||
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.chat.UserInfo
|
||||
import com.mogo.eagle.core.function.api.chat.biz.ChatConsts
|
||||
import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_VOICE
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
||||
import com.mogo.eagle.core.function.chat.facade.consts.ChatHttp
|
||||
import com.mogo.eagle.core.function.chat.facade.consts.ChatHttp.Companion.getConfig
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.chat.facade.net.bean.*
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
@@ -33,7 +32,7 @@ internal class ChatServiceModel {
|
||||
val sns = arrayListOf(sn)
|
||||
val requestData = SnArrayRequestBody().also { it.sns = sns }
|
||||
return apiCall {
|
||||
getNetWorkApi(getConfig())?.queryUserInfoBySnS(requestData)
|
||||
getNetWorkApi()?.queryUserInfoBySnS(requestData)
|
||||
?: throw IllegalStateException("apis is null.")
|
||||
}.let { itx ->
|
||||
if (itx.code != 0 && itx.code != 200) {
|
||||
@@ -70,7 +69,7 @@ internal class ChatServiceModel {
|
||||
val map = hashMapOf<String, String>()
|
||||
val sn = MoGoAiCloudClientConfig.getInstance().sn
|
||||
|
||||
val location = CallerMapLocationListenerManager.getCurrentLocation()
|
||||
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||
if (location != null) {
|
||||
params.lon = location.longitude
|
||||
params.lat = location.latitude
|
||||
@@ -104,7 +103,7 @@ internal class ChatServiceModel {
|
||||
|
||||
suspend fun requestRoomInfo(param: CallRequestParam): BaseResponse<RoomInfo> {
|
||||
val map = hashMapOf<String, String>()
|
||||
val location = CallerMapLocationListenerManager.getCurrentLocation()
|
||||
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||
if (location != null) {
|
||||
param.lat = location.latitude
|
||||
param.lon = location.longitude
|
||||
@@ -120,7 +119,7 @@ internal class ChatServiceModel {
|
||||
return call.invoke()
|
||||
}
|
||||
|
||||
private fun getNetWorkApi(baseUrl: String = ChatHttp.getBaseUrl()): HttpApi? {
|
||||
private fun getNetWorkApi(baseUrl: String = HostConst.getEagleHost()): HttpApi? {
|
||||
return MoGoRetrofitFactory.getInstanceNoCallAdapter(baseUrl).create(HttpApi::class.java)
|
||||
}
|
||||
}
|
||||
@@ -128,7 +127,7 @@ internal class ChatServiceModel {
|
||||
internal interface HttpApi {
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST("/yycp-chat-service/car/voiceRoom/no/operate/v1")
|
||||
@POST("eagle-eye-dns/yycp-chat-service/car/voiceRoom/no/operate/v1")
|
||||
suspend fun requestConnectStatus(
|
||||
@Query("sn") sn: String,
|
||||
@FieldMap connectStatus: Map<String, String>
|
||||
@@ -136,24 +135,24 @@ internal interface HttpApi {
|
||||
|
||||
//邀请加入车队
|
||||
@FormUrlEncoded
|
||||
@POST("/yycp-chat-service/car/chat/no/inviteJoinTeam/v1")
|
||||
@POST("eagle-eye-dns/yycp-chat-service/car/chat/no/inviteJoinTeam/v1")
|
||||
suspend fun inviteJoinVehicleTeam(@FieldMap inviteVehicleTeam: Map<String, String>): BaseResponse<Any>
|
||||
|
||||
//车队状态同步
|
||||
@FormUrlEncoded
|
||||
@POST("/yycp-chat-service/car/chat/no/operateTeamRoom/v1")
|
||||
@POST("eagle-eye-dns/yycp-chat-service/car/chat/no/operateTeamRoom/v1")
|
||||
suspend fun requestVehicleTeamConnectStatus(@FieldMap connectStatus: Map<String, String>): BaseResponse<Any>
|
||||
|
||||
//查询用户是否在线
|
||||
@FormUrlEncoded
|
||||
@POST("/yycp-chat-service/car/queryOnLineBySn/v1")
|
||||
@POST("eagle-eye-dns/yycp-chat-service/car/queryOnLineBySn/v1")
|
||||
suspend fun isOnLine(@FieldMap onLine: Map<String, String>): BaseResponse<OnLineStatus>
|
||||
|
||||
@POST("/yycp-realtimeLocations/realTimeLocationServer/queryRsAncCarAndUserInfoBySns")
|
||||
@POST("eagle-eye-dns/yycp-realtimeLocations/realTimeLocationServer/queryRsAncCarAndUserInfoBySns")
|
||||
suspend fun queryUserInfoBySnS(@Body body: SnArrayRequestBody): BaseResponse<JsonObject>
|
||||
|
||||
//语音房间信息,原路径dataService
|
||||
@FormUrlEncoded
|
||||
@POST("/yycp-chat-service/car/sender/no/createRoom/v1")
|
||||
@POST("eagle-eye-dns/yycp-chat-service/car/sender/no/createRoom/v1")
|
||||
suspend fun requestRoomInfo(@FieldMap roomInfo: Map<String, String>): BaseResponse<RoomInfo>
|
||||
}
|
||||
@@ -64,6 +64,7 @@ import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD
|
||||
import function_state_management.FunctionStates
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
import mogo.v2x.ObuWarningEvent
|
||||
import mogo_msg.MogoReportMsg
|
||||
import perception.TrafficLightOuterClass
|
||||
import planning.RoboSweeperTaskIndexOuterClass
|
||||
@@ -525,6 +526,15 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* OBU预警事件
|
||||
*
|
||||
* @param header 头
|
||||
* @param obuWarningData 数据
|
||||
*/
|
||||
override fun onObuWarningData(header: MessagePad.Header?, obuWarningData: ObuWarningEvent.ObuWarningData?) {
|
||||
|
||||
}
|
||||
/**
|
||||
* 重构后的功能状态
|
||||
*
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.consts
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
|
||||
internal object BadCaseHost {
|
||||
|
||||
private const val HOST_DEV = "http://dzt-test.zhidaozhixing.com/"
|
||||
private const val HOST_RELEASE = "http://dzt.zhidaozhixing.com/"
|
||||
|
||||
fun getHost(): String{
|
||||
return when (DebugConfig.getNetMode()) {
|
||||
DebugConfig.NET_MODE_DEV -> HOST_DEV
|
||||
DebugConfig.NET_MODE_QA -> HOST_DEV
|
||||
DebugConfig.NET_MODE_DEMO -> HOST_RELEASE
|
||||
DebugConfig.NET_MODE_RELEASE -> HOST_RELEASE
|
||||
else -> HOST_RELEASE
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.repository.net
|
||||
|
||||
import com.mogo.commons.constants.HostConst
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseManager
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.BadCaseApi
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.entity.UploadResult
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseHost
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.entity.BadCaseResponse.Reason
|
||||
import kotlinx.coroutines.withContext
|
||||
import kotlin.coroutines.coroutineContext
|
||||
@@ -16,7 +16,7 @@ internal class BadCaseNetModel {
|
||||
suspend fun get(channel: String?, result: MutableList<Reason>, pageNo: Int) {
|
||||
try {
|
||||
MoGoRetrofitFactory
|
||||
.getInstance(BadCaseHost.getHost())
|
||||
.getInstance(HostConst.getEagleHost())
|
||||
.create(BadCaseApi::class.java)
|
||||
.get(channel ?: "", pageNo)
|
||||
.takeIf {
|
||||
@@ -42,7 +42,7 @@ internal class BadCaseNetModel {
|
||||
suspend fun upload(map: Map<String, String>): UploadResult? = try {
|
||||
CallerLogger.d("$M_DEVA${BadCaseManager.TAG}", "upload_params:$map")
|
||||
MoGoRetrofitFactory
|
||||
.getInstance(BadCaseHost.getHost())
|
||||
.getInstance(HostConst.getEagleHost() )
|
||||
.create(BadCaseApi::class.java)
|
||||
.post(map)
|
||||
.takeIf {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,8 +8,8 @@ import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.module.status.StatusDescriptor
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
|
||||
|
||||
/**
|
||||
@@ -18,8 +18,24 @@ import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
*/
|
||||
class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||
|
||||
companion object{
|
||||
private const val TAG = "BindingCarDialog"
|
||||
companion object {
|
||||
private const val TAG = "ModifyBindingCarDialog"
|
||||
|
||||
private var modifyBindingCarDialog: ModifyBindingCarDialog? = null
|
||||
|
||||
fun show(context: Context?) {
|
||||
context?.let {
|
||||
if (modifyBindingCarDialog == null) {
|
||||
modifyBindingCarDialog = ModifyBindingCarDialog(it)
|
||||
}
|
||||
modifyBindingCarDialog?.let { dialog ->
|
||||
if (dialog.isShowing) {
|
||||
return
|
||||
}
|
||||
dialog.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var confirmTv: TextView? = null
|
||||
@@ -58,7 +74,7 @@ class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifec
|
||||
* 修改绑定车机
|
||||
*/
|
||||
private fun modifyBindingCar() {
|
||||
CallerDevaToolsManager.modifyCarInfo{
|
||||
CallerDevaToolsManager.modifyCarInfo {
|
||||
if (it.code == 200) {
|
||||
TipToast.shortTip("修改绑定成功")
|
||||
} else {
|
||||
@@ -70,6 +86,7 @@ class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifec
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
modifyBindingCarDialog = null
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(
|
||||
TAG,
|
||||
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||
@@ -77,12 +94,4 @@ class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifec
|
||||
)
|
||||
}
|
||||
|
||||
fun showModifyBindingCarDialog() {
|
||||
if (isShowing) {
|
||||
return
|
||||
}
|
||||
show()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -8,28 +8,45 @@ import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.module.status.StatusDescriptor
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
|
||||
|
||||
/**
|
||||
* @brief 绑定车辆对话框
|
||||
* @author lixiaopeng
|
||||
*/
|
||||
class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver{
|
||||
class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||
|
||||
companion object{
|
||||
companion object {
|
||||
private const val TAG = "ToBindingCarDialog"
|
||||
|
||||
private var toBindingCarDialog: ToBindingCarDialog? = null
|
||||
|
||||
fun show(context: Context?) {
|
||||
context?.let {
|
||||
if (toBindingCarDialog == null) {
|
||||
toBindingCarDialog = ToBindingCarDialog(it)
|
||||
}
|
||||
toBindingCarDialog?.let { dialog ->
|
||||
if (dialog.isShowing) {
|
||||
return
|
||||
}
|
||||
dialog.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var confirmTv: TextView? = null
|
||||
private var cancelTv: TextView? = null
|
||||
|
||||
private val statusChangedListenerForCheckNotice = IMogoStatusChangedListener { descriptor, isTrue ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||
dismiss()
|
||||
private val statusChangedListenerForCheckNotice =
|
||||
IMogoStatusChangedListener { descriptor, isTrue ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
setContentView(R.layout.dialog_to_bindingcar)
|
||||
@@ -57,7 +74,7 @@ class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifecycle
|
||||
* 修改绑定车机
|
||||
*/
|
||||
private fun toBindingCar() {
|
||||
CallerDevaToolsManager.modifyCarInfo{
|
||||
CallerDevaToolsManager.modifyCarInfo {
|
||||
if (it.code == 200) {
|
||||
TipToast.shortTip("绑定成功")
|
||||
} else {
|
||||
@@ -69,6 +86,7 @@ class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifecycle
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
toBindingCarDialog = null
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(
|
||||
TAG,
|
||||
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||
@@ -76,12 +94,4 @@ class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifecycle
|
||||
)
|
||||
}
|
||||
|
||||
fun showToBindingCarDialog() {
|
||||
if (isShowing) {
|
||||
return
|
||||
}
|
||||
show()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -15,15 +15,40 @@ import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
*/
|
||||
class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||
|
||||
private val TAG = "UpgradeAppDialog"
|
||||
companion object{
|
||||
private const val TAG = "UpgradeAppDialog"
|
||||
|
||||
private var upgradeAppDialog: UpgradeAppDialog? = null
|
||||
|
||||
fun show(context: Context?,
|
||||
name: String,
|
||||
url: String,
|
||||
title: String,
|
||||
content: String,
|
||||
installType: String) {
|
||||
context?.let {
|
||||
if (upgradeAppDialog == null) {
|
||||
upgradeAppDialog = UpgradeAppDialog(it)
|
||||
}
|
||||
upgradeAppDialog?.let { dialog ->
|
||||
if (dialog.isShowing) {
|
||||
return
|
||||
}
|
||||
dialog.showUpgradeAppDialog(name, url, title, content, installType)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private var confirmTv: TextView? = null
|
||||
private var cancleTv: TextView? = null
|
||||
private var cancelTv: TextView? = null
|
||||
private var upgradeTitleTv: TextView? = null
|
||||
private var upgradeContentTv: TextView? = null
|
||||
private var verticalLineView: View? = null
|
||||
private var confirmForceTv: TextView? = null
|
||||
private var tag: String? = null
|
||||
private var downloarUrl: String? = null
|
||||
private var downloadUrl: String? = null
|
||||
|
||||
init {
|
||||
setContentView(R.layout.dialog_upgrade_app)
|
||||
@@ -32,7 +57,7 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
|
||||
upgradeTitleTv = findViewById(R.id.tv_upgrade_title)
|
||||
upgradeContentTv = findViewById(R.id.tv_upgrade_content)
|
||||
confirmTv = findViewById(R.id.tv_upgrade_confirm)
|
||||
cancleTv = findViewById(R.id.tv_upgrade_cancel)
|
||||
cancelTv = findViewById(R.id.tv_upgrade_cancel)
|
||||
verticalLineView = findViewById(R.id.view_vertical_line)
|
||||
confirmForceTv = findViewById(R.id.tv_upgrade_confirm_force)
|
||||
|
||||
@@ -40,7 +65,7 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
|
||||
downloadApp()
|
||||
}
|
||||
|
||||
cancleTv?.setOnClickListener {
|
||||
cancelTv?.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
|
||||
@@ -55,13 +80,14 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
|
||||
*/
|
||||
fun downloadApp() {
|
||||
ToastUtils.showLong("开始下载APK,稍后可前往downloads文件夹查看,通知栏查看下载进度")
|
||||
tag?.let { downloarUrl?.let { it1 -> CallerDevaToolsManager.downLoadPackage(it, it1) } }
|
||||
tag?.let { downloadUrl?.let { it1 -> CallerDevaToolsManager.downLoadPackage(it, it1) } }
|
||||
|
||||
dismiss()
|
||||
}
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
upgradeAppDialog = null
|
||||
}
|
||||
|
||||
// 升级类型 1:提示升级 2:静默升级 3:强制升级
|
||||
@@ -72,29 +98,29 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
|
||||
content: String,
|
||||
installType: String
|
||||
) {
|
||||
if (isShowing) {
|
||||
return
|
||||
}
|
||||
tag = name
|
||||
downloarUrl = url
|
||||
downloadUrl = url
|
||||
upgradeTitleTv?.text = title
|
||||
upgradeContentTv?.text = content
|
||||
|
||||
if (installType.equals("1")) {
|
||||
confirmForceTv?.visibility = View.GONE
|
||||
confirmTv?.visibility = View.VISIBLE
|
||||
cancleTv?.visibility = View.VISIBLE
|
||||
verticalLineView?.visibility = View.VISIBLE
|
||||
} else if (installType.equals("3")) {
|
||||
confirmTv?.visibility = View.GONE
|
||||
cancleTv?.visibility = View.GONE
|
||||
verticalLineView?.visibility = View.GONE
|
||||
when (installType) {
|
||||
"1" -> {
|
||||
confirmForceTv?.visibility = View.GONE
|
||||
confirmTv?.visibility = View.VISIBLE
|
||||
cancelTv?.visibility = View.VISIBLE
|
||||
verticalLineView?.visibility = View.VISIBLE
|
||||
}
|
||||
"3" -> {
|
||||
confirmTv?.visibility = View.GONE
|
||||
cancelTv?.visibility = View.GONE
|
||||
verticalLineView?.visibility = View.GONE
|
||||
|
||||
confirmForceTv?.visibility = View.VISIBLE
|
||||
} else if (installType.equals("2")) {
|
||||
//静默安装
|
||||
confirmForceTv?.visibility = View.VISIBLE
|
||||
}
|
||||
"2" -> {
|
||||
//静默安装
|
||||
}
|
||||
}
|
||||
|
||||
show()
|
||||
}
|
||||
|
||||
|
||||
@@ -9,11 +9,11 @@ import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.eagle.core.data.map.Infrastructure
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.widget.media.video.SimpleVideoPlayer
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
||||
import com.shuyu.gsyvideoplayer.model.VideoOptionModel
|
||||
@@ -30,7 +30,25 @@ import tv.danmaku.ijk.media.player.IjkMediaPlayer
|
||||
*/
|
||||
class RoadVideoDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||
|
||||
private val TAG = "RoadVideoDialog"
|
||||
companion object {
|
||||
private const val TAG = "RoadVideoDialog"
|
||||
|
||||
private var roadVideoDialog: RoadVideoDialog? = null
|
||||
|
||||
fun show(context: Context?, infList: List<Infrastructure>) {
|
||||
context?.let {
|
||||
if (roadVideoDialog == null) {
|
||||
roadVideoDialog = RoadVideoDialog(it)
|
||||
}
|
||||
roadVideoDialog?.let { dialog ->
|
||||
if(dialog.isShowing){
|
||||
return
|
||||
}
|
||||
dialog.show(infList)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val gsyVideoOptionBuilder by lazy {
|
||||
GSYVideoOptionBuilder()
|
||||
@@ -150,6 +168,7 @@ class RoadVideoDialog(context: Context) : BaseFloatDialog(context), LifecycleObs
|
||||
private fun stopLive() {
|
||||
try {
|
||||
GSYVideoManager.releaseAllVideos()
|
||||
roadVideoDialog = null
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
@@ -37,6 +37,9 @@ public class DispatchDialogManager {
|
||||
}
|
||||
|
||||
public void showDialog(DispatchAdasAutoPilotLocReceiverBean msgData) {
|
||||
if(isShowing()){
|
||||
return;
|
||||
}
|
||||
if (msgData == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -10,15 +10,15 @@ import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.module.status.StatusDescriptor
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.utilcode.util.BitmapHelper
|
||||
import com.mogo.eagle.core.widget.media.video.NoticeSimpleVideoPlayer
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
||||
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack
|
||||
@@ -28,9 +28,28 @@ import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack
|
||||
* @brief 点击查看对话框
|
||||
* @author lixiaopeng
|
||||
*/
|
||||
class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver{
|
||||
class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "NoticeCheckDialog"
|
||||
|
||||
private var pushCheckDialog: NoticeCheckDialog? = null
|
||||
|
||||
fun show(context: Context?, normalData: NoticeNormalData) {
|
||||
context?.let {
|
||||
if (pushCheckDialog == null) {
|
||||
pushCheckDialog = NoticeCheckDialog(it)
|
||||
}
|
||||
pushCheckDialog?.let { dialog ->
|
||||
if (dialog.isShowing) {
|
||||
return
|
||||
}
|
||||
dialog.showCheckDialog(normalData)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val TAG = "NoticeCheckDialog"
|
||||
private var pushCheckClose: ImageView? = null
|
||||
private var pushCheckTitle: TextView? = null
|
||||
private var pushCheckContent: TextView? = null
|
||||
@@ -42,11 +61,12 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
private var mVideoUrl: String = ""
|
||||
private var playErrorImageView: ImageView? = null
|
||||
private var connectTextView: TextView? = null
|
||||
private val statusChangedListenerForCheckNotice = IMogoStatusChangedListener { descriptor, isTrue ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||
dismiss()
|
||||
private val statusChangedListenerForCheckNotice =
|
||||
IMogoStatusChangedListener { descriptor, isTrue ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
setContentView(R.layout.notice_dialog_check_with_accessory)
|
||||
@@ -92,13 +112,21 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
playVideo(mVideoUrl)
|
||||
}
|
||||
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForCheckNotice)
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(
|
||||
TAG,
|
||||
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||
statusChangedListenerForCheckNotice
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForCheckNotice)
|
||||
pushCheckDialog = null
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(
|
||||
TAG,
|
||||
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||
statusChangedListenerForCheckNotice
|
||||
)
|
||||
stopLive()
|
||||
}
|
||||
|
||||
@@ -106,10 +134,6 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
* 展示详情页面
|
||||
*/
|
||||
fun showCheckDialog(noticeNormal: NoticeNormalData) {
|
||||
if (isShowing || noticeNormal == null) {
|
||||
return
|
||||
}
|
||||
|
||||
if (noticeNormal.title.isBlank() || noticeNormal.content.isBlank()) {
|
||||
return
|
||||
}
|
||||
@@ -148,7 +172,7 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
private fun playVideo(videoUrl: String) {
|
||||
try {
|
||||
gsyVideoOptionBuilder.setUrl(videoUrl).setCacheWithPlay(false).setPlayTag(TAG)
|
||||
.build(pushVideo)
|
||||
.build(pushVideo)
|
||||
pushVideo!!.startButton.performClick()
|
||||
playImageView!!.visibility = View.GONE
|
||||
thumbnailImageView!!.visibility = View.GONE
|
||||
@@ -187,11 +211,11 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
/**
|
||||
* 播放结束后
|
||||
*/
|
||||
private fun complete(firstbitmap: Bitmap, path: String) {
|
||||
private fun complete(firstBitmap: Bitmap, path: String) {
|
||||
playImageView!!.visibility = View.VISIBLE
|
||||
playImageView!!.setImageResource(R.drawable.notice_video_play)
|
||||
thumbnailImageView!!.visibility = View.VISIBLE
|
||||
GlideApp.with(context).load(firstbitmap).optionalTransform(
|
||||
GlideApp.with(context).load(firstBitmap).optionalTransform(
|
||||
GlideRoundedCornersTransform(
|
||||
20f,
|
||||
GlideRoundedCornersTransform.CornerType.ALL
|
||||
@@ -201,7 +225,7 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
}
|
||||
|
||||
private fun startVideoCallBack(path: String) {
|
||||
Thread(Runnable {
|
||||
Thread {
|
||||
val firstBitmap = BitmapHelper.getVideoThumbnail(path) /*获取第一帧图*/
|
||||
pushVideo!!.setVideoAllCallBack(object : VideoAllCallBack {
|
||||
override fun onAutoComplete(url: String, vararg objects: Any) {
|
||||
@@ -214,15 +238,15 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
}
|
||||
|
||||
override fun onClickStop(url: String, vararg objects: Any) {
|
||||
CallerLogger.d(M_HMI + TAG, "onClickStop")
|
||||
CallerLogger.d(M_HMI + TAG, "onClickStop")
|
||||
}
|
||||
|
||||
override fun onStartPrepared(url: String, vararg objects: Any) {
|
||||
CallerLogger.d(M_HMI + TAG, "onStartPrepared")
|
||||
CallerLogger.d(M_HMI + TAG, "onStartPrepared")
|
||||
}
|
||||
|
||||
override fun onPlayError(url: String, vararg objects: Any) {
|
||||
CallerLogger.d(M_HMI + TAG, "onPlayError")
|
||||
CallerLogger.d(M_HMI + TAG, "onPlayError")
|
||||
pushImageView?.visibility = View.GONE
|
||||
pushVideo?.visibility = View.GONE
|
||||
playImageView!!.visibility = View.GONE
|
||||
@@ -249,10 +273,10 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
override fun onClickStartThumb(url: String, vararg objects: Any) {}
|
||||
override fun onClickBlank(url: String, vararg objects: Any) {}
|
||||
override fun onClickBlankFullscreen(url: String, vararg objects: Any) {
|
||||
CallerLogger.d(M_HMI + TAG, "onClickBlankFullscreen")
|
||||
CallerLogger.d(M_HMI + TAG, "onClickBlankFullscreen")
|
||||
}
|
||||
})
|
||||
}).start()
|
||||
}.start()
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,451 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.notice.traffic;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LifecycleObserver;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
|
||||
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.module.status.StatusDescriptor;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo;
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData;
|
||||
import com.mogo.eagle.core.data.notice.NoticeValue;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform;
|
||||
import com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.BitmapHelper;
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
|
||||
import com.mogo.eagle.core.widget.media.video.NoticeSimpleSmallVideoPlayer;
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog;
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager;
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder;
|
||||
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack;
|
||||
import com.shuyu.gsyvideoplayer.utils.NetworkUtils;
|
||||
import com.shuyu.gsyvideoplayer.video.base.GSYVideoView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 交警事故详情弹框
|
||||
* http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=66917475 根据infoId获取事故详情
|
||||
* @since: 10/26/21
|
||||
*/
|
||||
public class NoticeTrafficDialog extends BaseFloatDialog implements LifecycleObserver {
|
||||
private String TAG = "AINotice";
|
||||
private Context mContext;
|
||||
private RecyclerView mRecyclerView;
|
||||
private NoticeSimpleSmallVideoPlayer mVideoPlayer;
|
||||
private NoticeTrafficStylePushData mPushData;
|
||||
private ImageView close;
|
||||
private ImageView playImageView;
|
||||
private MogoImageView thumbnailImage;
|
||||
private final GSYVideoOptionBuilder gsyVideoOptionBuilder = new GSYVideoOptionBuilder();
|
||||
private TextView accept;//接受
|
||||
private TextView refuse;//拒绝
|
||||
private TextView connect;//连接
|
||||
private NoticeTrafficAdapter adapter;
|
||||
private final ArrayList<NoticeValue> dataArrayList = new ArrayList<>();
|
||||
private NoticeTrafficStyleInfo.NoticeTrafficAccountInfo mTrafficStyleInfo;
|
||||
|
||||
public NoticeTrafficDialog(@NonNull Context context, NoticeTrafficStylePushData pushData) {
|
||||
super(context);
|
||||
mContext = context;
|
||||
mPushData = pushData;
|
||||
initView();
|
||||
}
|
||||
|
||||
public NoticeTrafficDialog(@NonNull Context context, int themeResId) {
|
||||
super(context, themeResId);
|
||||
}
|
||||
|
||||
public void initView() {
|
||||
setContentView(R.layout.notice_dialog_traffic_police);
|
||||
setCanceledOnTouchOutside(true);
|
||||
playerShow();//视频播放器及接操作按钮
|
||||
recyclerVie();//详情信息列表
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(M_HMI + TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForNotice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据推送消息渲染顶部图片/视频
|
||||
* type 0图片 1视频
|
||||
*/
|
||||
private void playerShow() {
|
||||
mVideoPlayer = findViewById(R.id.video_player);
|
||||
thumbnailImage = findViewById(R.id.thumbnail_image);
|
||||
playImageView = this.findViewById(R.id.start_for_traffic);
|
||||
playImageView.setOnClickListener(v -> startLive());
|
||||
close = findViewById(R.id.notice_traffic_dialog_close);
|
||||
close.setOnClickListener(v -> {
|
||||
releasePlayer();
|
||||
dismiss();
|
||||
});
|
||||
accept = findViewById(R.id.accept_traffic);
|
||||
refuse = findViewById(R.id.refuse_traffic);
|
||||
connect = findViewById(R.id.notice_connect);
|
||||
accept.setOnClickListener(v -> feedBackTraffic(1));
|
||||
refuse.setOnClickListener(v -> feedBackTraffic(0));
|
||||
//重新连接
|
||||
connect.setOnClickListener(v -> {
|
||||
netWorkStatus();
|
||||
startLive();
|
||||
requestTrafficInfo();
|
||||
});
|
||||
requestTrafficInfo();
|
||||
netWorkStatus();
|
||||
if (mPushData.getType() == 1) {
|
||||
startLive();
|
||||
} else {
|
||||
GlideApp.with(mContext).load(mPushData.getPoiImgUrl()).optionalTransform(new GlideRoundedCornersTransform
|
||||
(20f, GlideRoundedCornersTransform.CornerType.ALL)).into(thumbnailImage);
|
||||
mVideoPlayer.setVisibility(View.INVISIBLE);
|
||||
playImageView.setVisibility(View.INVISIBLE);
|
||||
thumbnailImage.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mVideoPlayer.setOnClickListener(v -> {
|
||||
if (mVideoPlayer.getCurrentState() == GSYVideoView.CURRENT_STATE_PAUSE) {/*播放中*/
|
||||
resume();
|
||||
} else {
|
||||
pause();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void recyclerVie() {
|
||||
//网格绘制
|
||||
try {
|
||||
mRecyclerView = findViewById(R.id.traffic_info_recyclerView);
|
||||
//网格布局
|
||||
StaggeredGridLayoutManager staggeredGridLayoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
|
||||
mRecyclerView.setLayoutManager(staggeredGridLayoutManager);
|
||||
NoticeTrafficInfoGridItemDivider gridLayoutDivider = new NoticeTrafficInfoGridItemDivider(1,
|
||||
(mContext.getResources().getColor(R.color.notice_check_dialog_bg_color)));
|
||||
mRecyclerView.addItemDecoration(gridLayoutDivider);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
adapter = new NoticeTrafficAdapter(mContext, dataArrayList);
|
||||
mRecyclerView.setAdapter(adapter);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param i 是否接受交通事故任务
|
||||
* 0不接收 1接受 发起自动驾驶任务,显示引导线
|
||||
*/
|
||||
private void feedBackTraffic(int i) {
|
||||
CallerFuncBizManager.getBizProvider().feedBackNoticeTraffic(mPushData.getInfoId(), MoGoAiCloudClientConfig.getInstance().getSn(), i);
|
||||
if (i == 1) {
|
||||
startAutoPilot();
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 开启自动驾驶
|
||||
*/
|
||||
private void startAutoPilot() {
|
||||
if (mTrafficStyleInfo != null) {
|
||||
AutopilotControlParameters parameters = new AutopilotControlParameters();
|
||||
parameters.isSpeakVoice = false;
|
||||
parameters.vehicleType = 10;
|
||||
//云平台使用的是火星坐标,自动驾驶需要wgs84
|
||||
double[] gcj02 = CoordinateUtils.transformGcj02toWgs84(mTrafficStyleInfo.getLat(), mTrafficStyleInfo.getLon());
|
||||
parameters.startLatLon = new AutopilotControlParameters.AutoPilotLonLat
|
||||
(CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat(),
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon());
|
||||
parameters.endLatLon = new AutopilotControlParameters.AutoPilotLonLat
|
||||
(gcj02[0], gcj02[1]);
|
||||
CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 暂停
|
||||
*/
|
||||
private void pause() {
|
||||
playImageView.setVisibility(View.VISIBLE);
|
||||
thumbnailImage.setVisibility(View.GONE);
|
||||
playImageView.setOnClickListener(v -> mVideoPlayer.onVideoResume());
|
||||
thumbnailImage.setOnClickListener(v -> mVideoPlayer.onVideoResume());
|
||||
}
|
||||
|
||||
/**
|
||||
* 继续
|
||||
*/
|
||||
private void resume() {
|
||||
playImageView.setImageResource(R.drawable.notice_video_pause);
|
||||
playImageView.setVisibility(View.GONE);
|
||||
thumbnailImage.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 播放结束后
|
||||
*/
|
||||
private void complete(Bitmap firstbitmap) {
|
||||
thumbnailImage.setVisibility(View.VISIBLE);
|
||||
// thumbnailImage.setImageBitmap(firstbitmap);
|
||||
GlideApp.with(mContext).load(firstbitmap).optionalTransform(new GlideRoundedCornersTransform
|
||||
(20f, GlideRoundedCornersTransform.CornerType.ALL)).into(thumbnailImage);
|
||||
playImageView.setImageResource(R.drawable.notice_video_play);
|
||||
playImageView.setVisibility(View.VISIBLE);
|
||||
playImageView.setOnClickListener(v -> startLive());
|
||||
thumbnailImage.setOnClickListener(v -> startLive());
|
||||
}
|
||||
|
||||
/**
|
||||
* 视频播放
|
||||
*/
|
||||
private void startLive() {
|
||||
if (mPushData != null) {
|
||||
try {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "交警事故开始播放视频startLive");
|
||||
String videoUrl = mPushData.getPoiImgUrl();
|
||||
gsyVideoOptionBuilder.setUrl(videoUrl).setCacheWithPlay(false).setPlayTag("NoticeTrafficDialog")
|
||||
.build(mVideoPlayer);
|
||||
mVideoPlayer.getStartButton().performClick();
|
||||
liveCallBack();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (dataArrayList.size() == 0) {
|
||||
requestTrafficInfo();
|
||||
}
|
||||
}
|
||||
|
||||
private void liveCallBack() {
|
||||
new Thread(() -> {
|
||||
Bitmap firstBitmap = BitmapHelper.getVideoThumbnail(mPushData.getPoiImgUrl());/*获取第一帧图*/
|
||||
mVideoPlayer.setVideoAllCallBack(new VideoAllCallBack() {
|
||||
@Override
|
||||
public void onAutoComplete(String url, Object... objects) {
|
||||
complete(firstBitmap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickResume(String url, Object... objects) {
|
||||
thumbnailImage.setVisibility(View.GONE);
|
||||
playImageView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickStop(String url, Object... objects) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onClickStop");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartPrepared(String url, Object... objects) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onStartPrepared");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPrepared(String url, Object... objects) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onPrepared");
|
||||
thumbnailImage.setVisibility(View.GONE);
|
||||
playImageView.setVisibility(View.GONE);
|
||||
connect.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickStartIcon(String url, Object... objects) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onClickStartIcon");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickStartError(String url, Object... objects) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onClickStartError");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickStopFullscreen(String url, Object... objects) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onClickStopFullscreen");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickResumeFullscreen(String url, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickSeekbar(String url, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickSeekbarFullscreen(String url, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnterFullscreen(String url, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onQuitFullscreen(String url, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onQuitSmallWidget(String url, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnterSmallWidget(String url, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTouchScreenSeekVolume(String url, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTouchScreenSeekPosition(String url, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTouchScreenSeekLight(String url, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayError(String url, Object... objects) {
|
||||
thumbnailImage.setVisibility(View.VISIBLE);
|
||||
connect.setVisibility(View.VISIBLE);
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onPlayError");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickStartThumb(String url, Object... objects) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onClickStartThumb");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickBlank(String url, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickBlankFullscreen(String url, Object... objects) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onClickBlankFullscreen");
|
||||
|
||||
}
|
||||
});
|
||||
}).start();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取交通事故详情
|
||||
*/
|
||||
private void requestTrafficInfo() {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "requestTrafficInfo");
|
||||
CallerFuncBizManager.getBizProvider().requestAccidentInfo(mPushData.getInfoId(), MoGoAiCloudClientConfig.getInstance().getSn(), trafficInfo -> {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "交通事故详情::" + trafficInfo);
|
||||
mTrafficStyleInfo = trafficInfo.getResult().getAccidentInfo();
|
||||
infoRefresh(mTrafficStyleInfo);
|
||||
});
|
||||
}
|
||||
|
||||
private void infoRefresh(NoticeTrafficStyleInfo.NoticeTrafficAccountInfo info) {
|
||||
if (dataArrayList.size() > 0) {
|
||||
dataArrayList.clear();
|
||||
}
|
||||
NoticeValue laiYuan = new NoticeValue();
|
||||
laiYuan.setKey("事故来源:");
|
||||
laiYuan.setValue(info.getUploadType());
|
||||
dataArrayList.add(laiYuan);
|
||||
|
||||
NoticeValue cTime = new NoticeValue();
|
||||
cTime.setKey("事故时间:");
|
||||
cTime.setValue(DateTimeUtils.getTimeText(info.getDataCreateTime(), DateTimeUtils.MM_Yue_dd_Ri_HH_mm));
|
||||
dataArrayList.add(cTime);
|
||||
|
||||
NoticeValue hTime = new NoticeValue();
|
||||
hTime.setKey("处理时间:");
|
||||
hTime.setValue(DateTimeUtils.getTimeText(info.getDataHandleTime(), DateTimeUtils.MM_Yue_dd_Ri_HH_mm));
|
||||
dataArrayList.add(hTime);
|
||||
|
||||
NoticeValue reason = new NoticeValue();
|
||||
reason.setKey("事故原因:");
|
||||
reason.setValue(info.getReason());
|
||||
dataArrayList.add(reason);
|
||||
|
||||
NoticeValue status = new NoticeValue();
|
||||
status.setKey("处理状态:");
|
||||
if (info.getOperaStatus().equals("1")) {
|
||||
status.setValue("待处理");
|
||||
} else {
|
||||
status.setValue("已处理");
|
||||
}
|
||||
dataArrayList.add(status);
|
||||
|
||||
NoticeValue location = new NoticeValue();
|
||||
location.setKey("事故地点:");
|
||||
location.setValue(info.getUploadAddress());
|
||||
dataArrayList.add(location);
|
||||
|
||||
NoticeValue style = new NoticeValue();
|
||||
style.setKey("事故等级:");
|
||||
style.setValue(info.getTroubleTypeName());
|
||||
dataArrayList.add(style);
|
||||
|
||||
adapter.setData(dataArrayList);
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断网络状态
|
||||
*/
|
||||
private void netWorkStatus() {
|
||||
if (NetworkUtils.isAvailable(getContext())) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "网络可用");
|
||||
thumbnailImage.setVisibility(View.GONE);
|
||||
connect.setVisibility(View.GONE);
|
||||
thumbnailImage.setBackgroundResource(R.drawable.notice_traffic_placeholder);
|
||||
} else {
|
||||
thumbnailImage.setVisibility(View.VISIBLE);
|
||||
thumbnailImage.setBackgroundResource(R.drawable.notice_unsuccess_traffic);
|
||||
connect.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
public void cancel() {
|
||||
|
||||
}
|
||||
|
||||
private void releasePlayer() {
|
||||
try {
|
||||
GSYVideoManager.releaseAllVideos();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
super.dismiss();
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "trafficDialog dismiss");
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(M_HMI + TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForNotice);
|
||||
releasePlayer();
|
||||
}
|
||||
|
||||
private final IMogoStatusChangedListener statusChangedListenerForNotice = (descriptor, isTrue) -> {
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onStatusChanged==MAIN_PAGE_IS_BACKGROUND");
|
||||
dismiss();
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,445 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.notice.traffic
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Bitmap
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.StaggeredGridLayoutManager
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.module.status.StatusDescriptor
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLonLat
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo.NoticeTrafficAccountInfo
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
|
||||
import com.mogo.eagle.core.data.notice.NoticeValue
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager.startAutoPilot
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lat
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lon
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager.bizProvider
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
|
||||
import com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.BitmapHelper
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils
|
||||
import com.mogo.eagle.core.widget.media.video.NoticeSimpleSmallVideoPlayer
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
||||
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack
|
||||
import com.shuyu.gsyvideoplayer.utils.NetworkUtils
|
||||
import com.shuyu.gsyvideoplayer.video.base.GSYVideoView
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 交警事故详情弹框
|
||||
* http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=66917475 根据infoId获取事故详情
|
||||
* @since: 10/26/21
|
||||
*/
|
||||
class NoticeTrafficDialog : BaseFloatDialog, LifecycleObserver {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "AINotice"
|
||||
|
||||
private var noticeTrafficDialog: NoticeTrafficDialog? = null
|
||||
|
||||
fun show(context: Context?, trafficStylePushData: NoticeTrafficStylePushData) {
|
||||
context?.let {
|
||||
if (noticeTrafficDialog == null) {
|
||||
noticeTrafficDialog = NoticeTrafficDialog(it, trafficStylePushData)
|
||||
}
|
||||
noticeTrafficDialog?.let { dialog ->
|
||||
if (dialog.isShowing) {
|
||||
return
|
||||
}
|
||||
dialog.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private var mContext: Context? = null
|
||||
private var mRecyclerView: RecyclerView? = null
|
||||
private var mVideoPlayer: NoticeSimpleSmallVideoPlayer? = null
|
||||
private var mPushData: NoticeTrafficStylePushData? = null
|
||||
private var close: ImageView? = null
|
||||
private var playImageView: ImageView? = null
|
||||
private var thumbnailImage: MogoImageView? = null
|
||||
private val gsyVideoOptionBuilder = GSYVideoOptionBuilder()
|
||||
private var accept: TextView? = null//接受
|
||||
private var refuse: TextView? = null//拒绝
|
||||
private var connect: TextView? = null//连接
|
||||
private var adapter: NoticeTrafficAdapter? = null
|
||||
private val dataArrayList = ArrayList<NoticeValue?>()
|
||||
private var mTrafficStyleInfo: NoticeTrafficAccountInfo? = null
|
||||
|
||||
constructor(context: Context, pushData: NoticeTrafficStylePushData?) : super(context) {
|
||||
mContext = context
|
||||
mPushData = pushData
|
||||
initView()
|
||||
}
|
||||
|
||||
fun initView() {
|
||||
setContentView(R.layout.notice_dialog_traffic_police)
|
||||
setCanceledOnTouchOutside(true)
|
||||
playerShow() //视频播放器及接操作按钮
|
||||
recyclerVie() //详情信息列表
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(
|
||||
SceneConstant.M_HMI + TAG,
|
||||
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||
statusChangedListenerForNotice
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据推送消息渲染顶部图片/视频
|
||||
* type 0图片 1视频
|
||||
*/
|
||||
private fun playerShow() {
|
||||
mVideoPlayer = findViewById(R.id.video_player)
|
||||
thumbnailImage = findViewById(R.id.thumbnail_image)
|
||||
playImageView = findViewById(R.id.start_for_traffic)
|
||||
close = findViewById(R.id.notice_traffic_dialog_close)
|
||||
accept = findViewById(R.id.accept_traffic)
|
||||
refuse = findViewById(R.id.refuse_traffic)
|
||||
connect = findViewById(R.id.notice_connect)
|
||||
|
||||
playImageView?.setOnClickListener { startLive() }
|
||||
close?.setOnClickListener {
|
||||
releasePlayer()
|
||||
dismiss()
|
||||
}
|
||||
accept?.setOnClickListener { feedBackTraffic(1) }
|
||||
refuse?.setOnClickListener { feedBackTraffic(0) }
|
||||
//重新连接
|
||||
connect?.setOnClickListener {
|
||||
netWorkStatus()
|
||||
startLive()
|
||||
requestTrafficInfo()
|
||||
}
|
||||
requestTrafficInfo()
|
||||
netWorkStatus()
|
||||
if (mPushData!!.type == 1) {
|
||||
startLive()
|
||||
} else {
|
||||
GlideApp.with(mContext!!).load(mPushData!!.poiImgUrl).optionalTransform(
|
||||
GlideRoundedCornersTransform(
|
||||
20f,
|
||||
GlideRoundedCornersTransform.CornerType.ALL
|
||||
)
|
||||
).into(thumbnailImage!!)
|
||||
mVideoPlayer?.visibility = View.INVISIBLE
|
||||
playImageView?.visibility = View.INVISIBLE
|
||||
thumbnailImage?.visibility = View.VISIBLE
|
||||
}
|
||||
mVideoPlayer?.setOnClickListener {
|
||||
if (mVideoPlayer!!.currentState == GSYVideoView.CURRENT_STATE_PAUSE) { /*播放中*/
|
||||
resume()
|
||||
} else {
|
||||
pause()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun recyclerVie() {
|
||||
//网格绘制
|
||||
try {
|
||||
mRecyclerView = findViewById(R.id.traffic_info_recyclerView)
|
||||
//网格布局
|
||||
val staggeredGridLayoutManager =
|
||||
StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL)
|
||||
mRecyclerView?.layoutManager = staggeredGridLayoutManager
|
||||
val gridLayoutDivider = NoticeTrafficInfoGridItemDivider(
|
||||
1,
|
||||
mContext!!.resources.getColor(R.color.notice_check_dialog_bg_color)
|
||||
)
|
||||
mRecyclerView?.addItemDecoration(gridLayoutDivider)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
adapter = NoticeTrafficAdapter(mContext!!, dataArrayList)
|
||||
mRecyclerView!!.adapter = adapter
|
||||
}
|
||||
|
||||
/**
|
||||
* @param i 是否接受交通事故任务
|
||||
* 0不接收 1接受 发起自动驾驶任务,显示引导线
|
||||
*/
|
||||
private fun feedBackTraffic(i: Int) {
|
||||
bizProvider.feedBackNoticeTraffic(
|
||||
mPushData!!.infoId,
|
||||
MoGoAiCloudClientConfig.getInstance().sn,
|
||||
i
|
||||
)
|
||||
if (i == 1) {
|
||||
startAutoPilot()
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启自动驾驶
|
||||
*/
|
||||
private fun startAutoPilot() {
|
||||
if (mTrafficStyleInfo != null) {
|
||||
val parameters = AutopilotControlParameters()
|
||||
parameters.isSpeakVoice = false
|
||||
parameters.vehicleType = 10
|
||||
//云平台使用的是火星坐标,自动驾驶需要wgs84
|
||||
val gcj02 = CoordinateUtils.transformGcj02toWgs84(
|
||||
mTrafficStyleInfo!!.lat, mTrafficStyleInfo!!.lon
|
||||
)
|
||||
parameters.startLatLon = AutoPilotLonLat(
|
||||
getCurWgs84Lat(),
|
||||
getCurWgs84Lon()
|
||||
)
|
||||
parameters.endLatLon = AutoPilotLonLat(gcj02[0], gcj02[1])
|
||||
startAutoPilot(parameters)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 暂停
|
||||
*/
|
||||
private fun pause() {
|
||||
playImageView!!.visibility = View.VISIBLE
|
||||
thumbnailImage!!.visibility = View.GONE
|
||||
playImageView!!.setOnClickListener { v: View? -> mVideoPlayer!!.onVideoResume() }
|
||||
thumbnailImage!!.setOnClickListener { v: View? -> mVideoPlayer!!.onVideoResume() }
|
||||
}
|
||||
|
||||
/**
|
||||
* 继续
|
||||
*/
|
||||
private fun resume() {
|
||||
playImageView!!.setImageResource(R.drawable.notice_video_pause)
|
||||
playImageView!!.visibility = View.GONE
|
||||
thumbnailImage!!.visibility = View.GONE
|
||||
}
|
||||
|
||||
/**
|
||||
* 播放结束后
|
||||
*/
|
||||
private fun complete(firstBitmap: Bitmap) {
|
||||
thumbnailImage!!.visibility = View.VISIBLE
|
||||
GlideApp.with(mContext!!).load(firstBitmap).optionalTransform(
|
||||
GlideRoundedCornersTransform(
|
||||
20f,
|
||||
GlideRoundedCornersTransform.CornerType.ALL
|
||||
)
|
||||
).into(
|
||||
thumbnailImage!!
|
||||
)
|
||||
playImageView!!.setImageResource(R.drawable.notice_video_play)
|
||||
playImageView!!.visibility = View.VISIBLE
|
||||
playImageView!!.setOnClickListener { v: View? -> startLive() }
|
||||
thumbnailImage!!.setOnClickListener { v: View? -> startLive() }
|
||||
}
|
||||
|
||||
/**
|
||||
* 视频播放
|
||||
*/
|
||||
private fun startLive() {
|
||||
if (mPushData != null) {
|
||||
try {
|
||||
d(SceneConstant.M_HMI + TAG, "交警事故开始播放视频startLive")
|
||||
val videoUrl = mPushData!!.poiImgUrl
|
||||
gsyVideoOptionBuilder.setUrl(videoUrl).setCacheWithPlay(false)
|
||||
.setPlayTag("NoticeTrafficDialog")
|
||||
.build(mVideoPlayer)
|
||||
mVideoPlayer!!.startButton.performClick()
|
||||
liveCallBack()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
if (dataArrayList.size == 0) {
|
||||
requestTrafficInfo()
|
||||
}
|
||||
}
|
||||
|
||||
private fun liveCallBack() {
|
||||
Thread {
|
||||
val firstBitmap = BitmapHelper.getVideoThumbnail(mPushData!!.poiImgUrl) /*获取第一帧图*/
|
||||
mVideoPlayer!!.setVideoAllCallBack(object : VideoAllCallBack {
|
||||
override fun onAutoComplete(url: String, vararg objects: Any) {
|
||||
complete(firstBitmap)
|
||||
}
|
||||
|
||||
override fun onClickResume(url: String, vararg objects: Any) {
|
||||
thumbnailImage!!.visibility = View.GONE
|
||||
playImageView!!.visibility = View.GONE
|
||||
}
|
||||
|
||||
override fun onClickStop(url: String, vararg objects: Any) {
|
||||
d(SceneConstant.M_HMI + TAG, "onClickStop")
|
||||
}
|
||||
|
||||
override fun onStartPrepared(url: String, vararg objects: Any) {
|
||||
d(SceneConstant.M_HMI + TAG, "onStartPrepared")
|
||||
}
|
||||
|
||||
override fun onPrepared(url: String, vararg objects: Any) {
|
||||
d(SceneConstant.M_HMI + TAG, "onPrepared")
|
||||
thumbnailImage!!.visibility = View.GONE
|
||||
playImageView!!.visibility = View.GONE
|
||||
connect!!.visibility = View.GONE
|
||||
}
|
||||
|
||||
override fun onClickStartIcon(url: String, vararg objects: Any) {
|
||||
d(SceneConstant.M_HMI + TAG, "onClickStartIcon")
|
||||
}
|
||||
|
||||
override fun onClickStartError(url: String, vararg objects: Any) {
|
||||
e(SceneConstant.M_HMI + TAG, "onClickStartError")
|
||||
}
|
||||
|
||||
override fun onClickStopFullscreen(url: String, vararg objects: Any) {
|
||||
d(SceneConstant.M_HMI + TAG, "onClickStopFullscreen")
|
||||
}
|
||||
|
||||
override fun onClickResumeFullscreen(url: String, vararg objects: Any) {}
|
||||
override fun onClickSeekbar(url: String, vararg objects: Any) {}
|
||||
override fun onClickSeekbarFullscreen(url: String, vararg objects: Any) {}
|
||||
override fun onEnterFullscreen(url: String, vararg objects: Any) {}
|
||||
override fun onQuitFullscreen(url: String, vararg objects: Any) {}
|
||||
override fun onQuitSmallWidget(url: String, vararg objects: Any) {}
|
||||
override fun onEnterSmallWidget(url: String, vararg objects: Any) {}
|
||||
override fun onTouchScreenSeekVolume(url: String, vararg objects: Any) {}
|
||||
override fun onTouchScreenSeekPosition(url: String, vararg objects: Any) {}
|
||||
override fun onTouchScreenSeekLight(url: String, vararg objects: Any) {}
|
||||
override fun onPlayError(url: String, vararg objects: Any) {
|
||||
thumbnailImage!!.visibility = View.VISIBLE
|
||||
connect!!.visibility = View.VISIBLE
|
||||
d(SceneConstant.M_HMI + TAG, "onPlayError")
|
||||
}
|
||||
|
||||
override fun onClickStartThumb(url: String, vararg objects: Any) {
|
||||
d(SceneConstant.M_HMI + TAG, "onClickStartThumb")
|
||||
}
|
||||
|
||||
override fun onClickBlank(url: String, vararg objects: Any) {}
|
||||
override fun onClickBlankFullscreen(url: String, vararg objects: Any) {
|
||||
d(SceneConstant.M_HMI + TAG, "onClickBlankFullscreen")
|
||||
}
|
||||
})
|
||||
}.start()
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取交通事故详情
|
||||
*/
|
||||
private fun requestTrafficInfo() {
|
||||
d(SceneConstant.M_HMI + TAG, "requestTrafficInfo")
|
||||
bizProvider.requestAccidentInfo(
|
||||
mPushData!!.infoId,
|
||||
MoGoAiCloudClientConfig.getInstance().sn
|
||||
) { trafficInfo: NoticeTrafficStyleInfo ->
|
||||
d(SceneConstant.M_HMI + TAG, "交通事故详情::$trafficInfo")
|
||||
mTrafficStyleInfo = trafficInfo.getResult().accidentInfo
|
||||
infoRefresh(mTrafficStyleInfo)
|
||||
}
|
||||
}
|
||||
|
||||
private fun infoRefresh(info: NoticeTrafficAccountInfo?) {
|
||||
if (dataArrayList.size > 0) {
|
||||
dataArrayList.clear()
|
||||
}
|
||||
val laiYuan = NoticeValue()
|
||||
laiYuan.key = "事故来源:"
|
||||
laiYuan.value = info!!.uploadType
|
||||
dataArrayList.add(laiYuan)
|
||||
val cTime = NoticeValue()
|
||||
cTime.key = "事故时间:"
|
||||
cTime.value = DateTimeUtils.getTimeText(
|
||||
info.dataCreateTime,
|
||||
DateTimeUtils.MM_Yue_dd_Ri_HH_mm
|
||||
)
|
||||
dataArrayList.add(cTime)
|
||||
val hTime = NoticeValue()
|
||||
hTime.key = "处理时间:"
|
||||
hTime.value = DateTimeUtils.getTimeText(
|
||||
info.dataHandleTime,
|
||||
DateTimeUtils.MM_Yue_dd_Ri_HH_mm
|
||||
)
|
||||
dataArrayList.add(hTime)
|
||||
val reason = NoticeValue()
|
||||
reason.key = "事故原因:"
|
||||
reason.value = info.reason
|
||||
dataArrayList.add(reason)
|
||||
val status = NoticeValue()
|
||||
status.key = "处理状态:"
|
||||
if (info.operaStatus == "1") {
|
||||
status.value = "待处理"
|
||||
} else {
|
||||
status.value = "已处理"
|
||||
}
|
||||
dataArrayList.add(status)
|
||||
val location = NoticeValue()
|
||||
location.key = "事故地点:"
|
||||
location.value = info.uploadAddress
|
||||
dataArrayList.add(location)
|
||||
val style = NoticeValue()
|
||||
style.key = "事故等级:"
|
||||
style.value = info.troubleTypeName
|
||||
dataArrayList.add(style)
|
||||
adapter!!.setData(dataArrayList)
|
||||
adapter!!.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断网络状态
|
||||
*/
|
||||
private fun netWorkStatus() {
|
||||
if (NetworkUtils.isAvailable(context)) {
|
||||
d(SceneConstant.M_HMI + TAG, "网络可用")
|
||||
thumbnailImage!!.visibility = View.GONE
|
||||
connect!!.visibility = View.GONE
|
||||
thumbnailImage!!.setBackgroundResource(R.drawable.notice_traffic_placeholder)
|
||||
} else {
|
||||
thumbnailImage!!.visibility = View.VISIBLE
|
||||
thumbnailImage!!.setBackgroundResource(R.drawable.notice_unsuccess_traffic)
|
||||
connect!!.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
override fun cancel() {}
|
||||
private fun releasePlayer() {
|
||||
try {
|
||||
GSYVideoManager.releaseAllVideos()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
d(SceneConstant.M_HMI + TAG, "trafficDialog dismiss")
|
||||
noticeTrafficDialog = null
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(
|
||||
SceneConstant.M_HMI + TAG,
|
||||
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||
statusChangedListenerForNotice
|
||||
)
|
||||
releasePlayer()
|
||||
}
|
||||
|
||||
private val statusChangedListenerForNotice =
|
||||
IMogoStatusChangedListener { descriptor: StatusDescriptor, isTrue: Boolean ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||
d(SceneConstant.M_HMI + TAG, "onStatusChanged==MAIN_PAGE_IS_BACKGROUND")
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
|
||||
import android.animation.Animator
|
||||
import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import android.view.animation.OvershootInterpolator
|
||||
import com.mogo.eagle.core.data.camera.CameraEntity
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig
|
||||
import com.mogo.eagle.core.data.enums.SidePattern
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager
|
||||
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
|
||||
import com.mogo.eagle.core.function.hmi.notification.anim.DefaultAnimator
|
||||
import com.mogo.eagle.core.function.hmi.ui.camera.CameraListView
|
||||
import com.zhjt.service_biz.BizConfig
|
||||
|
||||
class CameraLiveView private constructor() {
|
||||
|
||||
companion object {
|
||||
val cameraLiveView by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
CameraLiveView()
|
||||
}
|
||||
}
|
||||
|
||||
// 超视距、路侧、前车直播
|
||||
private var cameraListView: CameraListView? = null
|
||||
private var cameraViewFloat: WarningFloat.Builder? = null
|
||||
|
||||
|
||||
@BizConfig(FuncBizConfig.V2I, "", FuncBizConfig.BIZ_RTS)
|
||||
fun showCameraList(
|
||||
context: Context?,
|
||||
cameraList: List<CameraEntity>?,
|
||||
liveStatus: ((Boolean) -> Unit)
|
||||
) {
|
||||
context?.let {
|
||||
if (cameraViewFloat == null) {
|
||||
if (cameraListView == null) {
|
||||
cameraListView = CameraListView(it)
|
||||
cameraListView!!.updateCameraData(cameraList)
|
||||
}
|
||||
cameraListView!!.setClickListener(object : CameraListView.ClickListener {
|
||||
override fun onClose(v: View) {
|
||||
// Builder和cameraListView都置空
|
||||
dismissFloatView()
|
||||
// 丢弃开启摄像头推流请求,同时monitor回调hmi的startRoadCameraLive()
|
||||
// 也做了cameraListView的非空判断
|
||||
CallerFuncBizManager.bizProvider.closeCameraLive()
|
||||
}
|
||||
|
||||
override fun onShowLive(isShow: Boolean) {
|
||||
liveStatus.invoke(isShow)
|
||||
}
|
||||
|
||||
override fun refreshCameraList() {
|
||||
cameraListView?.refreshCameraList(CallerFuncBizManager.bizProvider.getCameraList)
|
||||
}
|
||||
})
|
||||
cameraViewFloat = WarningFloat.with(it)
|
||||
.setTag("CameraListFloat")
|
||||
.setLayout(cameraListView!!)
|
||||
.setSidePattern(SidePattern.RIGHT)
|
||||
.setGravity(Gravity.RIGHT, -40, 255)
|
||||
.setImmersionStatusBar(true)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: WindowManager.LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: WindowManager.LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
cameraViewFloat = null
|
||||
cameraListView = null
|
||||
liveStatus.invoke(false)
|
||||
}
|
||||
})
|
||||
.show()
|
||||
} else {
|
||||
cameraViewFloat?.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun startRoadCameraLive(flvUrl: String) {
|
||||
cameraListView?.startRoadCameraLive(flvUrl)
|
||||
}
|
||||
|
||||
fun showNoSignView() {
|
||||
cameraListView?.showNoSignal()
|
||||
}
|
||||
|
||||
private fun dismissFloatView() {
|
||||
cameraViewFloat?.let {
|
||||
WarningFloat.dismiss(it.config.floatTag, false)
|
||||
cameraViewFloat = null
|
||||
cameraListView = null
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,6 @@ import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManage
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerHDMapManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerOBUManager
|
||||
@@ -91,7 +90,7 @@ import kotlin.math.abs
|
||||
* 调试使用的设置页面,这里只作为调试使用
|
||||
* 展示 本机、网络、工控机、OBU等状态信息,支持设置IP,等参数进行调试
|
||||
*/
|
||||
class DebugSettingView @JvmOverloads constructor(
|
||||
internal class DebugSettingView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
@@ -190,8 +189,6 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
// 添加 ADAS车辆状态&定位 监听
|
||||
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
|
||||
// 添加 地图样式改变 监听
|
||||
CallerMapLocationListenerManager.addListener(TAG, this, false)
|
||||
// 添加 域控制器感知数据 监听
|
||||
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
|
||||
// 添加 规划路径相关回调 监听
|
||||
@@ -234,7 +231,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
// 移除 ADAS车辆状态&定位 监听
|
||||
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
|
||||
// 移除 地图样式改变 监听
|
||||
CallerMapLocationListenerManager.removeListener(TAG, false)
|
||||
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
|
||||
// 移除 域控制器感知数据 监听
|
||||
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
|
||||
// 移除 规划路径相关回调 监听
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.graphics.PixelFormat
|
||||
import android.util.DisplayMetrics
|
||||
import android.view.*
|
||||
@@ -12,14 +13,36 @@ import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.ResourcesHelper.getDrawable
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import java.lang.reflect.Field
|
||||
import com.mogo.eagle.core.utilcode.util.SoundUtils
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 工控机异常节点上报
|
||||
* @since: 2022/5/12
|
||||
*/
|
||||
class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
||||
class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "IPCReportWindow"
|
||||
|
||||
private var ipcReportWindow: IPCReportWindow? = null
|
||||
|
||||
fun show(
|
||||
context: Context?,
|
||||
errorReportList: ArrayList<ReportEntity>,
|
||||
warningReportList: ArrayList<ReportEntity>,
|
||||
reportLevel: Int
|
||||
) {
|
||||
context?.let {
|
||||
if (ipcReportWindow == null) {
|
||||
ipcReportWindow = IPCReportWindow(it as Activity)
|
||||
SoundUtils.playRing(it)
|
||||
}
|
||||
ipcReportWindow?.showFloatWindow()
|
||||
ipcReportWindow?.refreshData(errorReportList, warningReportList, reportLevel)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var mActivity: Activity = activity
|
||||
private var mWindowParams: WindowManager.LayoutParams? = null
|
||||
@@ -28,7 +51,7 @@ class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
||||
private lateinit var ivIpcClose: ImageView
|
||||
private lateinit var tvIpcErrorTab: TextView
|
||||
private lateinit var tvIpcWarningTab: TextView
|
||||
private var ipcReportAdapter: IPCReportAdapter?=null
|
||||
private var ipcReportAdapter: IPCReportAdapter? = null
|
||||
|
||||
private lateinit var mFloatLayout: View
|
||||
private var mInViewX = 0f
|
||||
@@ -38,8 +61,6 @@ class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
||||
private var mInScreenX = 0f
|
||||
private var mInScreenY = 0f
|
||||
|
||||
private var clickListener: ClickListener? = null
|
||||
|
||||
private var ipcErrorReportList: List<ReportEntity>? = null //错误上报列表
|
||||
private var ipcWarningReportList: List<ReportEntity>? = null//警告上报列表
|
||||
|
||||
@@ -47,10 +68,11 @@ class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
||||
initFloatWindow();
|
||||
}
|
||||
|
||||
private fun initFloatWindow(){
|
||||
mFloatLayout = LayoutInflater.from(mActivity).inflate(R.layout.view_ipc_report, null) as View
|
||||
private fun initFloatWindow() {
|
||||
mFloatLayout =
|
||||
LayoutInflater.from(mActivity).inflate(R.layout.view_ipc_report, null) as View
|
||||
mFloatLayout.setOnTouchListener(this)
|
||||
rvIPCReport= mFloatLayout.findViewById(R.id.rv_ipc_report)
|
||||
rvIPCReport = mFloatLayout.findViewById(R.id.rv_ipc_report)
|
||||
ivIpcClose = mFloatLayout.findViewById(R.id.iv_ipc_close)
|
||||
tvIpcErrorTab = mFloatLayout.findViewById(R.id.tv_ipc_error_tab)
|
||||
tvIpcWarningTab = mFloatLayout.findViewById(R.id.tv_ipc_warning_tab)
|
||||
@@ -65,35 +87,43 @@ class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
||||
it.alpha = 1.0f
|
||||
}
|
||||
ipcReportAdapter = IPCReportAdapter()
|
||||
rvIPCReport.layoutManager = WrapContentLinearLayoutManager(mActivity,
|
||||
LinearLayoutManager.VERTICAL,false)
|
||||
rvIPCReport.layoutManager = WrapContentLinearLayoutManager(
|
||||
mActivity,
|
||||
LinearLayoutManager.VERTICAL, false
|
||||
)
|
||||
rvIPCReport.adapter = ipcReportAdapter
|
||||
//关闭按钮
|
||||
ivIpcClose.setOnClickListener {
|
||||
clickListener?.closeWindow()
|
||||
hideFloatWindow()
|
||||
}
|
||||
//错误列表
|
||||
tvIpcErrorTab.setOnClickListener {
|
||||
tvIpcErrorTab.background = getDrawable(mActivity,R.drawable.ipc_error_tab_normal_bg)
|
||||
tvIpcWarningTab.background = getDrawable(mActivity,R.drawable.ipc_warning_tab_normal_bg)
|
||||
tvIpcErrorTab.background = getDrawable(mActivity, R.drawable.ipc_error_tab_normal_bg)
|
||||
tvIpcWarningTab.background =
|
||||
getDrawable(mActivity, R.drawable.ipc_warning_tab_normal_bg)
|
||||
ipcReportAdapter?.setData(ipcErrorReportList)
|
||||
ipcReportAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
//预警列表
|
||||
tvIpcWarningTab.setOnClickListener {
|
||||
tvIpcErrorTab.background = getDrawable(mActivity,R.drawable.ipc_error_tab_select_bg)
|
||||
tvIpcWarningTab.background = getDrawable(mActivity,R.drawable.ipc_warning_tab_select_bg)
|
||||
tvIpcErrorTab.background = getDrawable(mActivity, R.drawable.ipc_error_tab_select_bg)
|
||||
tvIpcWarningTab.background =
|
||||
getDrawable(mActivity, R.drawable.ipc_warning_tab_select_bg)
|
||||
ipcReportAdapter?.setData(ipcWarningReportList)
|
||||
ipcReportAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun refreshData(errorReportList:List<ReportEntity>,warningReportList:List<ReportEntity>,reportLevel: Int){
|
||||
if(reportLevel == 1){
|
||||
fun refreshData(
|
||||
errorReportList: List<ReportEntity>,
|
||||
warningReportList: List<ReportEntity>,
|
||||
reportLevel: Int
|
||||
) {
|
||||
if (reportLevel == 1) {
|
||||
ipcReportAdapter?.setData(errorReportList)
|
||||
ipcErrorReportList = errorReportList
|
||||
}else{
|
||||
} else {
|
||||
ipcReportAdapter?.setData(warningReportList)
|
||||
ipcWarningReportList = warningReportList
|
||||
}
|
||||
@@ -135,22 +165,16 @@ class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
||||
mWindowManager!!.defaultDisplay.getMetrics(metrics)
|
||||
mWindowParams!!.x = metrics.widthPixels
|
||||
// mWindowParams!!.y = metrics.heightPixels / 2 - BarUtils.getStatusBarHeight()
|
||||
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight()-100
|
||||
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight() - 100
|
||||
mWindowManager!!.addView(mFloatLayout, mWindowParams)
|
||||
}
|
||||
}
|
||||
|
||||
fun hideFloatWindow() {
|
||||
if (mFloatLayout.parent != null) mWindowManager!!.removeView(mFloatLayout)
|
||||
private fun hideFloatWindow() {
|
||||
if (mFloatLayout.parent != null) {
|
||||
mWindowManager!!.removeView(mFloatLayout)
|
||||
}
|
||||
ipcReportWindow = null
|
||||
}
|
||||
|
||||
fun setClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
interface ClickListener {
|
||||
fun closeWindow()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -29,7 +29,7 @@ import java.util.*
|
||||
/**
|
||||
* SOP设置窗口
|
||||
*/
|
||||
class SOPSettingView @JvmOverloads constructor(
|
||||
internal class SOPSettingView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
|
||||
import android.animation.Animator
|
||||
import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import android.view.animation.OvershootInterpolator
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.SidePattern
|
||||
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
|
||||
import com.mogo.eagle.core.function.hmi.notification.anim.DefaultAnimator
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
class SopView private constructor(){
|
||||
|
||||
companion object{
|
||||
val sopView by lazy(LazyThreadSafetyMode.SYNCHRONIZED){
|
||||
SopView()
|
||||
}
|
||||
}
|
||||
|
||||
//SOPSettingView
|
||||
private var mSOPSettingViewFloat: WarningFloat.Builder? = null
|
||||
private var mSOPSettingView: SOPSettingView? = null
|
||||
|
||||
fun toggle(context: Context?, gravity: Int = Gravity.RIGHT, sidePattern: SidePattern = SidePattern.RIGHT) {
|
||||
context?.let {
|
||||
if (mSOPSettingViewFloat != null) {
|
||||
WarningFloat.dismiss(mSOPSettingViewFloat!!.config.floatTag, false)
|
||||
mSOPSettingViewFloat = null
|
||||
mSOPSettingView = null
|
||||
} else {
|
||||
if (mSOPSettingView == null) {
|
||||
mSOPSettingView = SOPSettingView(it)
|
||||
}
|
||||
// var side = SidePattern.RIGHT
|
||||
// var gravity = Gravity.RIGHT
|
||||
// //调试窗默认靠右显示,Bus的乘客端右端有视图覆盖,调试窗靠左显示
|
||||
// if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
|
||||
// AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||
// ) {
|
||||
// side = SidePattern.LEFT
|
||||
// gravity = Gravity.LEFT
|
||||
// }
|
||||
mSOPSettingViewFloat = WarningFloat.with(it)
|
||||
.setTag("mSOPSettingView")
|
||||
.setLayout(mSOPSettingView!!)
|
||||
.setSidePattern(sidePattern)
|
||||
.setGravity(gravity, offsetY = 70)
|
||||
.setImmersionStatusBar(true)
|
||||
.setWindowWidth(AutoSizeUtils.dp2px(context, 800f))
|
||||
.setWindowHeight(AutoSizeUtils.dp2px(context, 1100f))
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: WindowManager.LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: WindowManager.LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
|
||||
import android.animation.Animator
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import android.view.animation.OvershootInterpolator
|
||||
import com.mogo.eagle.core.data.enums.SidePattern
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
|
||||
import com.mogo.eagle.core.function.hmi.notification.anim.DefaultAnimator
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
import mogo_msg.MogoReportMsg
|
||||
|
||||
class ToggleDebugView private constructor() : IMoGoAutopilotStatusListener {
|
||||
|
||||
companion object {
|
||||
val toggleDebugView by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
ToggleDebugView()
|
||||
}
|
||||
}
|
||||
|
||||
// DebugSettingView
|
||||
private var mDebugSettingViewFloat: WarningFloat.Builder? = null
|
||||
private var mDebugSettingView: DebugSettingView? = null
|
||||
|
||||
//工控机节点上报列表
|
||||
private val reportList = arrayListOf<ReportEntity>()
|
||||
|
||||
//工控机上报列表悬浮窗
|
||||
private var reportListFloatWindow: ReportListFloatWindow? = null
|
||||
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
|
||||
super.onAutopilotGuardian(guardianInfo)
|
||||
guardianInfo?.let {
|
||||
if (reportList.size > 49) {
|
||||
reportList.removeLast()
|
||||
}
|
||||
reportList.add(
|
||||
0,
|
||||
ReportEntity(
|
||||
TimeUtils.millis2String(System.currentTimeMillis()),
|
||||
it.src, it.level, it.msg, it.code, it.resultList, it.actionsList
|
||||
)
|
||||
)
|
||||
reportListFloatWindow?.refreshData(reportList)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 开关DebugView
|
||||
*/
|
||||
fun toggle(context: Context, gravity: Int = Gravity.RIGHT, sidePattern: SidePattern = SidePattern.RIGHT) {
|
||||
if (mDebugSettingViewFloat != null) {
|
||||
dismiss()
|
||||
} else {
|
||||
if (mDebugSettingView == null) {
|
||||
mDebugSettingView = DebugSettingView(context)
|
||||
mDebugSettingView?.reportInit(reportList)
|
||||
mDebugSettingView?.setClickListener(object : DebugSettingView.ClickListener {
|
||||
override fun showReportListWindow(show: Boolean) {
|
||||
if (show) {
|
||||
//打开工控机上报列表
|
||||
reportListFloatWindow =
|
||||
ReportListFloatWindow(context.applicationContext as Activity)
|
||||
reportListFloatWindow?.showFloatWindow()
|
||||
reportListFloatWindow?.refreshData(reportList)
|
||||
} else {
|
||||
//关闭工控机上报列表
|
||||
reportListFloatWindow?.hideFloatWindow()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
mDebugSettingViewFloat = WarningFloat.with(context)
|
||||
.setTag("DebugSettingView")
|
||||
.setLayout(mDebugSettingView!!)
|
||||
.setSidePattern(sidePattern)
|
||||
.setGravity(gravity, offsetY = 70)
|
||||
.setImmersionStatusBar(true)
|
||||
.setWindowHeight(AutoSizeUtils.dp2px(context, 1100f))
|
||||
.setWindowWidth(AutoSizeUtils.dp2px(context, 800f))
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: WindowManager.LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: WindowManager.LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.show()
|
||||
}
|
||||
}
|
||||
|
||||
private fun dismiss() {
|
||||
mDebugSettingViewFloat?.let {
|
||||
WarningFloat.dismiss(it.config.floatTag, false)
|
||||
mDebugSettingViewFloat = null
|
||||
mDebugSettingView = null
|
||||
//关闭工控机上报列表
|
||||
reportListFloatWindow?.hideFloatWindow()
|
||||
reportListFloatWindow = null
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
|
||||
import android.animation.Animator
|
||||
import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import android.view.animation.OvershootInterpolator
|
||||
import com.mogo.eagle.core.data.bindingcar.AdUpgradeStateHelper
|
||||
import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
|
||||
import com.mogo.eagle.core.data.enums.SidePattern
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
|
||||
import com.mogo.eagle.core.function.hmi.notification.anim.DefaultAnimator
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.SopView.Companion.sopView
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView.Companion.toggleDebugView
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.AutoPilotAndCheckView
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
|
||||
class ToolsView private constructor() {
|
||||
|
||||
companion object {
|
||||
val toolsView by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
ToolsView()
|
||||
}
|
||||
}
|
||||
|
||||
private var toolsView: AutoPilotAndCheckView? = null
|
||||
|
||||
// 检测、自动驾驶速度设置
|
||||
private var toolsViewFloat: WarningFloat.Builder? = null
|
||||
|
||||
fun showToolsFloat(context: Context?) {
|
||||
context?.let {
|
||||
if (toolsViewFloat == null) {
|
||||
if (toolsView == null) {
|
||||
toolsView = AutoPilotAndCheckView(it)
|
||||
toolsView!!.setClickListener(object : AutoPilotAndCheckView.ClickListener {
|
||||
override fun onClose(v: View) {
|
||||
dismissToolsFloatView()
|
||||
}
|
||||
|
||||
override fun showDebugPanelView() {
|
||||
toggleDebugView.toggle(it)
|
||||
}
|
||||
|
||||
override fun showFeedbackView() {
|
||||
dismissToolsFloatView()
|
||||
CallerDevaToolsManager.showFeedbackView(it)
|
||||
}
|
||||
|
||||
override fun showSOPSettingView() {
|
||||
sopView.toggle(it)
|
||||
}
|
||||
})
|
||||
}
|
||||
toolsViewFloat = WarningFloat.with(it)
|
||||
.setTag("ToolsViewFloat")
|
||||
.setLayout(toolsView!!)
|
||||
.setSidePattern(SidePattern.LEFT)
|
||||
.setGravity(Gravity.LEFT)
|
||||
.setImmersionStatusBar(true)
|
||||
.setWindowHeight(WindowManager.LayoutParams.MATCH_PARENT)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: WindowManager.LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: WindowManager.LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
toolsViewFloat = null
|
||||
toolsView = null
|
||||
}
|
||||
})
|
||||
.show()
|
||||
} else {
|
||||
toolsViewFloat?.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun showAdUpgradeStatus(ipcUpgradeStateInfo: IPCUpgradeStateInfo){
|
||||
toolsView?.showAdUpgradeStatus(ipcUpgradeStateInfo)
|
||||
ipcUpgradeStateInfo.status.let {
|
||||
if (AdUpgradeStateHelper.isUpgradeSuccess(it)) {
|
||||
ToastUtils.showLong("升级成功")
|
||||
AdUpgradeStateHelper.setConfirmUpgrade(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun dismissToolsFloatView() {
|
||||
toolsViewFloat?.let {
|
||||
WarningFloat.dismiss(it.config.floatTag, false)
|
||||
toolsViewFloat = null
|
||||
toolsView = null
|
||||
}
|
||||
}
|
||||
|
||||
fun dismiss() {
|
||||
dismissToolsFloatView()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.switch
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
|
||||
class DemoModeHiddenSwitch(context: Context?, attrs: AttributeSet?) : View(context, attrs) {
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
setOnClickListener {
|
||||
//只在司机端设置美化模式开关功能
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
//单次查询,是否有行程信息(订单进行中时点击不生效),autopilotControlParameters为null代表不处于自动驾驶状态下
|
||||
if (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().autopilotControlParameters == null) {
|
||||
FunctionBuildConfig.isDemoMode = !FunctionBuildConfig.isDemoMode
|
||||
context?.let {
|
||||
CallerHmiManager.updateStatusBarLeftView(
|
||||
FunctionBuildConfig.isDemoMode,
|
||||
"demoMode",
|
||||
DemoModeView(it)
|
||||
)
|
||||
}
|
||||
CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode)
|
||||
if (!FunctionBuildConfig.isDemoMode) {
|
||||
//关闭美化模式时,通知工控机
|
||||
CallerAutoPilotManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,16 +3,85 @@ package com.mogo.eagle.core.function.hmi.ui.takeover
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.zhidao.support.adas.high.common.MogoReport
|
||||
import mogo_msg.MogoReportMsg
|
||||
|
||||
class TakeOverView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "TakeOverView"
|
||||
}
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_take_over, this, true)
|
||||
}
|
||||
|
||||
private var takeOver = false
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
/**
|
||||
* 工控机监控节点上报
|
||||
*/
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
|
||||
super.onAutopilotGuardian(guardianInfo)
|
||||
ThreadUtils.runOnUiThread {
|
||||
guardianInfo?.let {
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
return@let
|
||||
}
|
||||
if (takeOver) {
|
||||
return@let
|
||||
}
|
||||
when (it.code) {
|
||||
MogoReport.Code.Error.EMAP.EXIT_AUTOPILOT_FOR_PLANNING,
|
||||
MogoReport.Code.Error.EMAP.EXIT_AUTOPILOT_FOR_LOCATION,
|
||||
MogoReport.Code.Error.EMAP.EXIT_AUTOPILOT_FOR_CHASSIS,
|
||||
MogoReport.Code.Error.EMAP.EXIT_AUTOPILOT_FOR_DISTANCE -> {
|
||||
CallerHmiManager.warningV2X(
|
||||
EventTypeEnum.TAKE_OVER_EVENT.poiType,
|
||||
EventTypeEnum.TAKE_OVER_EVENT.content,
|
||||
EventTypeEnum.TAKE_OVER_EVENT.tts,
|
||||
EventTypeEnum.TAKE_OVER_EVENT.poiType,
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
takeOver = true
|
||||
visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
override fun onDismiss() {
|
||||
takeOver = false
|
||||
visibility = View.GONE
|
||||
}
|
||||
},
|
||||
true,
|
||||
6000L
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
}
|
||||
}
|
||||
@@ -3,55 +3,79 @@ package com.mogo.eagle.core.function.hmi.ui.tools
|
||||
import android.content.Context
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.eagle.core.data.bindingcar.AdUpgradeStateHelper
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 工控机确认升级对话框
|
||||
* @since: 2022/1/13
|
||||
*/
|
||||
class AdUpgradeDialog(context: Context,images: List<String>,padSn: String,releaseId: String)
|
||||
: BaseFloatDialog(context), LifecycleObserver {
|
||||
class AdUpgradeDialog(context: Context, images: List<String>, padSn: String, releaseId: String) :
|
||||
BaseFloatDialog(context), LifecycleObserver {
|
||||
|
||||
private var upgradeConfirm : TextView? = null
|
||||
private var upgradeCancel : TextView? = null
|
||||
companion object {
|
||||
private var adUpgradeDialog: AdUpgradeDialog? = null
|
||||
|
||||
fun show(context: Context?, images: List<String>, padSn: String, releaseId: String) {
|
||||
context?.let {
|
||||
if (adUpgradeDialog == null) {
|
||||
adUpgradeDialog = AdUpgradeDialog(it, images, padSn, releaseId)
|
||||
}
|
||||
adUpgradeDialog?.let { dialog ->
|
||||
if (dialog.isShowing) {
|
||||
return
|
||||
}
|
||||
dialog.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var upgradeConfirm: TextView? = null
|
||||
private var upgradeCancel: TextView? = null
|
||||
|
||||
private var clickListener: ClickListener? = null
|
||||
|
||||
private var images: List<String>?=null
|
||||
private var padSn: String?=null
|
||||
private var releaseId: String?=null
|
||||
private var images: List<String>? = null
|
||||
private var padSn: String? = null
|
||||
private var releaseId: String? = null
|
||||
|
||||
init {
|
||||
setContentView(R.layout.dialog_ad_upgrade)
|
||||
setCanceledOnTouchOutside(false)
|
||||
upgradeConfirm=findViewById(R.id.tv_upgrade_confirm)
|
||||
upgradeCancel=findViewById(R.id.tv_upgrade_cancel)
|
||||
upgradeConfirm = findViewById(R.id.tv_upgrade_confirm)
|
||||
upgradeCancel = findViewById(R.id.tv_upgrade_cancel)
|
||||
|
||||
upgradeConfirm?.setOnClickListener{
|
||||
clickListener?.confirm()
|
||||
}
|
||||
upgradeCancel?.setOnClickListener {
|
||||
clickListener?.cancel()
|
||||
}
|
||||
this.images = images
|
||||
this.padSn = padSn
|
||||
this.releaseId = releaseId
|
||||
|
||||
upgradeConfirm?.setOnClickListener {
|
||||
//确认升级
|
||||
CallerDevaToolsManager.upgradeConfirm(images, padSn, releaseId)
|
||||
AdUpgradeStateHelper.setConfirmUpgrade(true)
|
||||
ToastUtils.showLong("最新版本下载中...")
|
||||
dismiss()
|
||||
}
|
||||
upgradeCancel?.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
adUpgradeDialog = null
|
||||
}
|
||||
|
||||
fun setClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
fun showUpgradeDialog(){
|
||||
if(isShowing){
|
||||
return
|
||||
}
|
||||
show()
|
||||
}
|
||||
|
||||
interface ClickListener{
|
||||
interface ClickListener {
|
||||
fun confirm()
|
||||
fun cancel()
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ import kotlin.system.exitProcess
|
||||
* @author ChenFufeng
|
||||
* 设置自动驾驶速度和检测页入口
|
||||
*/
|
||||
class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
internal class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
@@ -165,7 +165,7 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
MsgBoxConfig.setUserRecord(0)
|
||||
}
|
||||
actvLoginout.visibility = View.VISIBLE
|
||||
CallerHmiManager.setBusOperationView(toolBusOperationView)
|
||||
toolBusOperationView.showBusOperation()
|
||||
|
||||
// TODO 这里判断方式可以替换为使用 AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)等进行替换
|
||||
when (DebugConfig.getProductFlavor()) {
|
||||
@@ -199,7 +199,6 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
systemVersionView?.showAdUpgradeStatus(ipcUpgradeStateInfo)
|
||||
}
|
||||
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
|
||||
@@ -4,9 +4,9 @@ import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.temp.EventLogout
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IOchBusView
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
@@ -23,7 +23,7 @@ class BusOperationView @JvmOverloads constructor(
|
||||
context: Context?,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0)
|
||||
: IOchBusView(context, attrs, defStyleAttr) {
|
||||
: LinearLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_och_bus_operation,this,true)
|
||||
@@ -47,15 +47,11 @@ class BusOperationView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
override fun showBusOperation() {
|
||||
fun showBusOperation() {
|
||||
ochBusOperationStatus.visibility = View.VISIBLE
|
||||
initPersonalIcon()
|
||||
}
|
||||
|
||||
override fun changerOperationStatus(isOut: Boolean) {
|
||||
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
context?.let {
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.tools
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.FrameLayout
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* 蒙层view
|
||||
*/
|
||||
class MaskView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : FrameLayout(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
) {
|
||||
|
||||
private val TAG = "MaskView"
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_mask, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
companion object {
|
||||
private var speedLimit: Double = 0.0
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
private fun initView() {
|
||||
// background = ColorDrawable(Color.parseColor("#F0151D41"))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.tools
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.ToolsView_TAG
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
|
||||
class ToolsImageView(context: Context, attrs: AttributeSet?) :
|
||||
androidx.appcompat.widget.AppCompatImageView(context, attrs), IViewControlListener {
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
setBackgroundResource(R.drawable.module_ext_check)
|
||||
setImageResource(R.drawable.icon_tools_nor)
|
||||
scaleType = ScaleType.CENTER
|
||||
|
||||
CallerHmiViewControlListenerManager.addListener(ToolsView_TAG, this)
|
||||
}
|
||||
|
||||
override fun visible(v: Int) {
|
||||
super.visible(v)
|
||||
visibility = v
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerHmiViewControlListenerManager.removeListener(ToolsView_TAG)
|
||||
}
|
||||
}
|
||||
@@ -8,11 +8,14 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.AutoPilotStatusView_TAG
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lat
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lon
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
@@ -25,18 +28,21 @@ import kotlinx.android.synthetic.main.view_autopilot_status.view.*
|
||||
* @date 2021/9/22 3:59 下午
|
||||
* 自动驾驶状态按钮
|
||||
*/
|
||||
class AutoPilotStatusView @JvmOverloads constructor(
|
||||
class AutoPilotStatusView constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet
|
||||
) : ConstraintLayout(context, attrs),
|
||||
View.OnClickListener,
|
||||
IMoGoAutopilotStatusListener {
|
||||
IMoGoAutopilotStatusListener, IViewControlListener {
|
||||
|
||||
private val TAG = "AutopilotStatusView"
|
||||
companion object {
|
||||
const val TAG = "AutopilotStatusView"
|
||||
}
|
||||
|
||||
private var mAutopilotStatus: Int = 0
|
||||
|
||||
init {
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
initView(context)
|
||||
}
|
||||
|
||||
@@ -51,18 +57,22 @@ class AutoPilotStatusView @JvmOverloads constructor(
|
||||
setOnClickListener(this)
|
||||
// 自动驾驶状态监听
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerHmiViewControlListenerManager.addListener(AutoPilotStatusView_TAG, this)
|
||||
|
||||
CallerLogger.d("$M_HMI$TAG", "autopilotStatus: $mAutopilotStatus")
|
||||
setAutoPilotStatus(mAutopilotStatus)
|
||||
}
|
||||
|
||||
override fun visible(v: Int) {
|
||||
super.visible(v)
|
||||
visibility = v
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
when (mAutopilotStatus) {
|
||||
0 -> {// 不可自动驾驶,adas与工控机没有链接,或工控机异常
|
||||
CallerLogger.e("$M_HMI$TAG", "不可自动驾驶,adas与工控机没有链接,或工控机异常,请检查")
|
||||
ToastUtils.showShort("不可自动驾驶,adas与工控机没有链接,或工控机异常,请检查")
|
||||
// TODO 这里临时触发自动驾驶能力,测试功过这里删除
|
||||
//CallerHmiListenerManager.invokeCheckAutoPilotBtnListener(true)
|
||||
}
|
||||
1 -> {// 可自动驾驶,目前处于人工干预状态
|
||||
CallerHmiListenerManager.invokeCheckAutoPilotBtnListener(true)
|
||||
@@ -85,7 +95,7 @@ class AutoPilotStatusView @JvmOverloads constructor(
|
||||
currentAutopilot.endName = "HYJC"
|
||||
currentAutopilot.isSpeakVoice = false
|
||||
currentAutopilot.startLatLon =
|
||||
AutopilotControlParameters.AutoPilotLonLat(getCurWgs84Lat(),getCurWgs84Lon())
|
||||
AutopilotControlParameters.AutoPilotLonLat(getCurWgs84Lat(), getCurWgs84Lon())
|
||||
currentAutopilot.endLatLon =
|
||||
AutopilotControlParameters.AutoPilotLonLat(26.819716071924688, 112.57715442110867)
|
||||
currentAutopilot.vehicleType = 10
|
||||
@@ -126,4 +136,10 @@ class AutoPilotStatusView @JvmOverloads constructor(
|
||||
setAutoPilotStatus(autoPilotStatusInfo.state)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
CallerHmiViewControlListenerManager.removeListener(AutoPilotStatusView_TAG)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.CameraView_TAG
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
|
||||
class CameraView(context: Context, attrs: AttributeSet?) :
|
||||
androidx.appcompat.widget.AppCompatImageView(context, attrs), IViewControlListener {
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
setBackgroundResource(R.drawable.icon_camera_nor)
|
||||
CallerHmiViewControlListenerManager.addListener(CameraView_TAG, this)
|
||||
}
|
||||
|
||||
override fun visible(v: Int) {
|
||||
super.visible(v)
|
||||
visibility = v
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerHmiViewControlListenerManager.removeListener(CameraView_TAG)
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,9 @@ import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.FrameLayout
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.PerspectiveSwitchView_TAG
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
@@ -19,12 +22,20 @@ class PerspectiveSwitchView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : FrameLayout(context, attrs, defStyleAttr), View.OnClickListener {
|
||||
) : FrameLayout(context, attrs, defStyleAttr), View.OnClickListener, IViewControlListener{
|
||||
|
||||
init {
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
LayoutInflater.from(context).inflate(R.layout.view_perspective_switch, this, true)
|
||||
setBackgroundResource(R.drawable.module_switch_map_bg)
|
||||
setOnClickListener(this)
|
||||
|
||||
CallerHmiViewControlListenerManager.addListener(PerspectiveSwitchView_TAG,this)
|
||||
}
|
||||
|
||||
override fun visible(v: Int) {
|
||||
super.visible(v)
|
||||
visibility = v
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
@@ -41,4 +52,10 @@ class PerspectiveSwitchView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerHmiViewControlListenerManager.removeListener(PerspectiveSwitchView_TAG)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,8 +6,11 @@ import android.util.AttributeSet
|
||||
import android.view.Gravity
|
||||
import android.widget.FrameLayout
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.SpeedPanelView_TAG
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
@@ -22,7 +25,7 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : FrameLayout(context, attrs, defStyleAttr), IMoGoChassisLocationGCJ02Listener {
|
||||
) : FrameLayout(context, attrs, defStyleAttr), IMoGoChassisLocationGCJ02Listener,IViewControlListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "SpeedPanelView"
|
||||
@@ -38,7 +41,6 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
init {
|
||||
initEvent()
|
||||
setBackgroundResource(R.drawable.yi_biao_pan_bg_nor)
|
||||
mContext = context
|
||||
mSpeedChartView = SpeedChartView(context)
|
||||
@@ -52,17 +54,13 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
addView(mSpeedChartView)
|
||||
}
|
||||
|
||||
private fun initEvent() {
|
||||
setOnLongClickListener {
|
||||
CallerHmiManager.toggleDebugView()
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
private var timerTask: TimerTask? = null
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow() // 注册位置回调
|
||||
super.onAttachedToWindow()
|
||||
// 注册view控制显示隐藏监听
|
||||
CallerHmiViewControlListenerManager.addListener(SpeedPanelView_TAG,this)
|
||||
// 注册位置回调
|
||||
CallerChassisLocationGCJ20ListenerManager.addListener(TAG, this)
|
||||
// 开启定时查询速度
|
||||
timerTask?.cancel()
|
||||
@@ -91,9 +89,15 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
override fun visible(v: Int) {
|
||||
super.visible(v)
|
||||
visibility = v
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
// 解除注册
|
||||
CallerHmiViewControlListenerManager.removeListener(SpeedPanelView_TAG)
|
||||
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
|
||||
try {
|
||||
timerTask?.cancel()
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.*
|
||||
import android.widget.*
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import android.widget.LinearLayout
|
||||
import com.mogo.eagle.core.data.mofang.MfConstants
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
||||
import com.mogo.eagle.core.function.call.devatools.*
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ScreenUtils
|
||||
import kotlinx.android.synthetic.main.view_status_bar.view.*
|
||||
import java.util.concurrent.CopyOnWriteArrayList
|
||||
|
||||
@@ -20,7 +21,7 @@ class StatusBarView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : LinearLayout(context, attrs, defStyleAttr), IMoGoSkinModeChangeListener {
|
||||
) : LinearLayout(context, attrs, defStyleAttr), IMoGoSkinModeChangeListener, IViewControlListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "StatusBarView"
|
||||
@@ -37,17 +38,19 @@ class StatusBarView @JvmOverloads constructor(
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
viewStatusBarRight.addView(BatteryGroupView(this.context))
|
||||
|
||||
//将状态窗口中的状态移到状态栏上
|
||||
CallerDevaToolsManager.showStatusBar(context, status_container)
|
||||
|
||||
// 添加换肤监听
|
||||
CallerSkinModeListenerManager.addListener(TAG, this)
|
||||
|
||||
var isBluetoothConnect = SharedPrefsMgr.getInstance(context).getBoolean(MfConstants.BLUETOOTH_STATUS, false)
|
||||
val isBluetoothConnect =
|
||||
SharedPrefsMgr.getInstance(context).getBoolean(MfConstants.BLUETOOTH_STATUS, false)
|
||||
if (isBluetoothConnect) {
|
||||
updateMfStatus("MoFangManager", true)
|
||||
}
|
||||
|
||||
//添加view控制
|
||||
CallerHmiViewControlListenerManager.addListener(TAG,this)
|
||||
// 添加换肤监听
|
||||
CallerSkinModeListenerManager.addListener(TAG, this)
|
||||
//将状态窗口中的状态移到状态栏上
|
||||
CallerDevaToolsManager.showStatusBar(context, status_container)
|
||||
|
||||
}
|
||||
|
||||
override fun onSkinModeChange(skinMode: Int) {
|
||||
@@ -57,15 +60,13 @@ class StatusBarView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
fun setStatusBarDarkOrLight(light: Boolean) {
|
||||
if (light) {
|
||||
setTextColor(resources.getColor(R.color.color_2C2E30))
|
||||
} else {
|
||||
setTextColor(resources.getColor(R.color.color_FFFFFF))
|
||||
}
|
||||
override fun setStatusBarDarkOrLight(light: Boolean) = if (light) {
|
||||
setTextColor(resources.getColor(R.color.color_2C2E30))
|
||||
} else {
|
||||
setTextColor(resources.getColor(R.color.color_FFFFFF))
|
||||
}
|
||||
|
||||
fun updateRightView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
||||
override fun updateStatusBarRightView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
||||
if (insert) {
|
||||
rightViewList.add(0, tag)
|
||||
viewStatusBarRight.addView(viewGroup, 0)
|
||||
@@ -79,7 +80,7 @@ class StatusBarView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
fun updateLeftView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
||||
override fun updateStatusBarLeftView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
||||
if (insert) {
|
||||
leftViewList.add(0, tag)
|
||||
viewStatusBarLeft.addView(viewGroup, 0)
|
||||
@@ -93,7 +94,8 @@ class StatusBarView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
fun updateProgressView(insert: Boolean, tag: String, progress: Int) {
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun updateStatusBarDownloadView(insert: Boolean, tag: String, progress: Int) {
|
||||
if (insert) {
|
||||
viewProgressTv.visibility = VISIBLE
|
||||
viewProgressTv.text = "$progress%"
|
||||
@@ -102,7 +104,7 @@ class StatusBarView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
fun updateMfStatus(tag: String, status: Boolean) {
|
||||
override fun updateMfStatus(tag: String, status: Boolean) {
|
||||
if (status) {
|
||||
viewMofangStatus.setImageResource(R.drawable.icon_bluetooth_p)
|
||||
} else {
|
||||
@@ -117,6 +119,7 @@ class StatusBarView @JvmOverloads constructor(
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerHmiViewControlListenerManager.removeListener(TAG)
|
||||
CallerSkinModeListenerManager.removeListener(TAG)
|
||||
CallerDevaToolsManager.hideStatusBar()
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ class V2XNotificationView @JvmOverloads constructor(
|
||||
defStyleAttr: Int = 0
|
||||
) : IViewNotification(context, attrs, defStyleAttr) {
|
||||
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.notification_v2x_msg_vr, this, true)
|
||||
// 设置View的出场位置
|
||||
|
||||
@@ -3,49 +3,71 @@ package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.vip.IMoGoVipSetListener
|
||||
import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import kotlinx.android.synthetic.main.view_vip_identification.view.*
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
|
||||
/**
|
||||
* VIP标识控件
|
||||
*/
|
||||
class VipIdentificationView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
class VipIdentificationView : ConstraintLayout, IMoGoVipSetListener {
|
||||
|
||||
init {
|
||||
companion object {
|
||||
const val TAG = "VipIdentificationView"
|
||||
}
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet) : this(context, attributeSet, 0) {
|
||||
}
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attributeSet,
|
||||
defStyleAttr
|
||||
) {
|
||||
init(attributeSet, defStyleAttr)
|
||||
}
|
||||
|
||||
private var marginStart: Float = 0.0f
|
||||
private var marginTop: Float = 0.0f
|
||||
|
||||
private fun init(attrs: AttributeSet, defStyleAttr: Int) {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_vip_identification, this, true)
|
||||
val a = context.obtainStyledAttributes(
|
||||
attrs,
|
||||
R.styleable.VipIdentificationView,
|
||||
defStyleAttr,
|
||||
0
|
||||
)
|
||||
marginStart = a.getDimension(R.styleable.VipIdentificationView_marginStart, 0.0f)
|
||||
marginTop = a.getDimension(R.styleable.VipIdentificationView_marginTop, 0.0f)
|
||||
a.recycle()
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
val lp = this.layoutParams as LayoutParams
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||
&& AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left_bus_passenger).toInt()
|
||||
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top_passenger).toInt()
|
||||
} else if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)
|
||||
&& AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left_taxi_passenger).toInt()
|
||||
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top_passenger).toInt()
|
||||
} else {
|
||||
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left).toInt()
|
||||
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top).toInt()
|
||||
}
|
||||
lp.marginStart = marginStart.toInt()
|
||||
lp.topMargin = marginTop.toInt()
|
||||
this.layoutParams = lp
|
||||
invalidate()
|
||||
CallVipSetListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
fun setVipIdentificationVisible(visible: Boolean) {
|
||||
UiThreadHandler.post {
|
||||
ivVipIdentification.visibility = visibility
|
||||
override fun onVipSet(status: Boolean) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
visibility = if (status) {
|
||||
View.VISIBLE
|
||||
} else {
|
||||
View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallVipSetListenerManager.removeListener(TAG)
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,7 @@ import com.mogo.eagle.core.data.config.HdMapBuildConfig;
|
||||
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView;
|
||||
@@ -137,7 +138,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
|
||||
View statusBarView = decorView.findViewWithTag("status_bar");
|
||||
if (statusBarView == null) {
|
||||
statusBarView = new StatusBarView(this);
|
||||
statusBarView = getStatusBarView();
|
||||
statusBarView.setTag("status_bar");
|
||||
}
|
||||
FrameLayout.LayoutParams statusBarLP =
|
||||
@@ -147,6 +148,14 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
decorView.addView(statusBarView, statusBarLP);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改statusBar 重写实现,需要继承 StatusBarView,xml中基础系统控件不要修改其id,拿来即用
|
||||
* @return StatusBarView
|
||||
*/
|
||||
protected StatusBarView getStatusBarView(){
|
||||
return new StatusBarView(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -163,6 +172,9 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
DisplayEffectsHelper.getInstance().init(clSpecialEffect);
|
||||
|
||||
mPresenter.checkPermission(this);
|
||||
|
||||
// 同步AppInfo Config信息
|
||||
CallerDevaToolsManager.INSTANCE.syncConfig();
|
||||
}
|
||||
|
||||
private void calculateStartTime() {
|
||||
|
||||
@@ -213,13 +213,13 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_V2X_OBU_MOGO, "IMoGoObuProvider"));
|
||||
// BIZ
|
||||
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_FUNC_BIZ, "IMoGoNoticeProvider"));
|
||||
// 车聊聊,IM
|
||||
// todo 后置 车聊聊,IM
|
||||
MogoModulePaths.addModuleFunctionServer(new MogoModule(ChatConsts.CHAT_PROVIDER_PATH, ChatConsts.CHAT_MODULE_NAME));
|
||||
// V2X 模块
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_V2X_MODULE, "V2XProvider"));
|
||||
// 司机身份专属模块
|
||||
// 司机身份专属
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
// 地图数据收集模块
|
||||
// todo 后置 地图数据收集模块
|
||||
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_MAP_DATA_COLLECT_PROVIDER, "MoGoMapDataCollector"));
|
||||
}
|
||||
CallerLogger.INSTANCE.i(M_HMI + TAG, "App launch timer cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<!-- <corners android:radius="@dimen/module_mogo_och_autopilot_status_bg_corner" />-->
|
||||
<gradient
|
||||
android:startColor="#323C6F"
|
||||
android:endColor="#323C6F"
|
||||
android:angle="315"
|
||||
/>
|
||||
<size
|
||||
android:width="120dp"
|
||||
android:height="120dp"
|
||||
/>
|
||||
</shape>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:width="112dp"
|
||||
android:height="112dp"
|
||||
android:drawable="@drawable/bg_operation_status_bg" />
|
||||
<item
|
||||
android:width="80dp"
|
||||
android:height="80dp"
|
||||
android:gravity="center">
|
||||
<bitmap android:src="@drawable/toggle_setting_btn_bg" />
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -28,26 +28,15 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="72dp">
|
||||
<!--脉速表-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SpeedPanelView
|
||||
android:id="@+id/viewSpeedChart"
|
||||
android:layout_width="@dimen/module_ext_speed_width"
|
||||
android:layout_height="@dimen/module_ext_speed_height"
|
||||
android:layout_marginLeft="@dimen/module_mogo_autopilot_status_margin_left"
|
||||
android:layout_marginTop="@dimen/module_ext_arcView_top"
|
||||
android:elevation="@dimen/dp_10"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--Vip车辆标志-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
||||
android:id="@+id/flVipIdentificationView"
|
||||
android:layout_width="@dimen/module_vip_width"
|
||||
android:layout_height="@dimen/module_vip_height"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--接管提示-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.takeover.TakeOverView
|
||||
android:id="@+id/clTakeOverView"
|
||||
android:layout_width="@dimen/hmi_take_over_request_width"
|
||||
@@ -58,25 +47,13 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--自动驾驶按钮及状态-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.AutoPilotStatusView
|
||||
android:id="@+id/viewAutopilotStatus"
|
||||
android:layout_width="@dimen/module_mogo_autopilot_status_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_autopilot_status_bg_height"
|
||||
android:layout_marginTop="@dimen/module_mogo_autopilot_status_margin_top"
|
||||
android:elevation="@dimen/dp_10"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/viewSpeedChart"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewSpeedChart"
|
||||
app:layout_goneMarginStart="@dimen/module_mogo_autopilot_status_margin_left" />
|
||||
|
||||
<!--超视距-->
|
||||
<ImageView
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.CameraView
|
||||
android:id="@+id/ivCameraIcon"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginTop="45dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:background="@drawable/icon_camera_nor"
|
||||
app:layout_constraintRight_toLeftOf="@id/viewTrafficLightVr"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
@@ -102,65 +79,15 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
|
||||
|
||||
<View
|
||||
<!--隐藏态下的 美化模式按钮-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.switch.DemoModeHiddenSwitch
|
||||
android:id="@+id/viewDemoModeSwitch"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="100dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginStart="40dp"
|
||||
android:layout_marginBottom="200dp"
|
||||
/>
|
||||
|
||||
<!--工具箱-->
|
||||
<ImageView
|
||||
android:id="@+id/ivToolsIcon"
|
||||
android:layout_width="@dimen/module_hmi_check_size"
|
||||
android:layout_height="@dimen/module_hmi_check_size"
|
||||
android:layout_marginLeft="25dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:background="@drawable/module_ext_check"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/icon_tools_nor"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/viewPerspectiveSwitch"
|
||||
app:layout_goneMarginStart="50dp" />
|
||||
|
||||
<!--问题反馈-->
|
||||
<ImageView
|
||||
android:id="@+id/ivBadCaseTools"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginStart="50dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:src="@drawable/bad_case_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/ivToolsIcon" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivAiCollectTools"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginStart="50dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:src="@drawable/ai_collect_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/ivBadCaseTools" />
|
||||
|
||||
<View
|
||||
android:id="@+id/viewUpgradeTips"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:background="@drawable/version_upgrade_tips_background"
|
||||
android:translationZ="30dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintCircle="@id/ivToolsIcon"
|
||||
app:layout_constraintCircleAngle="45"
|
||||
app:layout_constraintCircleRadius="60dp"
|
||||
tools:ignore="MissingConstraints" />
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!--限速牌子-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
|
||||
@@ -187,14 +114,14 @@
|
||||
android:id="@+id/cbMsgBoxDriver"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
|
||||
app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:button="@null"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:background="@drawable/selector_msg_box"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
android:button="@null"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon" />
|
||||
|
||||
<!--司机端消息提示-->
|
||||
<View
|
||||
android:id="@+id/MsgBoxTipView"
|
||||
@@ -202,26 +129,24 @@
|
||||
android:layout_height="8dp"
|
||||
android:background="@drawable/version_upgrade_tips_background"
|
||||
android:translationZ="30dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintCircle="@id/cbMsgBoxDriver"
|
||||
app:layout_constraintCircleAngle="40"
|
||||
app:layout_constraintCircleRadius="32dp"
|
||||
tools:ignore="MissingConstraints"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<!--消息盒子乘客端选择入口-->
|
||||
<CheckBox
|
||||
android:id="@+id/cbMsgBoxPassenger"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginStart="320dp"
|
||||
android:layout_marginBottom="50dp"
|
||||
android:button="@null"
|
||||
android:background="@drawable/selector_msg_box_p"
|
||||
android:button="@null"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<!--乘客端消息提示-->
|
||||
<View
|
||||
@@ -230,54 +155,49 @@
|
||||
android:layout_height="15dp"
|
||||
android:background="@drawable/version_upgrade_tips_background"
|
||||
android:translationZ="30dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintCircle="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintCircleAngle="40"
|
||||
app:layout_constraintCircleRadius="50dp"
|
||||
tools:ignore="MissingConstraints"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView
|
||||
android:id="@+id/viewDriverMsgBoxList"
|
||||
android:layout_width="864px"
|
||||
android:layout_height="746px"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView
|
||||
android:id="@+id/viewDriverMsgBoxBubble"
|
||||
android:layout_width="864px"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
android:visibility="visible"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxBubbleView
|
||||
android:id="@+id/viewPassengerMsgBoxBubble"
|
||||
android:layout_width="650px"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toTopOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintRight_toRightOf="@id/cbMsgBoxPassenger"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
app:layout_constraintBottom_toTopOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintRight_toRightOf="@id/cbMsgBoxPassenger" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxListView
|
||||
android:id="@+id/viewPassengerMsgBoxList"
|
||||
android:layout_width="650px"
|
||||
android:layout_height="750px"
|
||||
app:layout_constraintBottom_toTopOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintRight_toRightOf="@id/cbMsgBoxPassenger"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
app:layout_constraintBottom_toTopOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintRight_toRightOf="@id/cbMsgBoxPassenger" />
|
||||
|
||||
<!--左右转向灯-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.turnlight.TurnLightViewStatus
|
||||
@@ -299,6 +219,7 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -327,8 +248,4 @@
|
||||
app:layout_goneMarginTop="30dp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="#00000000"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivWaringIcon"
|
||||
android:layout_width="132dp"
|
||||
android:layout_height="132dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -50,8 +50,8 @@
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="TapPositionView">
|
||||
<attr name="defaultColor" format="color"/> <!--档位默认色值-->
|
||||
<attr name="selectColor" format="color"/> <!--当前档位色值-->
|
||||
<attr name="defaultColor" format="color" /> <!--档位默认色值-->
|
||||
<attr name="selectColor" format="color" /> <!--当前档位色值-->
|
||||
</declare-styleable>
|
||||
|
||||
<style name="BaseFloatDialogStyle" parent="@android:style/Theme.Dialog">
|
||||
@@ -68,4 +68,10 @@
|
||||
<item name="android:topDark">@android:color/transparent</item>
|
||||
<item name="android:borderlessButtonStyle">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
<declare-styleable name="VipIdentificationView">
|
||||
<attr name="marginStart" format="dimension" />
|
||||
<attr name="marginTop" format="dimension" />
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
||||
@@ -1,16 +1,16 @@
|
||||
package com.mogo.eagle.core.function.business.routeoverlay;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningTrajectoryListener;
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningTrajectoryListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -26,7 +26,7 @@ import system_master.SystemStatusInfo;
|
||||
public class MogoRouteOverlayManager implements
|
||||
IMoGoPlanningTrajectoryListener,
|
||||
IMoGoAutopilotStatusListener,
|
||||
IMoGoMapLocationListener {
|
||||
IMoGoChassisLocationGCJ02Listener {
|
||||
private static volatile MogoRouteOverlayManager sInstance;
|
||||
private static final String TAG = "Route";
|
||||
|
||||
@@ -35,13 +35,14 @@ public class MogoRouteOverlayManager implements
|
||||
|
||||
private final LinkedList<List<MessagePad.TrajectoryPoint>> queue = new LinkedList<>();
|
||||
|
||||
private MogoRouteOverlayManager() {}
|
||||
private MogoRouteOverlayManager() {
|
||||
}
|
||||
|
||||
|
||||
public void init() {
|
||||
CallerPlanningTrajectoryListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerMapLocationListenerManager.INSTANCE.addListener(TAG, this, false);
|
||||
CallerChassisLocationGCJ20ListenerManager.INSTANCE.addListener(TAG, this);
|
||||
}
|
||||
|
||||
public static MogoRouteOverlayManager getInstance() {
|
||||
@@ -64,10 +65,10 @@ public class MogoRouteOverlayManager implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(@org.jetbrains.annotations.Nullable MogoLocation location, int from, boolean isGps) {
|
||||
// if (from != 1 || location == null) {
|
||||
// return;
|
||||
// }
|
||||
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
|
||||
if (gnssInfo == null) {
|
||||
return;
|
||||
}
|
||||
if (isArriveAtStation.get() && autopilotMode.get() != 1) {
|
||||
RouteOverlayDrawer.getInstance().clearMogoRouteOverlay();
|
||||
return;
|
||||
@@ -81,7 +82,7 @@ public class MogoRouteOverlayManager implements
|
||||
if (!queue.isEmpty()) {
|
||||
List<MessagePad.TrajectoryPoint> items = queue.pollLast();
|
||||
if (items != null && !items.isEmpty()) {
|
||||
RouteOverlayDrawer.getInstance().drawTrajectoryList(items, location.getBearing());
|
||||
RouteOverlayDrawer.getInstance().drawTrajectoryList(items, gnssInfo.getHeading());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -122,5 +123,6 @@ public class MogoRouteOverlayManager implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) {}
|
||||
public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,13 +7,11 @@ import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.function.api.map.IMogoMapService;
|
||||
import com.mogo.eagle.core.function.api.map.marker.IMogoMarkerService;
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager;
|
||||
import com.mogo.map.MogoLocationClient;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.map.MogoMarkerManager;
|
||||
import com.mogo.map.MogoOverlayManager;
|
||||
import com.mogo.map.location.GDLocationClient;
|
||||
import com.mogo.map.location.IMogoGDLocationClient;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.marker.IMogoMarkerManager;
|
||||
import com.mogo.map.overlay.IMogoOverlayManager;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
@@ -27,11 +25,6 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
@Route(path = MogoServicePaths.PATH_SERVICES_MAP)
|
||||
public class MogoMapService implements IMogoMapService {
|
||||
|
||||
@Override
|
||||
public IMogoLocationClient getSingletonLocationClient(Context context) {
|
||||
return MogoLocationClient.getInstance(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMarkerManager getMarkerManager(Context context) {
|
||||
return MogoMarkerManager.getInstance(context);
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.mogo.eagle.core.function.map
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.map.MogoMapView
|
||||
|
||||
class MapBizView(context: Context?) : MogoMapView(context) {
|
||||
|
||||
override fun onCreate(bundle: Bundle?) {
|
||||
super.onCreate(bundle)
|
||||
map.uiController.showMyLocation(true)
|
||||
// 添加Caller监听
|
||||
// CallerSkinModeListenerManager.addListener(MapFragment.functionName, this)
|
||||
//
|
||||
// CallerChassisLocationWGS84ListenerManager.addListener(MapFragment.functionName, this)
|
||||
// CallerChassisLamplightListenerManager.addListener(MapFragment.functionName, this)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -60,7 +60,6 @@ class MapFragment : MvpFragment<MapView?, MapPresenter?>(),
|
||||
|
||||
private var mMogoMapView: MogoMapView? = null
|
||||
private var mMogoMap: IMogoMap? = null
|
||||
private val mIsControllerByOthersStatus = false
|
||||
|
||||
companion object {
|
||||
const val functionName = "MapFragment"
|
||||
@@ -140,9 +139,6 @@ class MapFragment : MvpFragment<MapView?, MapPresenter?>(),
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
if (mIsControllerByOthersStatus) {
|
||||
return
|
||||
}
|
||||
if (mMogoMapView != null) {
|
||||
mMogoMapView!!.onPause()
|
||||
} else {
|
||||
@@ -152,9 +148,6 @@ class MapFragment : MvpFragment<MapView?, MapPresenter?>(),
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
if (mIsControllerByOthersStatus) {
|
||||
return
|
||||
}
|
||||
if (mMogoMapView != null) {
|
||||
mMogoMapView!!.onResume()
|
||||
} else {
|
||||
@@ -384,11 +377,6 @@ class MapFragment : MvpFragment<MapView?, MapPresenter?>(),
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotBrakeLightData(brakeLight: Boolean) {
|
||||
d(SceneConstant.M_DEVA + "TurnLight", "---onAutopilotBrakeLightData ---brakeLight = $brakeLight")
|
||||
|
||||
}
|
||||
|
||||
private fun setTurnLightState(turn_light: Int): Int {
|
||||
if (turn_light == 0) {
|
||||
if (isOnTurnLight) {
|
||||
|
||||
@@ -372,6 +372,7 @@ public class AMapCustomView
|
||||
drawInfMarkers(pathMap);
|
||||
}
|
||||
|
||||
//todo 扶风 需重构此处,封装至 全览
|
||||
public void drawInfMarkers(Map<String, ArrayList<Infrastructure>> infStruMap) {
|
||||
// 绘制新基建数据
|
||||
if (!posInfMap.isEmpty()) {
|
||||
|
||||
@@ -33,6 +33,13 @@
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name="com.mogo.eagle.core.function.obu.mogo.receiver.ObuTestNewObuRsiReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.obu.test_newobu_rsi" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -32,7 +32,9 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
}
|
||||
|
||||
override fun init(context: Context) {
|
||||
CallerLogger.d("$M_OBU$TAG", "初始化蘑菇自研OBU…… localIp = " + CommonUtils.getLocalIPAddress() + "--")
|
||||
//obu融合数据
|
||||
// MogoObuDcCombineManager.INSTANCE.init(context)
|
||||
CallerLogger.d("$M_OBU$TAG", "初始化蘑菇自研OBU…… localIp = " + CommonUtils.getLocalIPAddress())
|
||||
//bus乘客版本obu功能去掉
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(
|
||||
FunctionBuildConfig.appIdentityMode
|
||||
@@ -55,8 +57,6 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
|
||||
//old obu
|
||||
MogoPrivateObuManager.INSTANCE.init(context, ipAddress)
|
||||
CallerLogger.d("$M_OBU$TAG", "bus 司机 ipAddress = $ipAddress ---localIp = ${CommonUtils.getIpAddressString()}")
|
||||
|
||||
} else if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) { //taxi 司机端和乘客端
|
||||
val ipAddress =
|
||||
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, taxiObuIp)
|
||||
@@ -69,7 +69,6 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
|
||||
//old obu
|
||||
MogoPrivateObuManager.INSTANCE.init(context, ipAddress)
|
||||
CallerLogger.d("$M_OBU$TAG", "taxi 司机端和乘客端 ipAddress = $ipAddress ---localIp = ${CommonUtils.getIpAddressString()}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,16 +2,13 @@ package com.mogo.eagle.core.function.obu.mogo
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.enums.EventTypeHelper
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
@@ -19,12 +16,18 @@ import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Default
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.TooClose
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager
|
||||
import com.mogo.eagle.core.function.obu.mogo.utils.TrafficDataConvertUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.enums.EventTypeHelper
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
//import com.mogo.service.IMogoServiceApis
|
||||
import com.zhidao.support.obu.MogoObuManager
|
||||
import com.zhidao.support.obu.OnMogoObuListener
|
||||
import com.zhidao.support.obu.constants.ObuConstants
|
||||
@@ -45,11 +48,14 @@ class MogoPrivateObuManager private constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
// private var mMogoServiceApis: IMogoServiceApis? = null
|
||||
private var mContext: Context? = null
|
||||
private var mObuStatusInfo = CallerObuListenerManager.getObuStatusInfo()
|
||||
|
||||
fun init(context: Context, ipAddress: String) {
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "obuManager初始化--")
|
||||
// mMogoServiceApis = ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS)
|
||||
// .navigation(context) as IMogoServiceApis
|
||||
mContext = context
|
||||
//连接obu设备
|
||||
connectObu(context, ipAddress)
|
||||
@@ -226,7 +232,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
|
||||
// (3) 道路事件预警信息:CVX_RTI_THREAT_IND
|
||||
override fun onCvxRtiThreatIndInfo(info: CvxRtiThreatIndInfo?) {
|
||||
if (HmiBuildConfig.isShowObuV2iView) {
|
||||
// if (HmiBuildConfig.isShowObuV2iView) {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"onCvxRtiThreatIndInfo ------> $info"
|
||||
@@ -322,8 +328,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
}
|
||||
//事故易发路段
|
||||
0x1B -> {
|
||||
appId =
|
||||
EventTypeEnum.TYPE_USECASE_ID_ROAD_COLLISION_WARNING.poiType
|
||||
appId = EventTypeEnum.TYPE_USECASE_ID_ROAD_COLLISION_WARNING.poiType
|
||||
}
|
||||
//环岛行驶
|
||||
0x1C -> {
|
||||
@@ -370,21 +375,16 @@ class MogoPrivateObuManager private constructor() {
|
||||
// 添加
|
||||
ObuConstants.STATUS.ADD -> {
|
||||
//不显示弹框,其它保留
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"old onCvxRtiThreatIndInfo ------> appId = $appId --- alertContent = $alertContent --- ttsContent = $ttsContent "
|
||||
)
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "old onCvxRtiThreatIndInfo ------> appId = $appId --- alertContent = $alertContent --- ttsContent = $ttsContent ")
|
||||
if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) {
|
||||
Log.d("MsgBox-PriObuManager4", "alertContent或ttsContent为空!")
|
||||
}
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.OBU,
|
||||
V2XMsg(
|
||||
appId,
|
||||
V2XMsg(appId,
|
||||
alertContent,
|
||||
ttsContent
|
||||
)
|
||||
ttsContent)
|
||||
)
|
||||
)
|
||||
CallerHmiManager.warningV2X(
|
||||
@@ -432,8 +432,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
// (4) V2I预警信息:CVX_IVP_THREAT_IND,红绿灯
|
||||
@@ -447,20 +446,20 @@ class MogoPrivateObuManager private constructor() {
|
||||
&& info.ext_info.lights != null
|
||||
&& info.ext_info.lights.isNotEmpty()
|
||||
) {
|
||||
if (HmiBuildConfig.isShowObuV2iView) {
|
||||
// if (HmiBuildConfig.isShowObuV2iView) {
|
||||
handlerTrafficLight(
|
||||
info.threat_info.app_id,
|
||||
info.status,
|
||||
info.ext_info.lights,
|
||||
info.ext_info.index
|
||||
)
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
// (2) 弱势交通参与者预警信息:CVX_PTC_THREAT_IND
|
||||
override fun onCvxPtcThreatIndInfo(info: CvxPtcThreatIndInfo?) {
|
||||
if (HmiBuildConfig.isShowObuV2iView) {
|
||||
// if (HmiBuildConfig.isShowObuV2iView) {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"onCvxPtcInfoIndInfo ------> $info"
|
||||
@@ -502,21 +501,16 @@ class MogoPrivateObuManager private constructor() {
|
||||
// if (level == 2 || level == 3) { //不考虑level
|
||||
//显示警告红边
|
||||
CallerHmiManager.showWarning(direction)
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"old onCvxPtcThreatIndInfo ------> v2xType = $v2xType --- alertContent = $alertContent --- ttsContent = $ttsContent "
|
||||
)
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "old onCvxPtcThreatIndInfo ------> v2xType = $v2xType --- alertContent = $alertContent --- ttsContent = $ttsContent ")
|
||||
if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) {
|
||||
Log.d("MsgBox-PriObuManager5", "alertContent或ttsContent为空!")
|
||||
}
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.OBU,
|
||||
V2XMsg(
|
||||
v2xType,
|
||||
V2XMsg(v2xType,
|
||||
alertContent,
|
||||
ttsContent
|
||||
)
|
||||
ttsContent)
|
||||
)
|
||||
)
|
||||
CallerHmiManager.warningV2X(
|
||||
@@ -563,7 +557,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
// (5) 限速预警信息:CVX_SLW_THREAT_IND
|
||||
@@ -596,7 +590,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
|
||||
// (1) V2V预警信息:CVX_V2V_THREAT_IND
|
||||
override fun onCvxV2vThreatIndInfo(info: CvxV2vThreatIndInfo?) {
|
||||
if (HmiBuildConfig.isShowObuV2vView) {
|
||||
// if (HmiBuildConfig.isShowObuV2vView) {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"onCvxV2vThreatIndInfo ------> $info"
|
||||
@@ -624,7 +618,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -733,10 +727,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
0x2 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT
|
||||
ttsContent = EventTypeEnum.getWarningTts(appId.toString())
|
||||
alertContent = EventTypeEnum.getWarningContent(appId.toString())
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"old changeTrafficLightStatus ------> appId.toString() = ${appId.toString()} --- alertContent = $alertContent --- ttsContent = $ttsContent "
|
||||
)
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "old changeTrafficLightStatus ------> appId.toString() = ${appId.toString()} --- alertContent = $alertContent --- ttsContent = $ttsContent ")
|
||||
if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) {
|
||||
Log.d("MsgBox-PriObuManager1", "alertContent或ttsContent为空!")
|
||||
}
|
||||
@@ -758,7 +749,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
when (currentLight.phase) {
|
||||
// 灯光不可用
|
||||
0x0 -> {
|
||||
CallerHmiManager.showWarningTrafficLight(0, 2)
|
||||
CallerHmiManager.showWarningTrafficLight(0, 3)
|
||||
}
|
||||
// 红灯
|
||||
0x1 -> {
|
||||
@@ -767,7 +758,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
isRedLight = true
|
||||
}
|
||||
isGreenLight = false
|
||||
CallerHmiManager.showWarningTrafficLight(1, 2)
|
||||
CallerHmiManager.showWarningTrafficLight(1, 3)
|
||||
|
||||
val red = currentLight.count_down.toInt()
|
||||
CallerHmiManager.changeCountdownRed(red)
|
||||
@@ -782,7 +773,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
isGreenLight = true
|
||||
}
|
||||
isRedLight = false
|
||||
CallerHmiManager.showWarningTrafficLight(3, 2)
|
||||
CallerHmiManager.showWarningTrafficLight(3, 3)
|
||||
val green = currentLight.count_down.toInt()
|
||||
CallerHmiManager.changeCountdownGreen(green)
|
||||
//防止数据出现问题的容错
|
||||
@@ -813,21 +804,16 @@ class MogoPrivateObuManager private constructor() {
|
||||
|
||||
val maxSpeed = currentLight.glosa_suggested_speed_max.toInt()
|
||||
if (maxSpeed > 0) {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"old changeTrafficLightStatus ------> TYPE_USECASE_ID_IVP_GREEN --- alertContent = $alertContent --- ttsContent = $ttsContent "
|
||||
)
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "old changeTrafficLightStatus ------> TYPE_USECASE_ID_IVP_GREEN --- alertContent = $alertContent --- ttsContent = $ttsContent ")
|
||||
if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) {
|
||||
Log.d("MsgBox-PriObuManager2", "alertContent或ttsContent为空!")
|
||||
}
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.OBU,
|
||||
V2XMsg(
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
V2XMsg(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
alertContent,
|
||||
ttsContent
|
||||
)
|
||||
ttsContent)
|
||||
)
|
||||
)
|
||||
CallerHmiManager.warningV2X(
|
||||
@@ -954,8 +940,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
)
|
||||
if (level == 2 || level == 3) {
|
||||
//不显示顶部弹框,其它保留
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"old handleSdkObu appId2 = $appId --- level = $level ---ttsContent = $ttsContent --- alertContent = $alertContent --- direction = $direction"
|
||||
)
|
||||
if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) {
|
||||
@@ -964,11 +949,9 @@ class MogoPrivateObuManager private constructor() {
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.OBU,
|
||||
V2XMsg(
|
||||
appId.toString(),
|
||||
V2XMsg(appId.toString(),
|
||||
alertContent,
|
||||
ttsContent
|
||||
)
|
||||
ttsContent)
|
||||
)
|
||||
)
|
||||
CallerHmiManager.warningV2X(
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.mogo.eagle.core.function.obu.mogo.receiver
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.function.obu.mogo.MogoPrivateObuNewManager
|
||||
import com.mogo.support.obu.model.MogoObuRsiWarningData
|
||||
import com.mogo.support.obu.model.MogoObuRvWarningData
|
||||
import com.mogo.support.obu.model.advance.RsiWarning
|
||||
import com.mogo.support.obu.model.advance.V2xWarning
|
||||
import com.mogo.support.obu.model.advance.VehBasics
|
||||
import com.mogo.support.obu.model.advance.WarningData
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @date 2023/1/13 10:50 上午
|
||||
*
|
||||
* 自研OBU RSI 模拟场景
|
||||
*/
|
||||
class ObuTestNewObuRsiReceiver : BroadcastReceiver() {
|
||||
private var mContext: Context? = null
|
||||
|
||||
companion object {
|
||||
private const val TAG = "ObuTestNewObuReceiver"
|
||||
}
|
||||
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
mContext = context
|
||||
/**
|
||||
* OBU 场景类型
|
||||
*/
|
||||
val obuSceneType = intent.getIntExtra("sceneType", 0)
|
||||
val obuStatus = intent.getIntExtra("status", 0)
|
||||
// val obuDistance = intent.getDoubleExtra("distance", 0.0)
|
||||
val obuEventSeriaNum = intent.getIntExtra("seriaNum", 0)
|
||||
val obuSignSerialNum = intent.getIntExtra("signSerialNum", 0)
|
||||
|
||||
val rsiWarning = RsiWarning(1)
|
||||
rsiWarning.warningLevel = 1
|
||||
|
||||
rsiWarning.setDistance(1000)
|
||||
rsiWarning.sceneType = obuSceneType //预警类型 0:无效 1:限速信息 2:道路危险 3:车内标牌 4:前方拥堵
|
||||
rsiWarning.eventSerialNum = obuEventSeriaNum //根据预警类型匹配 101 车辆故障
|
||||
rsiWarning.signSerialNum = obuSignSerialNum // 2:急转弯,8:桥梁
|
||||
|
||||
val rsiWarningList = listOf(rsiWarning) //TODO
|
||||
|
||||
val cvxObuRsiInfo = MogoObuRsiWarningData(obuStatus, 1, rsiWarningList)
|
||||
|
||||
MogoPrivateObuNewManager.INSTANCE
|
||||
.getMogoObuListener()
|
||||
.onMogoObuRsiWarning(cvxObuRsiInfo)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,11 +5,7 @@ import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_V2X_MODULE
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightManager
|
||||
import com.mogo.eagle.core.function.v2x.events.V2XEventManager
|
||||
import com.mogo.eagle.core.function.v2x.speedlimit.SpeedLimitDataManager
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.TrafficLightDispatcher
|
||||
import com.mogo.eagle.core.function.v2x.vip.VipCarManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
|
||||
@Route(path = PATH_V2X_MODULE)
|
||||
@@ -19,29 +15,18 @@ class V2XProvider : IMoGoFunctionServerProvider {
|
||||
get() = "V2XProvider"
|
||||
|
||||
override fun init(context: Context) {
|
||||
CallerTrafficLightManager.getTrafficLightProvider().initTrafficLightServer(context)
|
||||
VipCarManager.INSTANCE.initServer(context)
|
||||
SpeedLimitDataManager.getInstance().start()
|
||||
TrafficLightDispatcher.INSTANCE.initServer(context)
|
||||
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
//不处理
|
||||
} else {
|
||||
V2XEventManager.init(context)
|
||||
}
|
||||
|
||||
// RedLightWarningManager.INSTANCE.listenTrafficLight()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
VipCarManager.INSTANCE.destroy()
|
||||
TrafficLightDispatcher.INSTANCE.destroy()
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
//不处理
|
||||
} else {
|
||||
V2XEventManager.onDestroy()
|
||||
}
|
||||
|
||||
// RedLightWarningManager.INSTANCE.onDestroy()
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,8 @@ import com.mogo.eagle.core.function.v2x.events.alarm.V2XAlarmServer
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi.context
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.*
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.BROADCAST_SCENE_EXTRA_KEY
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.BROADCAST_SCENE_HANDLER_ACTION
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager
|
||||
import com.mogo.eagle.core.function.v2x.events.observer.V2XOptimalRouteObserver
|
||||
import com.mogo.eagle.core.function.v2x.events.receiver.SceneBroadcastReceiver
|
||||
|
||||
@@ -1,37 +1,42 @@
|
||||
package com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad
|
||||
|
||||
import android.animation.*
|
||||
import android.content.*
|
||||
import android.graphics.*
|
||||
import android.os.*
|
||||
import android.view.animation.*
|
||||
import android.animation.ArgbEvaluator
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.view.animation.DecelerateInterpolator
|
||||
import androidx.core.util.Pair
|
||||
import androidx.lifecycle.*
|
||||
import androidx.lifecycle.Lifecycle.Event
|
||||
import androidx.lifecycle.Lifecycle.Event.ON_CREATE
|
||||
import androidx.lifecycle.Lifecycle.Event.ON_DESTROY
|
||||
import androidx.lifecycle.LifecycleEventObserver
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.map.*
|
||||
import com.mogo.eagle.core.data.map.MapRoadInfo.StopLine
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
|
||||
import com.mogo.eagle.core.function.api.map.listener.*
|
||||
import com.mogo.eagle.core.function.api.v2x.*
|
||||
import com.mogo.eagle.core.function.call.map.*
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.api.v2x.OnClearAllMarker
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager.OnRoadListener
|
||||
import com.mogo.eagle.core.function.call.v2x.*
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallMarkersClearManager
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.V2X_EVENT_ALARM_POI
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.scene.road.*
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.*
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.scene.road.V2XAiRoadEventMarker
|
||||
import com.mogo.eagle.core.utilcode.kotlin.lifeCycleOwner
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils
|
||||
import com.mogo.map.*
|
||||
import com.mogo.map.overlay.*
|
||||
import io.netty.util.internal.*
|
||||
import java.lang.Runnable
|
||||
import com.mogo.map.MogoMap
|
||||
import com.mogo.map.overlay.IMogoPolyline
|
||||
import com.mogo.map.overlay.MogoPolylineOptions
|
||||
import io.netty.util.internal.ConcurrentSet
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import java.util.*
|
||||
import java.util.concurrent.*
|
||||
import java.util.concurrent.atomic.*
|
||||
import kotlin.collections.ArrayList
|
||||
import java.util.concurrent.Executors
|
||||
import java.util.concurrent.LinkedBlockingQueue
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
|
||||
/**
|
||||
* Ai云道路施工事件,道路颜色标记类
|
||||
@@ -48,12 +53,16 @@ object AiRoadMarker {
|
||||
|
||||
private val carLocation by lazy { AtomicReference<Triple<Double, Double, Double>>() }
|
||||
|
||||
private val overlayManager by lazy { CallerMapUIServiceManager.getOverlayManager(AbsMogoApplication.getApp()) }
|
||||
private val overlayManager by lazy {
|
||||
CallerMapUIServiceManager.getOverlayManager(
|
||||
AbsMogoApplication.getApp()
|
||||
)
|
||||
}
|
||||
|
||||
private val line by lazy { AtomicReference<IMogoPolyline>() }
|
||||
|
||||
private val START_COLOR = Color.parseColor("#002ABAD9")
|
||||
private val END_COLOR = Color.parseColor("#66FF7A30")
|
||||
private val END_COLOR = Color.parseColor("#66FF7A30")
|
||||
|
||||
private val handler by lazy {
|
||||
Handler(Looper.getMainLooper())
|
||||
@@ -63,14 +72,19 @@ object AiRoadMarker {
|
||||
val poi = this.marker.get()
|
||||
val car = this.carLocation.get()
|
||||
if (poi != null && car != null) {
|
||||
val distance = DrivingDirectionUtils.distance(car.first, car.second, poi.poi_lon, poi.poi_lat) * 10000
|
||||
val distance = DrivingDirectionUtils.distance(
|
||||
car.first,
|
||||
car.second,
|
||||
poi.poi_lon,
|
||||
poi.poi_lat
|
||||
) * 10000
|
||||
if (distance < 500) {
|
||||
unMarker(poi)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val onClearAllMarker = object : OnClearAllMarker {
|
||||
private val onClearAllMarker = object : OnClearAllMarker {
|
||||
|
||||
override fun onClearAllMarkers() {
|
||||
Logger.d(TAG, "--- onClearAllMarkers ----")
|
||||
@@ -131,7 +145,13 @@ object AiRoadMarker {
|
||||
}
|
||||
continue
|
||||
}
|
||||
val isTrigger = isTriggerEvent(top.poi_lon, top.poi_lat, location.first, location.second, location.third)
|
||||
val isTrigger = isTriggerEvent(
|
||||
top.poi_lon,
|
||||
top.poi_lat,
|
||||
location.first,
|
||||
location.second,
|
||||
location.third
|
||||
)
|
||||
Logger.d(TAG, "--- consumer --- 3 ---: isTrigger => $isTrigger")
|
||||
if (isTrigger) {
|
||||
marker.set(top)
|
||||
@@ -150,7 +170,13 @@ object AiRoadMarker {
|
||||
}
|
||||
}
|
||||
|
||||
private fun isTriggerEvent(x1: Double, y1: Double, x2: Double, y2: Double, a2: Double): Boolean {
|
||||
private fun isTriggerEvent(
|
||||
x1: Double,
|
||||
y1: Double,
|
||||
x2: Double,
|
||||
y2: Double,
|
||||
a2: Double
|
||||
): Boolean {
|
||||
val angle = DrivingDirectionUtils.getDegreeOfCar2Poi2(x2, y2, x1, y1, a2)
|
||||
if (angle <= 60 && DrivingDirectionUtils.distance(x1, y1, x2, y2) <= 300) {
|
||||
return true
|
||||
@@ -172,6 +198,7 @@ object AiRoadMarker {
|
||||
}
|
||||
this.roadId = roadId
|
||||
}
|
||||
|
||||
override fun onStopLineInfo(info: StopLine) {
|
||||
Logger.d(TAG, "--- onStopLineInfo --- info: $info")
|
||||
if (!hasCrossRoad) {
|
||||
@@ -180,17 +207,17 @@ object AiRoadMarker {
|
||||
}
|
||||
}
|
||||
|
||||
private val onLocationListener = object : IMoGoMapLocationListener {
|
||||
private val onLocationListener = object : IMoGoChassisLocationWGS84Listener {
|
||||
|
||||
override fun onLocationChanged(location: MogoLocation?, from: Int, isGps: Boolean) {
|
||||
if (location == null || !isGps) {
|
||||
override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo?) {
|
||||
if (gnssInfo == null) {
|
||||
return
|
||||
}
|
||||
try {
|
||||
val loc = arrayOf(location.longitude, location.latitude)
|
||||
carLocation.set(Triple(loc[0], loc[1], location.bearing.toDouble()))
|
||||
val loc = arrayOf(gnssInfo.longitude, gnssInfo.latitude)
|
||||
carLocation.set(Triple(loc[0], loc[1], gnssInfo.heading.toDouble()))
|
||||
} catch (t: Throwable) {
|
||||
Logger.e(TAG, "error: ${t.message}")
|
||||
Logger.e(TAG, "error: ${t.message}")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -198,13 +225,13 @@ object AiRoadMarker {
|
||||
private fun onCreate() {
|
||||
CallerMapRoadListenerManager.registerRoadListener(TAG, onRoadListener)
|
||||
CallMarkersClearManager.addAllMarkersClearListener(TAG, onClearAllMarker)
|
||||
CallerMapLocationListenerManager.addListener(TAG, onLocationListener, true)
|
||||
CallerChassisLocationWGS84ListenerManager.addListener(TAG, onLocationListener)
|
||||
}
|
||||
|
||||
private fun onDestroy() {
|
||||
CallerMapRoadListenerManager.unRegisterRoadListener(TAG)
|
||||
CallMarkersClearManager.removeAllMarkersClearListener(TAG)
|
||||
CallerMapLocationListenerManager.removeListener(TAG, true)
|
||||
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
|
||||
pool.shutdownNow()
|
||||
removeLine()
|
||||
}
|
||||
@@ -220,7 +247,10 @@ object AiRoadMarker {
|
||||
markers += marker
|
||||
}
|
||||
pool.execute {
|
||||
Logger.d(TAG, "--- enqueue --- 3 ---${Thread.currentThread().name}::${Thread.currentThread().id}")
|
||||
Logger.d(
|
||||
TAG,
|
||||
"--- enqueue --- 3 ---${Thread.currentThread().name}::${Thread.currentThread().id}"
|
||||
)
|
||||
queue.put(marker)
|
||||
}
|
||||
}
|
||||
@@ -237,10 +267,20 @@ object AiRoadMarker {
|
||||
}
|
||||
this.marker.set(marker)
|
||||
//施工中心点前方的自车行驶方向上300米距离
|
||||
val l1 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(marker.poi_lon, marker.poi_lat, location.third.toFloat(), 300f)
|
||||
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)
|
||||
val l2 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(
|
||||
marker.poi_lon,
|
||||
marker.poi_lat,
|
||||
location.third.toFloat(),
|
||||
-300f
|
||||
)
|
||||
if (l1.points.isEmpty() || l2.points.isEmpty()) {
|
||||
Logger.d(TAG, "--- marker --- 3 --- return ----")
|
||||
synchronized(markers) {
|
||||
@@ -255,26 +295,39 @@ object AiRoadMarker {
|
||||
MogoLatLng(it.second, it.first)
|
||||
})
|
||||
}
|
||||
val centerX= marker.poi_lon
|
||||
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)
|
||||
val angle = DrivingDirectionUtils.getDegreeOfCar2Poi2(
|
||||
centerX,
|
||||
centerY,
|
||||
p.first,
|
||||
p.second,
|
||||
location.third
|
||||
)
|
||||
if (angle < min) {
|
||||
min = angle
|
||||
find = p
|
||||
}
|
||||
}
|
||||
MogoLatLng(find.second, find.first)
|
||||
}
|
||||
MogoLatLng(find.second, find.first)
|
||||
} ?: 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 + 180) < 90L) {
|
||||
if (DrivingDirectionUtils.getDegreeOfCar2Poi2(
|
||||
farthestPoint.lon,
|
||||
farthestPoint.lat,
|
||||
l.first,
|
||||
l.second,
|
||||
location.third + 180
|
||||
) < 90L
|
||||
) {
|
||||
points.add(l.let { MogoLatLng(it.second, it.first) })
|
||||
}
|
||||
}
|
||||
@@ -294,7 +347,11 @@ object AiRoadMarker {
|
||||
val total = points.size
|
||||
val colors = ArrayList<Int>()
|
||||
(0..total).forEach { i ->
|
||||
colors += evaluator.evaluate(interceptor.getInterpolation(i * 1f / total), START_COLOR, END_COLOR) as Int
|
||||
colors += evaluator.evaluate(
|
||||
interceptor.getInterpolation(i * 1f / total),
|
||||
START_COLOR,
|
||||
END_COLOR
|
||||
) as Int
|
||||
}
|
||||
var line = line.get()
|
||||
options.points(points)
|
||||
@@ -337,8 +394,16 @@ object AiRoadMarker {
|
||||
val poi = this.marker.get()
|
||||
val car = this.carLocation.get()
|
||||
if (poi != null && car != null) {
|
||||
val distance = DrivingDirectionUtils.distance(car.first, car.second, marker.poi_lon, marker.poi_lat) * 10000
|
||||
Logger.d(TAG, "receive --- 2 ---:car:[${car.first}, ${car.second}] -> poi:[${marker.poi_lon}, ${marker.poi_lat}] --> distance:$distance")
|
||||
val distance = DrivingDirectionUtils.distance(
|
||||
car.first,
|
||||
car.second,
|
||||
marker.poi_lon,
|
||||
marker.poi_lat
|
||||
) * 10000
|
||||
Logger.d(
|
||||
TAG,
|
||||
"receive --- 2 ---:car:[${car.first}, ${car.second}] -> poi:[${marker.poi_lon}, ${marker.poi_lat}] --> distance:$distance"
|
||||
)
|
||||
if (distance < 500) {
|
||||
checkExpired()
|
||||
} else {
|
||||
|
||||
@@ -9,30 +9,33 @@ import android.text.style.ForegroundColorSpan;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity;
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean;
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType;
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener;
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.impl.AbsV2XScenario;
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.v2x.data.V2XWarningTarget;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 车路云—场景预警-V1.0 前车/行人/摩托车/盲区碰撞预警
|
||||
* @since: 2021/3/24
|
||||
*/
|
||||
public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoMapLocationListener, IMoGoWarningStatusListener {
|
||||
public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoChassisLocationGCJ02Listener, IMoGoWarningStatusListener {
|
||||
private static final String TAG = "V2XWarningMarker";
|
||||
private static final V2XWarningMarker sV2XWarningMarker = new V2XWarningMarker();
|
||||
private V2XWarningTarget mMarkerEntity;
|
||||
@@ -128,8 +131,8 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoMapL
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(@org.jetbrains.annotations.Nullable MogoLocation location, int from, boolean isGps) {
|
||||
sV2XWarningMarker.onCarLocationChanged2(location);
|
||||
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
|
||||
sV2XWarningMarker.onCarLocationChanged2(gnssInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -32,6 +32,8 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 前方预警marker打点 绘制安全线和预警线 衡阳交付-取消划线需求,只渲染识别物红色模型移动过程,代码保留
|
||||
@@ -430,7 +432,7 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
}
|
||||
|
||||
//线随车动
|
||||
public void onCarLocationChanged2(MogoLocation latLng) {
|
||||
public void onCarLocationChanged2(MessagePad.GnssInfo latLng) {
|
||||
carLocation = new MogoLatLng(latLng.getLatitude(), latLng.getLongitude());
|
||||
if (MogoStatusManager.getInstance().isVrMode() && !isSelfLineClear) {
|
||||
if (mCloundWarningInfo != null) {
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
package com.mogo.eagle.core.function.v2x.trafficlight
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightControl
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightDetail
|
||||
import com.mogo.eagle.core.function.api.trafficlight.ITrafficLightProvider
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.TrafficLightConst.Companion.MODULE_NAME
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.MogoTrafficLightManager
|
||||
|
||||
@Route(path = MogoServicePaths.PATH_TRAFFIC_LIGHT)
|
||||
class TrafficLightProvider : ITrafficLightProvider {
|
||||
|
||||
override val functionName: String
|
||||
get() = MODULE_NAME
|
||||
|
||||
override fun init(context: Context) {
|
||||
|
||||
}
|
||||
|
||||
override fun initTrafficLightServer(context: Context) {
|
||||
MogoTrafficLightManager.INSTANCE.initServer(context)
|
||||
}
|
||||
|
||||
override fun getTrafficLightCurrentState(): TrafficLightDetail? {
|
||||
return MogoTrafficLightManager.INSTANCE.getTrafficLightCurrentState()
|
||||
}
|
||||
|
||||
override fun turnLightToGreen(
|
||||
lightId: Int,
|
||||
crossingNo: String,
|
||||
heading: Double,
|
||||
controlTime: Int,
|
||||
onSuccess: ((TrafficLightControl) -> Unit),
|
||||
onError: ((String) -> Unit)
|
||||
) {
|
||||
return MogoTrafficLightManager.INSTANCE.turnLightToGreen(
|
||||
lightId,
|
||||
crossingNo,
|
||||
heading,
|
||||
controlTime,
|
||||
onSuccess,
|
||||
onError
|
||||
)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
MogoTrafficLightManager.INSTANCE.onDestroy()
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user