[6.5.0]运营面板增加按钮点击事件统计

This commit is contained in:
xuxinchao
2024-07-20 20:39:04 +08:00
parent bcddbfc338
commit 01ad9b823a
2 changed files with 91 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.tools.SweeperModeChangedConfirmDialog
import com.mogo.eagle.core.function.call.unmanned.CallerUnmannedListenerManager
import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog.Companion.hmiAction
import com.mogo.eagle.core.function.hmi.ui.utils.SOPAnalyticsManager.clickEventAnalytics
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.vehicle.SweeperVehicleConfigUtils
@@ -142,6 +143,7 @@ internal class SOPSettingView @JvmOverloads constructor(
scV2XSwitch.setOnCheckedChangeListener { _, isChecked ->
FunctionBuildConfig.v2xMainSwitch = isChecked
hmiAction("SOP V2X总开关, ", isChecked)
clickEventAnalytics("V2X总开关",isChecked)
if (isChecked) {
//V2N总开关
scV2NSwitch.isChecked = FunctionBuildConfig.v2nMainSwitch
@@ -190,6 +192,7 @@ internal class SOPSettingView @JvmOverloads constructor(
//绿波通行(默认关闭)
scGreenWaveSop.isEnabled = FunctionBuildConfig.v2nMainSwitch
scV2NSwitch.setOnCheckedChangeListener { compoundButton, isChecked ->
clickEventAnalytics("V2N总开关",isChecked)
if (isChecked) {
//V2N新链路
scNewV2NData.isChecked = FunctionBuildConfig.isNewV2NData
@@ -242,6 +245,7 @@ internal class SOPSettingView @JvmOverloads constructor(
scRunRedLightSop.isEnabled = HmiBuildConfig.isShowObuV2iView
scObuWeaknessTrafficSop.isEnabled = HmiBuildConfig.isShowObuV2iView
scV2ISwitch.setOnCheckedChangeListener { compoundButton, isChecked ->
clickEventAnalytics("V2I总开关",isChecked)
if (isChecked) {
//V2I场景进PNC
scV2iPnc.isChecked = FunctionBuildConfig.isV2IPnc
@@ -288,6 +292,7 @@ internal class SOPSettingView @JvmOverloads constructor(
if (!compoundButton.isPressed) {
return@setOnCheckedChangeListener
}
clickEventAnalytics("V2N新链路",isChecked)
hmiAction("SOP 是否是V2N新链路(云->工控机->App)", isChecked)
FunctionBuildConfig.isNewV2NData = isChecked
@@ -304,6 +309,7 @@ internal class SOPSettingView @JvmOverloads constructor(
if (!compoundButton.isPressed) {
return@setOnCheckedChangeListener
}
clickEventAnalytics("V2N场景进PNC",isChecked)
hmiAction("SOP V2N场景进PNC, ", isChecked)
CallerAutoPilotControlManager.sendV2nToPncCmd(isChecked)
FunctionBuildConfig.isV2NPnc = isChecked
@@ -315,6 +321,7 @@ internal class SOPSettingView @JvmOverloads constructor(
if (!compoundButton.isPressed) {
return@setOnCheckedChangeListener
}
clickEventAnalytics("绿波通行",isChecked)
hmiAction("SOP obu绿波通行, ", isChecked)
HmiBuildConfig.isShowGreenWaveView = isChecked
if (HmiBuildConfig.isShowGreenWaveView) {
@@ -336,6 +343,7 @@ internal class SOPSettingView @JvmOverloads constructor(
if (!compoundButton.isPressed) {
return@setOnCheckedChangeListener
}
clickEventAnalytics("V2I场景进PNC",isChecked)
hmiAction("SOP V2I场景进PNC, ", isChecked)
CallerAutoPilotControlManager.sendV2iToPncCmd(isChecked)
FunctionBuildConfig.isV2IPnc = isChecked
@@ -347,6 +355,7 @@ internal class SOPSettingView @JvmOverloads constructor(
if (!compoundButton.isPressed) {
return@setOnCheckedChangeListener
}
clickEventAnalytics("闯红灯预警",isChecked)
hmiAction("SOP obu闯红灯预警, ", isChecked)
HmiBuildConfig.isShowRunRedLightView = isChecked
if (HmiBuildConfig.isShowRunRedLightView) {
@@ -368,6 +377,7 @@ internal class SOPSettingView @JvmOverloads constructor(
if (!compoundButton.isPressed) {
return@setOnCheckedChangeListener
}
clickEventAnalytics("路侧弱势交通参与者",isChecked)
hmiAction("SOP obu弱势交通控制, ", isChecked)
HmiBuildConfig.isShowObuWeaknessTrafficView = isChecked
}
@@ -378,6 +388,7 @@ internal class SOPSettingView @JvmOverloads constructor(
if (!compoundButton.isPressed) {
return@setOnCheckedChangeListener
}
clickEventAnalytics("V2V总开关",isChecked)
hmiAction("SOP obuV2V开关, ", isChecked)
HmiBuildConfig.isShowObuV2vView = isChecked
}
@@ -389,6 +400,7 @@ internal class SOPSettingView @JvmOverloads constructor(
if (!compoundButton.isPressed) {
return@setOnCheckedChangeListener
}
clickEventAnalytics("OBU总开关",isChecked)
hmiAction("SOP OBU控制总开关, ", isChecked)
if (isChecked) {
CallerObuApiManager.resetObuIpAddress(MogoObuConst.OBU_DEFAULT_IP)
@@ -408,6 +420,7 @@ internal class SOPSettingView @JvmOverloads constructor(
scMarkingObstacles.isChecked = FunctionBuildConfig.isPNCWarning
scMarkingObstacles.setOnCheckedChangeListener { _, isChecked ->
hmiAction("SOP 危险障碍物颜色标记开关, ", isChecked)
clickEventAnalytics("危险障碍物颜色标记",isChecked)
FunctionBuildConfig.isPNCWarning = isChecked
}
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
@@ -418,6 +431,7 @@ internal class SOPSettingView @JvmOverloads constructor(
scRouteDynamicEffect.isChecked = HmiBuildConfig.isShowRouteStrategy
scRouteDynamicEffect.setOnCheckedChangeListener { _, isChecked ->
hmiAction("SOP 引导线动态效果, ", isChecked)
clickEventAnalytics("引导线动态效果",isChecked)
HmiBuildConfig.isShowRouteStrategy = isChecked
CallerDevaToolsManager.setRouteDynamicColorEnable(isChecked)
}
@@ -441,6 +455,7 @@ internal class SOPSettingView @JvmOverloads constructor(
CallerMapUIServiceManager.getMapUIController()?.setIsDrawPointCloud(isChecked)
CallerSopSettingManager.invokePointCloudListener(isChecked)
hmiAction("SOP 是否渲染点云数据, ", isChecked)
clickEventAnalytics("点云效果",isChecked)
}
//自车光圈
@@ -461,6 +476,7 @@ internal class SOPSettingView @JvmOverloads constructor(
return@setOnCheckedChangeListener
}
FunctionBuildConfig.isDisplayAnimEnable = isChecked
clickEventAnalytics("自车光圈",isChecked)
}
}
@@ -475,6 +491,7 @@ internal class SOPSettingView @JvmOverloads constructor(
return@setOnCheckedChangeListener
}
hmiAction("SOP 演示模式开关, ", !FunctionBuildConfig.isDemoMode)
clickEventAnalytics("美化模式",isChecked)
FunctionBuildConfig.isDemoMode = !FunctionBuildConfig.isDemoMode
CallerAutoPilotControlManager.setDemoMode(FunctionBuildConfig.isDemoMode)
CallerHmiViewControlListenerManager.invokeFuncMode(
@@ -497,6 +514,7 @@ internal class SOPSettingView @JvmOverloads constructor(
scShowBagRecordWindow.setOnCheckedChangeListener { _, isChecked ->
FunctionBuildConfig.isShowBagRecordWindow = isChecked
hmiAction("SOP 是否展示录包弹窗, ", isChecked)
clickEventAnalytics("录包弹窗",isChecked)
}
//接管提醒
@@ -504,6 +522,7 @@ internal class SOPSettingView @JvmOverloads constructor(
scTakeOverRemind.setOnCheckedChangeListener { _, isChecked ->
FunctionBuildConfig.isTakeoverRemind = isChecked
hmiAction("SOP 是否展示接管提醒, ", isChecked)
clickEventAnalytics("接管提醒",isChecked)
}
}
@@ -518,6 +537,7 @@ internal class SOPSettingView @JvmOverloads constructor(
hmiAction("SOP 绕障类功能开关, ", isChecked)
CallerAutoPilotControlManager.sendDetouring(isChecked)
FunctionBuildConfig.isDetouring = isChecked
clickEventAnalytics("绕障类功能",isChecked)
}
// 雨天模式,上一次勾选的数据
@@ -527,6 +547,7 @@ internal class SOPSettingView @JvmOverloads constructor(
return@setOnCheckedChangeListener
}
hmiAction("SOP 雨天模式开关, ", isChecked)
clickEventAnalytics("雨天模式",isChecked)
FunctionBuildConfig.isRainMode = isChecked
CallerAutoPilotControlManager.setRainMode(isChecked)
CallerHmiViewControlListenerManager.invokeFuncMode(FUNC_MODE_RAIN, isChecked)
@@ -543,6 +564,7 @@ internal class SOPSettingView @JvmOverloads constructor(
FunctionBuildConfig.isWeakNetSlowDown = isChecked
CallerAutoPilotControlManager.sendWeakNetSlowDown(isChecked)
hmiAction("SOP 弱网减速停车, ", isChecked)
clickEventAnalytics("弱网减速停车",isChecked)
}
//故障减速停车
@@ -551,6 +573,7 @@ internal class SOPSettingView @JvmOverloads constructor(
FunctionBuildConfig.isFaultSlowDown = isChecked
CallerAutoPilotControlManager.sendBreakdownSlowDown(isChecked)
hmiAction("SOP 故障减速停车, ", isChecked)
clickEventAnalytics("故障减速停车",isChecked)
}
//融合模式
rgFusionMode.setOnCheckedChangeListener { _, p1 ->
@@ -577,6 +600,7 @@ internal class SOPSettingView @JvmOverloads constructor(
}
}
hmiAction("SOP 融合模式, ", FunctionBuildConfig.fusionMode)
clickEventAnalytics("融合模式",true)
CallerAutoPilotControlManager.sendFusionMode(FunctionBuildConfig.fusionMode)
}
@@ -610,6 +634,7 @@ internal class SOPSettingView @JvmOverloads constructor(
ToastUtils.showShort("变道绕障的目标障碍物速度阈值设置失败")
hmiAction("SOP 变道绕障的目标障碍物速度阈值设置", "失败")
}
clickEventAnalytics("变道速度阈值",true)
}
ivSpeedOverTakeReduce.setOnClickListener {
@@ -640,6 +665,7 @@ internal class SOPSettingView @JvmOverloads constructor(
ToastUtils.showShort("SOP 超车目标障碍物速度阈值设置失败")
hmiAction("SOP 超车目标障碍物速度阈值设置", "失败")
}
clickEventAnalytics("超车速度阈值",true)
}
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
@@ -669,6 +695,7 @@ internal class SOPSettingView @JvmOverloads constructor(
scTrafficLight.isChecked = !HmiBuildConfig.isShowTrafficLightView
scTrafficLight.setOnCheckedChangeListener { _, isChecked ->
hmiAction("SOP 红绿灯标识开关, ", isChecked)
clickEventAnalytics("红绿灯标识",isChecked)
if (isChecked) {
CallerHmiManager.showTrafficLightView()
} else {
@@ -680,6 +707,7 @@ internal class SOPSettingView @JvmOverloads constructor(
scCarUnionTrafficLight.isChecked = HmiBuildConfig.isShowCarSourceTrafficLightView
scCarUnionTrafficLight.setOnCheckedChangeListener { _, isChecked ->
hmiAction("SOP 红绿灯车端来源标识开关, ", isChecked)
clickEventAnalytics("红绿灯车端融合标识",isChecked)
HmiBuildConfig.isShowCarSourceTrafficLightView = isChecked
}
@@ -687,6 +715,7 @@ internal class SOPSettingView @JvmOverloads constructor(
scConnectionSwitch.isChecked = HmiBuildConfig.isShowConnectionProgressView
scConnectionSwitch.setOnCheckedChangeListener { _, isChecked ->
hmiAction("SOP 系统启动状态展示, ", isChecked)
clickEventAnalytics("系统启动状态展示",isChecked)
HmiBuildConfig.isShowConnectionProgressView = isChecked
CallerHmiViewControlListenerManager.updateConnectionProgressView(isChecked)
}
@@ -695,6 +724,7 @@ internal class SOPSettingView @JvmOverloads constructor(
scSpeedLimit.isChecked = HmiBuildConfig.isShowLimitingVelocityView
scSpeedLimit.setOnCheckedChangeListener { _, isChecked ->
hmiAction("SOP 限速标识开关, ", isChecked)
clickEventAnalytics("限速标识",isChecked)
if (isChecked) {
HmiBuildConfig.isShowLimitingVelocityView = true
CallerHmiViewControlListenerManager.invokeVisible(
@@ -714,6 +744,7 @@ internal class SOPSettingView @JvmOverloads constructor(
scIPCReport.isChecked = FunctionBuildConfig.isReportWarning
scIPCReport.setOnCheckedChangeListener { _, isChecked ->
hmiAction("SOP 是否开启异常上报, ", isChecked)
clickEventAnalytics("异常上报提示",isChecked)
FunctionBuildConfig.isReportWarning = isChecked
}
@@ -729,6 +760,7 @@ internal class SOPSettingView @JvmOverloads constructor(
} else {
CallerHmiManager.hidM1360LookAround()
}
clickEventAnalytics("360环视",isChecked)
}
it.isChecked = CallerHmiManager.isM1360LookAroundShowing()
}
@@ -761,6 +793,7 @@ internal class SOPSettingView @JvmOverloads constructor(
}
CallerHmiManager.setTaxiUnmanedDriverLineRoutingVerifyMode(false)
}
clickEventAnalytics("自主算路验证模式",isChecked)
}
it.isChecked = CallerHmiManager.isTaxiUnmanedDriverLineRoutingVerifyMode()
} else {
@@ -784,6 +817,7 @@ internal class SOPSettingView @JvmOverloads constructor(
it.setOnCheckedChangeListener { _, isChecked ->
CallerLogger.d(TAG, "发送开关数据:${isChecked}到乘客屏")
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.WEATHER_SWITCH_STATUS, (if (isChecked) "1" else "0").toByteArray())
clickEventAnalytics("天气效果开关",isChecked)
}
}
}
@@ -822,6 +856,7 @@ internal class SOPSettingView @JvmOverloads constructor(
})
confirmDialog.showSweeperModeChangeConfirmDialog()
}
clickEventAnalytics("清扫云控业务",isChecked)
}
} else {
switchView.isEnabled = false
@@ -850,6 +885,7 @@ internal class SOPSettingView @JvmOverloads constructor(
CallerUnmannedListenerManager.dispatchVirtualTaskPullTaskInterval(5)
}
}
clickEventAnalytics("Taxi无人化演练任务拉取时间间隔",true)
}
rgPullTime.visibility =
if(AppIdentityModeUtils.isTaxiDriver(FunctionBuildConfig.appIdentityMode))

View File

@@ -0,0 +1,55 @@
package com.mogo.eagle.core.function.hmi.ui.utils
import com.mogo.commons.storage.SharedPrefsMgr
import com.mogo.commons.utils.MogoAnalyticUtils
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.utilcode.util.AppUtils
/**
* 运营面板埋点统计管理
*/
object SOPAnalyticsManager {
private const val sopButtonClick = "sop_button_click"
private const val eventParamButtonName = "buttonName" //开关名称
private const val eventParamButtonStatus = "buttonStatus" //开关状态
private const val eventParamPlateNumber = "plateNumber" //车牌号
private const val eventParamCarSn = "carSn" //鹰眼SN
private const val eventParamMapVersion = "mapVersion" //工控机版本
private const val eventParamEyeVersion = "eyeVersion" //鹰眼版本
/**
* 运营面板开关点击状态统计
* @param buttonName 开关名称
* @param buttonStatus 开关状态
* @param plateNumber 车牌号
* @param carSn 鹰眼SN
* @param mapVersion 工控机版本
* @param eyeVersion 鹰眼版本
*/
private fun realSOPButtonEvent(buttonName: String,buttonStatus: Boolean,plateNumber: String,
carSn: String,mapVersion: String,eyeVersion: String){
val clickButtonParams = HashMap<String,Any>()
clickButtonParams[eventParamButtonName] = buttonName
clickButtonParams[eventParamButtonStatus] = buttonStatus
clickButtonParams[eventParamPlateNumber] = plateNumber
clickButtonParams[eventParamCarSn] = carSn
clickButtonParams[eventParamMapVersion] = mapVersion
clickButtonParams[eventParamEyeVersion] = eyeVersion
MogoAnalyticUtils.track(sopButtonClick,clickButtonParams)
}
/**
* 运营面板开关点击状态统计
* @param buttonName 开关名称
* @param buttonStatus 开关状态
*/
fun clickEventAnalytics(buttonName: String, buttonStatus: Boolean){
realSOPButtonEvent(buttonName,buttonStatus, AppConfigInfo.plateNumber,
SharedPrefsMgr.getInstance().sn,
CallerAutoPilotStatusListenerManager.getDockerVersion() ?: "",
AppUtils.getAppVersionName())
}
}