diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/RoadLineEventManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/RoadLineEventManager.kt index 59581f6bd2..2d2689a594 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/RoadLineEventManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/RoadLineEventManager.kt @@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.datacenter.v2x import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.api.map.road.IMoGoMapRoadListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerServicesEventManager import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager import com.zhidaoauto.map.data.road.RoadCross @@ -40,7 +41,7 @@ class RoadLineEventManager : IMoGoMapRoadListener, IMoGoAutopilotStatusListener return } if(cross){ - CallerAutoPilotStatusListenerManager.updateRoadCount() + CallerServicesEventManager.updateServicesNum(CallerServicesEventManager.ServiceType.ROAD) } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/exploration/AutomaticExplorationView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/exploration/AutomaticExplorationView.kt index 74b91d1a30..192d239945 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/exploration/AutomaticExplorationView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/exploration/AutomaticExplorationView.kt @@ -186,15 +186,6 @@ open class AutomaticExplorationView @JvmOverloads constructor( }) automaticExplorationAdapter?.setData(dataList) - //每出现一次自动探查,增加相应的服务次数 - //道路信息提醒次数 - AutopilotSummaryInfo.infoTipNum += 9 - //车辆行为提醒次数 - AutopilotSummaryInfo.vehicleTipNum += 13 - //弱势参与者提醒次数 - AutopilotSummaryInfo.vulnerableTipNum += 4 - //消除安全风险隐患次数 - AutopilotSummaryInfo.dangerNum += 24 //启动扫描 ivScan?.let { rotationAnim = ObjectAnimator.ofFloat(it, "rotation", 0f, 360f) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/FusionTrafficLightView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/FusionTrafficLightView.kt index e323c30796..5788b466b9 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/FusionTrafficLightView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/FusionTrafficLightView.kt @@ -11,6 +11,7 @@ import com.mogo.eagle.core.data.autopilot.AutopilotSummaryInfo import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.data.enums.TrafficLightEnum import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener +import com.mogo.eagle.core.function.call.autopilot.CallerServicesEventManager import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager import com.mogo.eagle.core.function.hmi.R @@ -205,7 +206,7 @@ class FusionTrafficLightView @JvmOverloads constructor( if(this@FusionTrafficLightView.visibility == View.GONE){ this@FusionTrafficLightView.visibility = View.VISIBLE CallerHmiViewControlListenerManager.invokeV2XEvent(View.VISIBLE, TAG) - AutopilotSummaryInfo.lightServicesNum++ + CallerServicesEventManager.updateServicesNum(CallerServicesEventManager.ServiceType.LIGHT) } val colorList = ArrayList() diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/ItinerarySummaryDialog.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/ItinerarySummaryDialog.kt index b1c1bcd84b..55a0d76a28 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/ItinerarySummaryDialog.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/ItinerarySummaryDialog.kt @@ -7,6 +7,7 @@ import android.widget.ImageView import android.widget.TextView import com.mogo.eagle.core.data.autopilot.AutopilotSummaryInfo import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerServicesEventManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.view.TravelRealityView import com.mogo.eagle.core.utilcode.util.ThreadUtils @@ -70,26 +71,23 @@ open class ItinerarySummaryDialog(context: Context, isDriver: Boolean, theme: In } //全息路口服务次数 tvIntersectionServicesNum = findViewById(R.id.tvIntersectionServicesNum) - tvIntersectionServicesNum?.text = CallerAutoPilotStatusListenerManager.getRoadCount().toString() + tvIntersectionServicesNum?.text = CallerServicesEventManager.getRoadNum().toString() //路口灯态服务次数 tvLightServicesNum = findViewById(R.id.tvLightServicesNum) - tvLightServicesNum?.text = AutopilotSummaryInfo.lightServicesNum.toString() + tvLightServicesNum?.text = CallerServicesEventManager.getLightServicesNum().toString() //道路信息提醒次数 tvInfoTipNum = findViewById(R.id.tvInfoTipNum) - AutopilotSummaryInfo.infoTipNum += random.nextInt(7) +2 - tvInfoTipNum?.text = AutopilotSummaryInfo.infoTipNum.toString() + tvInfoTipNum?.text = CallerServicesEventManager.getInfoTipNum().toString() //车辆行为提醒次数 tvVehicleTipNum = findViewById(R.id.tvVehicleTipNum) - AutopilotSummaryInfo.vehicleTipNum += random.nextInt(7) +2 - tvVehicleTipNum?.text = AutopilotSummaryInfo.vehicleTipNum.toString() + tvVehicleTipNum?.text = CallerServicesEventManager.getVehicleTipNum().toString() //弱势参与者提醒次数 tvVulnerableTipNum = findViewById(R.id.tvVulnerableTipNum) - AutopilotSummaryInfo.vulnerableTipNum += random.nextInt(7)+2 - tvVulnerableTipNum?.text = AutopilotSummaryInfo.vulnerableTipNum.toString() + tvVulnerableTipNum?.text = CallerServicesEventManager.getVulnerableTipNum().toString() //消除安全风险隐患次数 tvDangerNum = findViewById(R.id.tvDangerNum) - AutopilotSummaryInfo.dangerNum += random.nextInt(7)+2 - tvDangerNum?.text = AutopilotSummaryInfo.dangerNum.toString() + val dangerNum = CallerServicesEventManager.getInfoTipNum()+ CallerServicesEventManager.getVehicleTipNum() + CallerServicesEventManager.getVulnerableTipNum() + tvDangerNum?.text = dangerNum.toString() //通行效率提升:本期为假数据,数据为百分数,值为7-14%之间的随机数,保留小数点后1位 tvEfficiencyNum = findViewById(R.id.tvEfficiencyNum) val next: Float= random.nextInt(70).toFloat()/10 @@ -113,7 +111,12 @@ open class ItinerarySummaryDialog(context: Context, isDriver: Boolean, theme: In private fun showSummaryTipContent(){ ThreadUtils.runOnUiThread { - val vehicleServiceNum = AutopilotSummaryInfo.infoTipNum+ AutopilotSummaryInfo.vehicleTipNum + AutopilotSummaryInfo.vulnerableTipNum + AutopilotSummaryInfo.lightServicesNum + CallerAutoPilotStatusListenerManager.getRoadCount() + val vehicleServiceNum = + CallerServicesEventManager.getInfoTipNum()+ + CallerServicesEventManager.getVehicleTipNum() + + CallerServicesEventManager.getVulnerableTipNum() + + CallerServicesEventManager.getLightServicesNum() + + CallerServicesEventManager.getRoadNum() var smartRoadLen = 1000f try { smartRoadLen =random.nextFloat()*mileage @@ -138,12 +141,7 @@ open class ItinerarySummaryDialog(context: Context, isDriver: Boolean, theme: In travelRealityView?.onPause() travelRealityView?.onDestroy() //对本次服务记录清零 - AutopilotSummaryInfo.lightServicesNum = 0 - AutopilotSummaryInfo.infoTipNum = 0 - AutopilotSummaryInfo.vehicleTipNum = 0 - AutopilotSummaryInfo.vulnerableTipNum = 0 - AutopilotSummaryInfo.dangerNum = 0 - CallerAutoPilotStatusListenerManager.resetRoadCount() + CallerServicesEventManager.resetServicesNum() } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SingleTrafficLightView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SingleTrafficLightView.kt index 895532f53b..17fb61ca52 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SingleTrafficLightView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SingleTrafficLightView.kt @@ -16,6 +16,7 @@ import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListen import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.TrafficLightView_TAG import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener +import com.mogo.eagle.core.function.call.autopilot.CallerServicesEventManager import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager @@ -132,6 +133,7 @@ class SingleTrafficLightView @JvmOverloads constructor( UiThreadHandler.post { mCurrentLightId = TrafficLightEnum.BLACK this@SingleTrafficLightView.visibility = GONE + CallerServicesEventManager.updateServicesNum(CallerServicesEventManager.ServiceType.LIGHT) } } diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotSummaryInfo.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotSummaryInfo.kt index df7931863d..dcf6be7259 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotSummaryInfo.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotSummaryInfo.kt @@ -1,10 +1,19 @@ package com.mogo.eagle.core.data.autopilot +import java.util.concurrent.atomic.AtomicInteger + /** * 行程总结报告数据 */ object AutopilotSummaryInfo { + /** + * 全息路口服务次数 + */ + @JvmField + @Volatile + var RoadNum = 0 + /** * 路口灯态服务次数 */ @@ -13,31 +22,59 @@ object AutopilotSummaryInfo { var lightServicesNum = 0 /** - * 道路信息提醒次数 + * 道路施工次数 */ @JvmField @Volatile - var infoTipNum = 0 + var roadConstructionNum = 0 /** - * 车辆行为提醒次数 + * 道路事故次数 */ @JvmField @Volatile - var vehicleTipNum = 0 + var roadAccidentNum = 0 /** - * 弱势参与者提醒次数 + * 公交站事件次数 */ @JvmField @Volatile - var vulnerableTipNum = 0 + var busStopNum = 0 /** - * 消除安全风险隐患次数 + * 静止车辆事件次数 */ @JvmField @Volatile - var dangerNum = 0 + var stationaryVehicleNum = 0 + + /** + * 他车倒车事件次数 + */ + @JvmField + @Volatile + var reverseCarNum = 0 + + /** + * 逆行事件次数 + */ + @JvmField + @Volatile + var retrogradeEventNum = 0 + + /** + * 行人横穿事件次数 + */ + @JvmField + @Volatile + var traverseCrossingNum = 0 + + /** + * 非机动车横穿事件次数 + */ + @JvmField + @Volatile + var nonVehicleCrossingNum = 0 } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerServicesEventManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerServicesEventManager.kt new file mode 100644 index 0000000000..b4db4416e6 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerServicesEventManager.kt @@ -0,0 +1,242 @@ +package com.mogo.eagle.core.function.call.autopilot + +import com.mogo.eagle.core.data.autopilot.AutopilotSummaryInfo + +object CallerServicesEventManager { + + enum class ServiceType{ + ROAD,//全息路口服务次数 + LIGHT,//路口灯态服务次数 + ROAD_CONSTRUCTION,//道路施工 + ROAD_ACCIDENT,//道路事故 + BUS_STOP,//公交站事件 + STATIONARY_VEHICLE,//静止车辆 + REVERSE_CAR,//他车倒车 + RETROGRADE_EVENT,//逆行事件 + TRAVERSE_CROSSING, //行人横穿 + NON_VEHICLE_CROSSING// 非机动车横穿 + } + + fun updateServicesNum(serviceType: ServiceType){ + when(serviceType){ + //全息路口服务次数 + ServiceType.ROAD->{ + updateRoadNum() + } + //路口灯态服务次数 + ServiceType.LIGHT->{ + updateLightServicesNum() + } + //道路施工 + ServiceType.ROAD_CONSTRUCTION->{ + updateRoadConstructionNum() + } + //道路事故 + ServiceType.ROAD_ACCIDENT ->{ + updateRoadAccidentNum() + } + //公交站事件 + ServiceType.BUS_STOP ->{ + updateBusStopNum() + } + //静止车辆 + ServiceType.STATIONARY_VEHICLE ->{ + updateStationaryVehicleNum() + } + //他车倒车 + ServiceType.REVERSE_CAR ->{ + updateReverseCarNum() + } + //逆行事件 + ServiceType.RETROGRADE_EVENT ->{ + updateRetrogradeEventNum() + } + //行人横穿 + ServiceType.TRAVERSE_CROSSING ->{ + updateTraverseCrossingNum() + } + // 非机动车横穿 + ServiceType.NON_VEHICLE_CROSSING ->{ + updateNonVehicleCrossingNum() + } + } + } + + /** + * 更新全息路口服务次数 + */ + private fun updateRoadNum(){ + AutopilotSummaryInfo.RoadNum++ + } + + /** + * 获取全息路口服务次数 + */ + fun getRoadNum(): Int{ + return AutopilotSummaryInfo.RoadNum + } + + /** + * 更新路口灯态服务次数 + */ + private fun updateLightServicesNum(){ + AutopilotSummaryInfo.lightServicesNum++ + } + + /** + * 获取路口灯态服务次数 + */ + fun getLightServicesNum(): Int{ + return AutopilotSummaryInfo.lightServicesNum + } + + /** + * 更新道路施工次数 + */ + private fun updateRoadConstructionNum(){ + AutopilotSummaryInfo.roadConstructionNum++ + } + + /** + * 获取道路施工次数 + */ + private fun getRoadConstructionNum(): Int{ + return AutopilotSummaryInfo.roadConstructionNum + } + + /** + * 更新道路事故次数 + */ + private fun updateRoadAccidentNum(){ + AutopilotSummaryInfo.roadAccidentNum++ + } + + /** + * 获取道路事故次数 + */ + private fun getRoadAccidentNum(): Int{ + return AutopilotSummaryInfo.roadAccidentNum + } + + /** + * 更新公交站事件次数 + */ + private fun updateBusStopNum(){ + AutopilotSummaryInfo.busStopNum++ + } + + /** + * 获取公交站事件次数 + */ + private fun getBusStopNum(): Int{ + return AutopilotSummaryInfo.busStopNum + } + + /** + * 更新静止车辆事件次数 + */ + private fun updateStationaryVehicleNum(){ + AutopilotSummaryInfo.stationaryVehicleNum++ + } + + /** + * 获取静止车辆事件次数 + */ + private fun getStationaryVehicleNum(): Int{ + return AutopilotSummaryInfo.stationaryVehicleNum + } + + /** + * 更新他车倒车事件次数 + */ + private fun updateReverseCarNum(){ + AutopilotSummaryInfo.reverseCarNum++ + } + + /** + * 获取他车倒车事件次数 + */ + private fun getReverseCarNum(): Int{ + return AutopilotSummaryInfo.reverseCarNum + } + + /** + * 更新逆行事件次数 + */ + private fun updateRetrogradeEventNum(){ + AutopilotSummaryInfo.retrogradeEventNum++ + } + + /** + * 获取逆行事件次数 + */ + private fun getRetrogradeEventNum(): Int{ + return AutopilotSummaryInfo.retrogradeEventNum + } + + /** + * 更新行人横穿事件次数 + */ + private fun updateTraverseCrossingNum(){ + AutopilotSummaryInfo.traverseCrossingNum++ + } + + /** + * 获取行人横穿事件次数 + */ + private fun getTraverseCrossingNum(): Int{ + return AutopilotSummaryInfo.traverseCrossingNum + } + + /** + * 更新非机动车横穿事件次数 + */ + private fun updateNonVehicleCrossingNum(){ + AutopilotSummaryInfo.nonVehicleCrossingNum++ + } + + /** + * 获取非机动车横穿事件次数 + */ + private fun getNonVehicleCrossingNum(): Int{ + return AutopilotSummaryInfo.nonVehicleCrossingNum + } + + /** + * 获取道路信息提醒次数 + */ + fun getInfoTipNum(): Int{ + return getRoadConstructionNum()+getRoadAccidentNum()+getBusStopNum() + } + + /** + * 获取车辆行为提醒次数 + */ + fun getVehicleTipNum(): Int{ + return getStationaryVehicleNum() + getReverseCarNum() + getRetrogradeEventNum() + } + + /** + * 获取弱势参与者提醒次数 + */ + fun getVulnerableTipNum(): Int{ + return getTraverseCrossingNum() + getNonVehicleCrossingNum() + } + + /** + * 清空事件次数 + */ + fun resetServicesNum(){ + AutopilotSummaryInfo.RoadNum = 0 + AutopilotSummaryInfo.lightServicesNum = 0 + AutopilotSummaryInfo.roadConstructionNum = 0 + AutopilotSummaryInfo.roadAccidentNum = 0 + AutopilotSummaryInfo.busStopNum = 0 + AutopilotSummaryInfo.stationaryVehicleNum = 0 + AutopilotSummaryInfo.reverseCarNum = 0 + AutopilotSummaryInfo.retrogradeEventNum = 0 + AutopilotSummaryInfo.traverseCrossingNum = 0 + AutopilotSummaryInfo.nonVehicleCrossingNum = 0 + } + +} \ No newline at end of file