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:
@@ -8,7 +8,7 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.analytics.AnalyticsManager;
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
|
||||
@@ -59,7 +59,7 @@ public class BusAnalyticsManager {
|
||||
, CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState() ==
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING);
|
||||
|
||||
AnalyticsManager.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
|
||||
MogoAnalyticUtils.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
|
||||
|
||||
clearStartAutopilotParams();//清空参数数据,防止误传
|
||||
}
|
||||
@@ -110,7 +110,7 @@ public class BusAnalyticsManager {
|
||||
clearStartAutopilotFailureMSG();
|
||||
removeWaitingCallback();
|
||||
mStartAutopilotParams.put(BusConst.EVENT_PARAM_START_RESULT, true);
|
||||
AnalyticsManager.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
|
||||
MogoAnalyticUtils.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
|
||||
|
||||
clearStartAutopilotParams();//清空参数数据,防止误传
|
||||
} else {
|
||||
@@ -142,6 +142,6 @@ public class BusAnalyticsManager {
|
||||
params.put(BusConst.EVENT_PARAM_END_NAME, endName);
|
||||
params.put(BusConst.EVENT_PARAM_LINE_ID, lineId);
|
||||
params.put(BusConst.EVENT_PARAM_UNABLE_START_REASON, reason);
|
||||
AnalyticsManager.INSTANCE.track(BusConst.EVENT_KEY_AP_UNABLE_START_REASON, params);
|
||||
MogoAnalyticUtils.INSTANCE.track(BusConst.EVENT_KEY_AP_UNABLE_START_REASON, params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.analytics.AnalyticsManager;
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
@@ -39,7 +39,7 @@ public class SweeperAnalyticsManager {
|
||||
mStartAutopilotParams.put(SweeperConst.EVENT_PARAM_START_RESULT
|
||||
, CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState() ==
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING);
|
||||
AnalyticsManager.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
|
||||
MogoAnalyticUtils.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -73,7 +73,7 @@ public class SweeperAnalyticsManager {
|
||||
UiThreadHandler.removeCallbacks(startAutopilotRunnable);
|
||||
}
|
||||
mStartAutopilotParams.put(SweeperConst.EVENT_PARAM_START_RESULT, true);
|
||||
AnalyticsManager.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
|
||||
MogoAnalyticUtils.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
|
||||
} else {
|
||||
UiThreadHandler.postDelayed(startAutopilotRunnable, SweeperConst.LOOP_PERIOD_15S);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.analytics.AnalyticsManager;
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
|
||||
@@ -63,7 +63,7 @@ public class TaxiPassengerAnalyticsManager {
|
||||
, CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState() ==
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING);
|
||||
|
||||
AnalyticsManager.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
|
||||
MogoAnalyticUtils.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
|
||||
|
||||
clearStartAutopilotParams();//清空参数数据,防止误传
|
||||
}
|
||||
@@ -114,7 +114,7 @@ public class TaxiPassengerAnalyticsManager {
|
||||
clearStartAutopilotFailureMSG();
|
||||
removeWaitingCallback();
|
||||
mStartAutopilotParams.put(TaxiPassengerConst.EVENT_PARAM_START_RESULT, true);
|
||||
AnalyticsManager.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
|
||||
MogoAnalyticUtils.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
|
||||
|
||||
clearStartAutopilotParams();
|
||||
} else {
|
||||
@@ -146,6 +146,6 @@ public class TaxiPassengerAnalyticsManager {
|
||||
params.put(TaxiPassengerConst.EVENT_PARAM_END_NAME, endName);
|
||||
params.put(TaxiPassengerConst.EVENT_PARAM_ORDER_NUMBER, orderNo);
|
||||
params.put(TaxiPassengerConst.EVENT_PARAM_UNABLE_START_REASON, reason);
|
||||
AnalyticsManager.INSTANCE.track(TaxiPassengerConst.EVENT_KEY_AP_UNABLE_START_REASON, params);
|
||||
MogoAnalyticUtils.INSTANCE.track(TaxiPassengerConst.EVENT_KEY_AP_UNABLE_START_REASON, params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.analytics.AnalyticsManager;
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
|
||||
@@ -66,7 +66,7 @@ public class TaxiAnalyticsManager {
|
||||
mStartAutopilotParams.put(TaxiConst.EVENT_PARAM_START_RESULT,
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState() ==
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING);
|
||||
AnalyticsManager.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
|
||||
MogoAnalyticUtils.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
|
||||
|
||||
clearStartAutopilotParams();//清空参数数据,防止误传
|
||||
}
|
||||
@@ -112,7 +112,7 @@ public class TaxiAnalyticsManager {
|
||||
clearStartAutopilotFailureMSG();
|
||||
removeWaitingCallback();
|
||||
mStartAutopilotParams.put(TaxiConst.EVENT_PARAM_START_RESULT, true);
|
||||
AnalyticsManager.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
|
||||
MogoAnalyticUtils.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
|
||||
|
||||
clearStartAutopilotParams();//清空参数数据,防止误传
|
||||
} else {
|
||||
@@ -144,6 +144,6 @@ public class TaxiAnalyticsManager {
|
||||
params.put(TaxiConst.EVENT_PARAM_END_NAME, endName);
|
||||
params.put(TaxiConst.EVENT_PARAM_ORDER_NUMBER, orderNo);
|
||||
params.put(TaxiConst.EVENT_PARAM_UNABLE_START_REASON, reason);
|
||||
AnalyticsManager.INSTANCE.track(TaxiConst.EVENT_KEY_AP_UNABLE_START_REASON, params);
|
||||
MogoAnalyticUtils.INSTANCE.track(TaxiConst.EVENT_KEY_AP_UNABLE_START_REASON, params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ 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.obu.V2xObuEventManager
|
||||
import com.mogo.eagle.function.biz.v2x.overview.OverViewDataManager
|
||||
import com.mogo.eagle.function.biz.v2x.overview.db.OverviewDb
|
||||
import com.mogo.eagle.function.biz.v2x.road.LineUploadManager
|
||||
@@ -44,6 +45,7 @@ class FuncBizProvider : IMoGoFuncBizProvider {
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
LineUploadManager.getInstance(context)?.init()
|
||||
}
|
||||
V2xObuEventManager.init(context)
|
||||
// RedLightWarningManager.INSTANCE.listenTrafficLight()
|
||||
}
|
||||
|
||||
@@ -110,6 +112,7 @@ class FuncBizProvider : IMoGoFuncBizProvider {
|
||||
LineUploadManager.getInstance(it)?.onDestroy()
|
||||
}
|
||||
}
|
||||
V2xObuEventManager.release()
|
||||
// RedLightWarningManager.INSTANCE.onDestroy()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.mogo.eagle.function.biz.v2x.obu
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
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.obu.IMoGoObuSaveMessageListener
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuSaveMessageListenerManager
|
||||
|
||||
/**
|
||||
* 处理obu分发出来,在消息盒子展示的消息
|
||||
*/
|
||||
object V2xObuEventManager : IMoGoObuSaveMessageListener {
|
||||
|
||||
private const val TAG = "V2xObuEventManager"
|
||||
|
||||
fun init(context: Context) {
|
||||
registerListener()
|
||||
}
|
||||
|
||||
private fun registerListener() {
|
||||
CallerObuSaveMessageListenerManager.addListener(TAG,this)
|
||||
}
|
||||
|
||||
private fun unRegisterListener() {
|
||||
CallerObuSaveMessageListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param type 事件id,类似与uuid
|
||||
* @param content 事件内容
|
||||
* @param tts 事件语音播报
|
||||
*/
|
||||
override fun onMoGoObuSaveMessage(type: String, content: String, tts: String) {
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.V2X,
|
||||
V2XMsg(
|
||||
type,
|
||||
content,
|
||||
tts
|
||||
)
|
||||
).apply {
|
||||
sourceType = DataSourceType.OBU
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun release() {
|
||||
unRegisterListener()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.mogo.eagle.core.function.chat.facade.analytics
|
||||
|
||||
import com.mogo.commons.analytics.AnalyticsUtils
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils
|
||||
import com.mogo.eagle.core.function.api.chat.biz.IMoGoAnalyticsFacade
|
||||
|
||||
object ChatAnalyticsFacade: IMoGoAnalyticsFacade {
|
||||
|
||||
override fun track(eventType: String, data: Map<String, Any>?) {
|
||||
AnalyticsUtils.track(eventType, data)
|
||||
override fun track(eventType: String, data: MutableMap<String, Any>) {
|
||||
MogoAnalyticUtils.track(eventType, data)
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ object MoGoLocationDispatcher :
|
||||
IMoGoObuLocationWGS84Listener,
|
||||
AMapLocationListener {
|
||||
|
||||
private val TAG = "MoGoLocationManager"
|
||||
private const val TAG = "MoGoLocationManager"
|
||||
|
||||
private var mCityCode: String? = null
|
||||
private var mapLocation: AMapLocation? = null
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuConnectListenerManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuSaveMessageListenerManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuWarningListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
@@ -968,18 +969,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
* 保存obu直连数据到消息盒子
|
||||
*/
|
||||
private fun saveObuData(type: String, content: String, tts: String) {
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.V2X,
|
||||
V2XMsg(
|
||||
type,
|
||||
content,
|
||||
tts
|
||||
)
|
||||
).apply {
|
||||
sourceType = DataSourceType.OBU
|
||||
}
|
||||
)
|
||||
CallerObuSaveMessageListenerManager.invokeObuSaveMessage(type, content, tts)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.getMisChannelCode
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils
|
||||
@@ -38,6 +39,7 @@ object SyncConfig {
|
||||
AppConfigInfo.mapSdkOptVersion = DebugConfig.getMapOptVersion()
|
||||
AppConfigInfo.isConnectNet = NetworkUtils.isConnected(context)
|
||||
AppConfigInfo.isConnectSocket = MogoStatusManager.getInstance().isSocketOnLine
|
||||
AppConfigInfo.role = AppIdentityModeUtils.getMisChannelCode(FunctionBuildConfig.appIdentityMode)
|
||||
when {
|
||||
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) -> {// 司机端
|
||||
AppConfigInfo.isDriver = true
|
||||
|
||||
@@ -87,7 +87,7 @@ dependencies {
|
||||
api project(':test:crashreport-apmbyte')
|
||||
|
||||
compileOnly project(':core:function-impl:mogo-core-function-datacenter')
|
||||
compileOnly project(':foudations:mogo-commons')
|
||||
implementation project(':foudations:mogo-commons')
|
||||
api project(':core:mogo-core-res')
|
||||
compileOnly project(':core:mogo-core-utils')
|
||||
compileOnly project(':core:mogo-core-function-call')
|
||||
|
||||
@@ -33,7 +33,7 @@ class AccelerationFloatWindow constructor(activity: Activity) : View.OnTouchList
|
||||
private var mInScreenY = 0f
|
||||
|
||||
init {
|
||||
initFloatWindow();
|
||||
initFloatWindow()
|
||||
}
|
||||
|
||||
private fun initFloatWindow() {
|
||||
|
||||
@@ -65,7 +65,7 @@ class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener {
|
||||
private var ipcWarningReportList: List<ReportEntity>? = null//警告上报列表
|
||||
|
||||
init {
|
||||
initFloatWindow();
|
||||
initFloatWindow()
|
||||
}
|
||||
|
||||
private fun initFloatWindow() {
|
||||
|
||||
@@ -45,7 +45,9 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
defStyleAttr
|
||||
), IMoGoAutopilotStatusListener {
|
||||
|
||||
private val TAG = "AutoPilotAndCheckView"
|
||||
companion object{
|
||||
private const val TAG = "AutoPilotAndCheckView"
|
||||
}
|
||||
|
||||
private var clickListener: ClickListener? = null
|
||||
private var keyBoardUtil: KeyBoardUtil? = null
|
||||
@@ -57,10 +59,11 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
initView()
|
||||
}
|
||||
|
||||
companion object {
|
||||
private var maxAcceleration: Double = 2.0
|
||||
private var speedLimit: Int = 0
|
||||
}
|
||||
@Volatile
|
||||
private var maxAcceleration: Double = 2.0
|
||||
|
||||
@Volatile
|
||||
private var speedLimit: Int = 0
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
private fun initView() {
|
||||
|
||||
@@ -30,7 +30,7 @@ class BusOperationView @JvmOverloads constructor(
|
||||
context?.let {
|
||||
actvAccountPhone.text = phoneMask(SharedPrefs.getInstance(it).getString("och_account",""))
|
||||
}
|
||||
clickPersonalRightView();
|
||||
clickPersonalRightView()
|
||||
}
|
||||
|
||||
private fun initPersonalIcon() {
|
||||
|
||||
@@ -94,48 +94,51 @@ class PncActionsView @JvmOverloads constructor(
|
||||
|
||||
@BizConfig(FOUNDATION, "", BIZ_PNC_ACTIONS)
|
||||
override fun pncActions(planningActionMsg: MessagePad.PlanningActionMsg) {
|
||||
mAutoPilotStatusInfo?.let {
|
||||
if (it.state == STATUS_AUTOPILOT_RUNNING) {
|
||||
try {
|
||||
mAutoPilotStatusInfo?.let {
|
||||
UiThreadHandler.post {
|
||||
var actions: String? = null
|
||||
planningActionMsg.actionMsg?.let { it ->
|
||||
try {
|
||||
actions = PncActionsHelper.getAction(
|
||||
it.drivingState.number,
|
||||
it.drivingAction.number
|
||||
)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
if (it.state == STATUS_AUTOPILOT_RUNNING) {
|
||||
var actions: String? = null
|
||||
planningActionMsg.actionMsg?.let { it ->
|
||||
try {
|
||||
actions = PncActionsHelper.getAction(
|
||||
it.drivingState.number,
|
||||
it.drivingAction.number
|
||||
)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
//如果是存在云端红绿灯数据条件下,设置云端数据
|
||||
if (PncActionsHelper.isWaitingTrafficlight(
|
||||
it.drivingState.number,
|
||||
it.drivingAction.number
|
||||
)
|
||||
&& mTrafficLightResult != null
|
||||
&& getWaitTrafficLightTime().isNotBlank()
|
||||
) {
|
||||
actions += ",预计${getWaitTrafficLightTime()}秒后通过"
|
||||
} else {
|
||||
mTrafficLightResult = null
|
||||
}
|
||||
}
|
||||
//如果是存在云端红绿灯数据条件下,设置云端数据
|
||||
if (PncActionsHelper.isWaitingTrafficlight(
|
||||
it.drivingState.number,
|
||||
it.drivingAction.number
|
||||
)
|
||||
&& mTrafficLightResult != null
|
||||
&& getWaitTrafficLightTime().isNotBlank()
|
||||
) {
|
||||
actions += ",预计${getWaitTrafficLightTime()}秒后通过"
|
||||
// update view
|
||||
if (actions.isNullOrEmpty()) {
|
||||
this.background = null
|
||||
tvHmiPncActions.text = ""
|
||||
} else {
|
||||
mTrafficLightResult = null
|
||||
this.background =
|
||||
AppCompatResources.getDrawable(context, bgResources)
|
||||
tvHmiPncActions.text = actions
|
||||
}
|
||||
}
|
||||
// update view
|
||||
if (actions.isNullOrEmpty()) {
|
||||
} else {
|
||||
this.background = null
|
||||
tvHmiPncActions.text = ""
|
||||
} else {
|
||||
this.background =
|
||||
AppCompatResources.getDrawable(context, bgResources)
|
||||
tvHmiPncActions.text = actions
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.background = null
|
||||
tvHmiPncActions.text = ""
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) {
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import kotlinx.android.synthetic.main.view_blue_tooth.view.*
|
||||
|
||||
/**
|
||||
@@ -41,10 +42,12 @@ open class BlueToothView @JvmOverloads constructor(
|
||||
|
||||
override fun mofangStatus(status: Boolean) {
|
||||
super.mofangStatus(status)
|
||||
if (status) {
|
||||
mofangView.setImageResource(R.drawable.icon_bluetooth_p)
|
||||
} else {
|
||||
mofangView.setImageResource(R.drawable.blue_tooth)
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (status) {
|
||||
mofangView.setImageResource(R.drawable.icon_bluetooth_p)
|
||||
} else {
|
||||
mofangView.setImageResource(R.drawable.blue_tooth)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.DockerRebootDialog
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import kotlinx.android.synthetic.main.view_check_system.view.*
|
||||
|
||||
@@ -106,7 +107,9 @@ class CheckSystemView @JvmOverloads constructor(
|
||||
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
|
||||
connectStatus = autoPilotStatusInfo.connectStatus
|
||||
autopilotStatus = autoPilotStatusInfo.state
|
||||
setViewStatus()
|
||||
ThreadUtils.runOnUiThread {
|
||||
setViewStatus()
|
||||
}
|
||||
}
|
||||
|
||||
private fun setViewStatus() {
|
||||
|
||||
@@ -8,7 +8,6 @@ import android.util.AttributeSet
|
||||
import android.util.DisplayMetrics
|
||||
import android.view.View
|
||||
import android.view.animation.LinearInterpolator
|
||||
import android.view.animation.OvershootInterpolator
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
|
||||
@@ -22,7 +21,6 @@ class CircularProgressView @JvmOverloads constructor(
|
||||
: View(context, attrs, defStyleAttr) {
|
||||
|
||||
val typedArray: TypedArray = context.obtainStyledAttributes(attrs, R.styleable.CircularProgressView)
|
||||
val TAG: String = "CircularProgressView"
|
||||
|
||||
// 绘制画笔
|
||||
private val mBackPaint: Paint = Paint()
|
||||
@@ -66,17 +64,17 @@ class CircularProgressView @JvmOverloads constructor(
|
||||
} else {
|
||||
mConvertColorsArray = null
|
||||
}
|
||||
typedArray.recycle();
|
||||
typedArray.recycle()
|
||||
}
|
||||
|
||||
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec)
|
||||
val viewWide = getMeasuredWidth() - getPaddingLeft() - getPaddingRight();
|
||||
val viewHigh = getMeasuredHeight() - getPaddingTop() - getPaddingBottom();
|
||||
val viewWide = measuredWidth - paddingLeft - paddingRight
|
||||
val viewHigh = measuredHeight - paddingTop - paddingBottom
|
||||
val mRectLength =
|
||||
((if (viewWide > viewHigh) viewHigh else viewWide) - if (mBackPaint.strokeWidth > mProgPaint.strokeWidth) mBackPaint.strokeWidth else mProgPaint.strokeWidth).toInt()
|
||||
val mRectL = getPaddingLeft() + (viewWide - mRectLength) / 2
|
||||
val mRectT = getPaddingTop() + (viewHigh - mRectLength) / 2
|
||||
val mRectL = paddingLeft + (viewWide - mRectLength) / 2
|
||||
val mRectT = paddingTop + (viewHigh - mRectLength) / 2
|
||||
mRectF = RectF(mRectL.toFloat(), mRectT.toFloat(), (mRectL + mRectLength).toFloat(),
|
||||
(mRectT + mRectLength).toFloat())
|
||||
|
||||
@@ -94,13 +92,13 @@ class CircularProgressView @JvmOverloads constructor(
|
||||
return
|
||||
}
|
||||
val position = FloatArray(2)
|
||||
position[0] = 0.0f;
|
||||
position[0] = 0.0f
|
||||
position[1] = mProgress.toFloat() * 0.01f
|
||||
val sweepGradient = SweepGradient((measuredWidth / 2).toFloat(), (measuredHeight / 2).toFloat(), mConvertColorsArray!!, position)
|
||||
val matrix = Matrix()
|
||||
matrix.setRotate(-90F, (measuredWidth / 2).toFloat(), (measuredHeight / 2).toFloat())
|
||||
sweepGradient.setLocalMatrix(matrix);
|
||||
mProgPaint.setShader(sweepGradient)
|
||||
mProgPaint.shader = sweepGradient
|
||||
}
|
||||
|
||||
override fun onDraw(canvas: Canvas?) {
|
||||
@@ -109,7 +107,7 @@ class CircularProgressView @JvmOverloads constructor(
|
||||
mRectF?.let { it1 -> it.drawArc(it1, 0.0f, 360.0f, false, mBackPaint) }
|
||||
mRectF?.let { it1 ->
|
||||
sweepGradient()
|
||||
var degree: Float = 3.6f * (mProgress.toFloat())
|
||||
val degree: Float = 3.6f * (mProgress.toFloat())
|
||||
if(mProgress>=0) {
|
||||
it.drawArc(it1, 275.0f, degree, false, mProgPaint)
|
||||
}else{
|
||||
@@ -121,8 +119,8 @@ class CircularProgressView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
fun setBlurMaskFilter(blur: BlurMaskFilter.Blur, radius: Float) {
|
||||
var blur: BlurMaskFilter = BlurMaskFilter(radius, blur)
|
||||
mProgPaint.setMaskFilter(blur)
|
||||
val temp = BlurMaskFilter(radius, blur)
|
||||
mProgPaint.maskFilter = temp
|
||||
invalidate()
|
||||
}
|
||||
|
||||
@@ -222,12 +220,11 @@ class CircularProgressView @JvmOverloads constructor(
|
||||
return
|
||||
}
|
||||
mConvertColorsArray = it.copyOf()
|
||||
mConvertColorsArray?.let {
|
||||
mConvertColorsArray?.let { color ->
|
||||
mProgPaint.shader = LinearGradient(0f, 0f, 0f,
|
||||
getMeasuredWidth().toFloat(), it, null, Shader.TileMode.MIRROR)
|
||||
measuredWidth.toFloat(), color, null, Shader.TileMode.MIRROR)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,252 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.BlurMaskFilter;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.animation.RotateAnimation;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGearStateListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisSteeringStateListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisGearStateListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisSteeringStateListenerManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import chassis.Chassis;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
import system_master.SystemStatusInfo;
|
||||
|
||||
/**
|
||||
* @author Jing
|
||||
* @description 方向盘
|
||||
* 方向盘跟随CAN数据做旋转
|
||||
* 档位随CAN数据做切换和高亮显示
|
||||
* @since: 4/7/22
|
||||
*/
|
||||
public class SteeringWheelView extends ConstraintLayout implements
|
||||
IMoGoChassisSteeringStateListener,
|
||||
IMoGoChassisGearStateListener {
|
||||
private static final String TAG = "SteeringWheelView";
|
||||
private ImageView autopilotIV;
|
||||
private TextView steeringTVL;
|
||||
private TextView steeringTVR;
|
||||
private TapPositionView tapPositionView;
|
||||
private CircularProgressView steeringCircularV;
|
||||
private CircularProgressView steeringCircularVAlpha;
|
||||
private RotateAnimation rotateAnimation;
|
||||
private float fromDegrees = 0;//方向盘旋转起始位置
|
||||
|
||||
public SteeringWheelView(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public SteeringWheelView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_bus, this);
|
||||
} else {
|
||||
LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_taxi, this);
|
||||
}
|
||||
initView();
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
|
||||
CallerChassisGearStateListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerChassisSteeringStateListenerManager.INSTANCE.addListener(TAG, this);
|
||||
tapPositionView.updateWithGear(Chassis.GearPosition.GEAR_R);
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
autopilotIV = (ImageView) findViewById(R.id.autopilot_iv);
|
||||
steeringTVL = findViewById(R.id.steering_tv_left);
|
||||
steeringTVR = findViewById(R.id.steering_tv_right);
|
||||
tapPositionView = findViewById(R.id.tap_position);
|
||||
steeringCircularV = findViewById(R.id.steering_circular);
|
||||
steeringCircularV.setBackWidth(8);
|
||||
steeringCircularV.setBackColor(R.color.hmi_light_back_bg);
|
||||
steeringCircularV.setProgress((int) (0 * 100) / 360, 20);
|
||||
steeringCircularV.setProgColor(R.color.hmi_light_blue, R.color.hmi_dark_blue);
|
||||
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
|
||||
steeringCircularVAlpha = findViewById(R.id.steering_circular_alpha);
|
||||
steeringCircularVAlpha.setProgress((int) (0 * 100) / 360, 20);
|
||||
steeringCircularV.setProgColor(R.color.hmi_dark_blue, R.color.hmi_light_blue);
|
||||
steeringCircularVAlpha.setBackWidth(8);
|
||||
steeringCircularVAlpha.setBackColor(R.color.hmi_clear_00);
|
||||
steeringCircularVAlpha.setProgColor(R.color.hmi_light_blue_alpha_ff, R.color.hmi_light_blue_alpha_00);
|
||||
steeringCircularVAlpha.setBlurMaskFilter(BlurMaskFilter.Blur.NORMAL, 12);
|
||||
}
|
||||
}
|
||||
|
||||
public SteeringWheelView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
public SteeringWheelView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
|
||||
private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener() {
|
||||
|
||||
@Override
|
||||
public void onAutopilotRouteLineId(long lineId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotIpcConnectStatusChanged(int status, @Nullable String reason) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotArriveAtStation(@org.jetbrains.annotations.Nullable MessagePad.ArrivalNotification arrivalNotification) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autopilotStatusInfo) {
|
||||
ThreadUtils.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (autopilotStatusInfo == null) return;
|
||||
int state = autopilotStatusInfo.getState();
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "state = %s", state);
|
||||
if (autopilotIV != null) {
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
// TODO
|
||||
|
||||
} else {
|
||||
autopilotIV.setImageResource(R.drawable.bg_auto);
|
||||
}
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) {
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
// TODO
|
||||
|
||||
} else {
|
||||
autopilotIV.setImageResource(R.drawable.bg_auto_nor);
|
||||
}
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) {
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
// TODO
|
||||
|
||||
} else {
|
||||
autopilotIV.setImageResource(R.drawable.bg_auto_nor);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
CallerLogger.INSTANCE.d(TAG, "autopilotIV=null");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotSNRequest() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 方向盘转向角 左+右-
|
||||
* @param steering
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotSteeringData(float steering) {
|
||||
if (Math.abs(steering) < 1) {
|
||||
steering = 0;
|
||||
}
|
||||
float steeringValue = steering;
|
||||
ThreadUtils.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (steeringTVL != null && steeringValue > 0) {
|
||||
steeringTVR.setVisibility(View.INVISIBLE);
|
||||
steeringTVL.setVisibility(View.VISIBLE);
|
||||
steeringTVL.setText(String.valueOf((int) steeringValue) + "°");
|
||||
} else if (steeringTVR != null && steeringValue <= 0) {
|
||||
steeringTVL.setVisibility(View.INVISIBLE);
|
||||
steeringTVR.setVisibility(View.VISIBLE);
|
||||
steeringTVR.setText(String.valueOf((int) -steeringValue) + "°");
|
||||
} else {
|
||||
CallerLogger.INSTANCE.d(TAG, "onAutopilotSteeringData error");
|
||||
}
|
||||
animationWithSteeringData(-steeringValue);
|
||||
if (steeringCircularV != null) {
|
||||
steeringCircularV.setProgress((int) (-steeringValue * 100) / 360, 20);
|
||||
}
|
||||
if (steeringCircularVAlpha != null) {
|
||||
steeringCircularVAlpha.setProgress((int) (-steeringValue * 100) / 360, 20);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 档位
|
||||
* @param gear
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotGearData(@NotNull Chassis.GearPosition gear) {
|
||||
ThreadUtils.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
CallerLogger.INSTANCE.d(TAG, "乘客屏档位" + gear.toString());
|
||||
if (tapPositionView != null) {
|
||||
tapPositionView.updateWithGear(gear);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 方向盘随CAN数据做方向和角度旋转
|
||||
* 参数1从哪一个旋转角度开始
|
||||
* 参数2:转到什么角度
|
||||
* 后4个参数用于设置围绕着旋转的圆的圆心在哪里
|
||||
* 参数3:肯定x轴坐标的类型,有ABSOLUT绝对坐标、RELATIVE_TO_SELF相对于自身坐标、RELATIVE_TO_PARENT相对于父控件的坐标
|
||||
* 参数4:x轴的值,0.5f代表是以自身这个控件的一半长度为x轴
|
||||
* 参数5:肯定y轴坐标的类型
|
||||
* 参数6:y轴的值,0.5f代表是以自身这个控件的一半长度为x轴
|
||||
*
|
||||
* @param steering
|
||||
*/
|
||||
private void animationWithSteeringData(float steering) {
|
||||
rotateAnimation = new RotateAnimation(fromDegrees, steering,
|
||||
RotateAnimation.RELATIVE_TO_SELF, 0.5f,
|
||||
RotateAnimation.RELATIVE_TO_SELF, 0.5f);
|
||||
rotateAnimation.setDuration(20);//旋转时长
|
||||
rotateAnimation.setFillAfter(true);//旋转后保持原状
|
||||
autopilotIV.clearAnimation();
|
||||
autopilotIV.startAnimation(rotateAnimation);
|
||||
fromDegrees = steering;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.BlurMaskFilter
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.animation.RotateAnimation
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import chassis.Chassis.GearPosition
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGearStateListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisSteeringStateListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisGearStateListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisSteeringStateListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isBus
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isTaxi
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import kotlin.math.abs
|
||||
|
||||
/**
|
||||
* @author Jing
|
||||
* @description 方向盘
|
||||
* 方向盘跟随CAN数据做旋转
|
||||
* 档位随CAN数据做切换和高亮显示
|
||||
* @since: 4/7/22
|
||||
*/
|
||||
class SteeringWheelView : ConstraintLayout, IMoGoChassisSteeringStateListener,
|
||||
IMoGoChassisGearStateListener {
|
||||
private var autopilotIV: ImageView? = null
|
||||
private var steeringTVL: TextView? = null
|
||||
private var steeringTVR: TextView? = null
|
||||
private var tapPositionView: TapPositionView? = null
|
||||
private var steeringCircularV: CircularProgressView? = null
|
||||
private var steeringCircularVAlpha: CircularProgressView? = null
|
||||
private var rotateAnimation: RotateAnimation? = null
|
||||
private var fromDegrees = 0f //方向盘旋转起始位置
|
||||
|
||||
constructor(context: Context) : super(context) {}
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
|
||||
if (isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_bus, this)
|
||||
} else {
|
||||
LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_taxi, this)
|
||||
}
|
||||
initView()
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, mGoAutopilotStatusListener)
|
||||
CallerChassisGearStateListenerManager.addListener(TAG, this)
|
||||
CallerChassisSteeringStateListenerManager.addListener(TAG, this)
|
||||
tapPositionView?.updateWithGear(GearPosition.GEAR_R)
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
autopilotIV = findViewById<View>(R.id.autopilot_iv) as ImageView
|
||||
steeringTVL = findViewById(R.id.steering_tv_left)
|
||||
steeringTVR = findViewById(R.id.steering_tv_right)
|
||||
tapPositionView = findViewById(R.id.tap_position)
|
||||
steeringCircularV = findViewById(R.id.steering_circular)
|
||||
steeringCircularV?.setBackWidth(8)
|
||||
steeringCircularV?.setBackColor(R.color.hmi_light_back_bg)
|
||||
steeringCircularV?.setProgress((0 * 100) / 360, 20)
|
||||
steeringCircularV?.setProgColor(R.color.hmi_light_blue, R.color.hmi_dark_blue)
|
||||
if (isTaxi(FunctionBuildConfig.appIdentityMode)) {
|
||||
steeringCircularVAlpha = findViewById(R.id.steering_circular_alpha)
|
||||
steeringCircularVAlpha?.setProgress((0 * 100) / 360, 20)
|
||||
steeringCircularV?.setProgColor(R.color.hmi_dark_blue, R.color.hmi_light_blue)
|
||||
steeringCircularVAlpha?.setBackWidth(8)
|
||||
steeringCircularVAlpha?.setBackColor(R.color.hmi_clear_00)
|
||||
steeringCircularVAlpha?.setProgColor(
|
||||
R.color.hmi_light_blue_alpha_ff,
|
||||
R.color.hmi_light_blue_alpha_00
|
||||
)
|
||||
steeringCircularVAlpha?.setBlurMaskFilter(BlurMaskFilter.Blur.NORMAL, 12f)
|
||||
}
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
) {
|
||||
}
|
||||
|
||||
private val mGoAutopilotStatusListener: IMoGoAutopilotStatusListener =
|
||||
object : IMoGoAutopilotStatusListener {
|
||||
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
val state = autoPilotStatusInfo.state
|
||||
d("$M_BUS_P$TAG", "state = %s", state)
|
||||
if (autopilotIV != null) {
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
if (!isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
autopilotIV?.setImageResource(R.drawable.bg_auto)
|
||||
}
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) {
|
||||
if (!isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
autopilotIV?.setImageResource(R.drawable.bg_auto_nor)
|
||||
}
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) {
|
||||
if (!isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
autopilotIV?.setImageResource(R.drawable.bg_auto_nor)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
d("$M_BUS_P$TAG", "autopilotIV=null")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 方向盘转向角 左+右-
|
||||
* @param steering
|
||||
*/
|
||||
override fun onAutopilotSteeringData(steering: Float) {
|
||||
var temp = steering
|
||||
if (abs(steering) < 1) {
|
||||
temp = 0f
|
||||
}
|
||||
val steeringValue = temp
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (steeringTVL != null && steeringValue > 0) {
|
||||
steeringTVR?.visibility = INVISIBLE
|
||||
steeringTVL?.visibility = VISIBLE
|
||||
steeringTVL?.text = "${steeringValue}°"
|
||||
} else if (steeringTVR != null && steeringValue <= 0) {
|
||||
steeringTVL?.visibility = INVISIBLE
|
||||
steeringTVR?.visibility = VISIBLE
|
||||
steeringTVR?.text = "${-steeringValue}°"
|
||||
} else {
|
||||
d(TAG, "onAutopilotSteeringData error")
|
||||
}
|
||||
animationWithSteeringData(-steeringValue)
|
||||
if (steeringCircularV != null) {
|
||||
steeringCircularV?.setProgress((-steeringValue * 100).toInt() / 360, 20)
|
||||
}
|
||||
if (steeringCircularVAlpha != null) {
|
||||
steeringCircularVAlpha?.setProgress((-steeringValue * 100).toInt() / 360, 20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 档位
|
||||
* @param gear
|
||||
*/
|
||||
override fun onAutopilotGearData(gear: GearPosition) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
d(TAG, "乘客屏档位$gear")
|
||||
if (tapPositionView != null) {
|
||||
tapPositionView?.updateWithGear(gear)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 方向盘随CAN数据做方向和角度旋转
|
||||
* 参数1从哪一个旋转角度开始
|
||||
* 参数2:转到什么角度
|
||||
* 后4个参数用于设置围绕着旋转的圆的圆心在哪里
|
||||
* 参数3:肯定x轴坐标的类型,有ABSOLUT绝对坐标、RELATIVE_TO_SELF相对于自身坐标、RELATIVE_TO_PARENT相对于父控件的坐标
|
||||
* 参数4:x轴的值,0.5f代表是以自身这个控件的一半长度为x轴
|
||||
* 参数5:肯定y轴坐标的类型
|
||||
* 参数6:y轴的值,0.5f代表是以自身这个控件的一半长度为x轴
|
||||
*
|
||||
* @param steering
|
||||
*/
|
||||
private fun animationWithSteeringData(steering: Float) {
|
||||
rotateAnimation = RotateAnimation(
|
||||
fromDegrees, steering,
|
||||
RotateAnimation.RELATIVE_TO_SELF, 0.5f,
|
||||
RotateAnimation.RELATIVE_TO_SELF, 0.5f
|
||||
)
|
||||
rotateAnimation?.duration = 20 //旋转时长
|
||||
rotateAnimation?.fillAfter = true //旋转后保持原状
|
||||
autopilotIV?.clearAnimation()
|
||||
autopilotIV?.startAnimation(rotateAnimation)
|
||||
fromDegrees = steering
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "SteeringWheelView"
|
||||
}
|
||||
}
|
||||
@@ -69,14 +69,6 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
ivPadVersion.setOnClickListener {
|
||||
CallerLogger.i("$M_HMI$$TAG", "pad version view clicked")
|
||||
CallerDevaToolsManager.queryAppUpgrade()
|
||||
//弹框和下载回调
|
||||
// showUpgradeDialog(
|
||||
// "",
|
||||
// "",
|
||||
// "",
|
||||
// "",
|
||||
// "1"
|
||||
// )
|
||||
}
|
||||
|
||||
//工控机版本视图点击事件
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.kwai.koom.nativeoom.leakmonitor.LeakListener
|
||||
import com.kwai.koom.nativeoom.leakmonitor.LeakMonitor.start
|
||||
import com.kwai.koom.nativeoom.leakmonitor.LeakMonitorConfig
|
||||
import com.kwai.koom.nativeoom.leakmonitor.LeakRecord
|
||||
import com.mogo.commons.analytics.AnalyticsUtils
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils
|
||||
import com.mogo.commons.context.ContextHolderUtil
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
@@ -158,7 +158,7 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
properties["app_launch_hotStartTime"] = hotStartTime
|
||||
}
|
||||
}
|
||||
AnalyticsUtils.track("app_launch_time", properties)
|
||||
MogoAnalyticUtils.track("app_launch_time", properties)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,10 @@ import android.os.Process;
|
||||
import com.bytedance.boost_multidex.BoostMultiDex;
|
||||
import com.mogo.cloud.socket.SocketBuildConfig;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.module.MogoModule;
|
||||
import com.mogo.commons.module.MogoModulePaths;
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.function.api.chat.biz.ChatConsts;
|
||||
@@ -111,6 +113,8 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 初始化埋点
|
||||
MogoAnalyticUtils.INSTANCE.init(this, DebugConfig.isDebug());
|
||||
SocketBuildConfig.isPrintLog = false;
|
||||
// 初始化DevaTools,开始链路记录
|
||||
CallerDevaToolsManager.INSTANCE.init();
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.mogo.cloud.passport.IMoGoTokenCallback
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils
|
||||
import com.mogo.commons.constants.SharedPrefsConstants
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
@@ -23,7 +24,6 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CL
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.call.analytics.AnalyticsManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
@@ -217,15 +217,13 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
|
||||
ThreadPoolService.execute {
|
||||
//初始化网络配置
|
||||
NetConfigUtils.init()
|
||||
// 初始化埋点
|
||||
AnalyticsManager.init(context, DebugConfig.isDebug())
|
||||
// 加入启动统计
|
||||
val mStartParams: HashMap<String, Any> = HashMap()
|
||||
mStartParams["start_time"] = TimeUtils.getNowMills()
|
||||
mStartParams["app_version"] = AppUtils.getAppVersionName()
|
||||
mStartParams["app_flavor"] = DebugConfig.getProductFlavor();
|
||||
mStartParams["app_flavor"] = DebugConfig.getProductFlavor()
|
||||
mStartParams["app_identity_mode"] = FunctionBuildConfig.appIdentityMode
|
||||
AnalyticsManager.track("app_start_time", mStartParams)
|
||||
MogoAnalyticUtils.track("app_start_time", mStartParams)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package com.mogo.eagle.core.data.app
|
||||
|
||||
import android.os.Build
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.getMisChannelCode
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||
|
||||
/**
|
||||
@@ -62,7 +59,7 @@ object AppConfigInfo {
|
||||
var netMode: Int = 3
|
||||
|
||||
// 角色
|
||||
var role: Int = AppIdentityModeUtils.getMisChannelCode(FunctionBuildConfig.appIdentityMode)
|
||||
var role: Int = 0
|
||||
|
||||
// 是否可以网络连接
|
||||
var isConnectNet: Boolean = false
|
||||
|
||||
@@ -43,18 +43,16 @@ android {
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
|
||||
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
implementation rootProject.ext.dependencies.coroutinescore
|
||||
implementation rootProject.ext.dependencies.coroutinesandroid
|
||||
implementation project(':libraries:mogo-obu')
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
compileOnly project(path: ':libraries:mogo-adas')
|
||||
compileOnly rootProject.ext.dependencies.mogo_core_data
|
||||
compileOnly rootProject.ext.dependencies.mogomapapi
|
||||
} else {
|
||||
implementation project(':core:mogo-core-data')
|
||||
compileOnly project(':core:mogo-core-data')
|
||||
compileOnly project(':libraries:mogo-obu')
|
||||
compileOnly project(':libraries:mogo-adas')
|
||||
compileOnly project(':libraries:mogo-map-api')
|
||||
}
|
||||
|
||||
@@ -200,5 +200,5 @@ interface IMoGoMediaFacade {
|
||||
|
||||
interface IMoGoAnalyticsFacade {
|
||||
|
||||
fun track(eventType: String, data: Map<String, Any>? = hashMapOf())
|
||||
fun track(eventType: String, data: MutableMap<String, Any> = hashMapOf())
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.mogo.eagle.core.function.api.obu
|
||||
|
||||
/**
|
||||
* OBU 数据保存
|
||||
* @author lixiaopeng
|
||||
* @date 2023-02-01
|
||||
*/
|
||||
interface IMoGoObuSaveMessageListener {
|
||||
|
||||
/**
|
||||
* @param type 事件id,类似与uuid
|
||||
* @param content 事件内容
|
||||
* @param tts 事件语音播报
|
||||
*
|
||||
*/
|
||||
fun onMoGoObuSaveMessage(type: String, content: String, tts: String)
|
||||
|
||||
}
|
||||
@@ -13,5 +13,4 @@ interface IMoGoObuDcCombineListener {
|
||||
*/
|
||||
fun onMoGoObuDcCombineData(obuWarningData: ObuWarningEvent.ObuWarningData?)
|
||||
|
||||
|
||||
}
|
||||
@@ -43,23 +43,18 @@ dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
|
||||
|
||||
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
// MoGo 数据埋点工具
|
||||
implementation rootProject.ext.dependencies.analytics
|
||||
compileOnly rootProject.ext.dependencies.mogocustommap
|
||||
implementation project(':libraries:mogo-obu')
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
} else {
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':foudations:mogo-commons')
|
||||
implementation project(':libraries:mogo-adas')
|
||||
compileOnly project(':core:mogo-core-utils')
|
||||
compileOnly project(':core:mogo-core-data')
|
||||
compileOnly project(':libraries:mogo-adas')
|
||||
compileOnly project(':libraries:mogo-obu')
|
||||
api project(':libraries:mogo-map-api')
|
||||
api project(':core:mogo-core-function-api')
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Liste
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateTransform
|
||||
import com.mogo.eagle.core.utilcode.util.FileUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.call.obu
|
||||
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.support.obu.model.MogoObuHvBasicsData
|
||||
import mogo.telematics.pad.MessagePad
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.mogo.eagle.core.function.call.obu
|
||||
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuSaveMessageListener
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningRsiListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.support.obu.ObuScene
|
||||
|
||||
/**
|
||||
* OBU 保存到数据中心,展示在消息盒子的数据
|
||||
*
|
||||
*/
|
||||
object CallerObuSaveMessageListenerManager : CallerBase<IMoGoObuSaveMessageListener>() {
|
||||
|
||||
fun invokeObuSaveMessage(type: String, content: String, tts: String) {
|
||||
M_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
listener.onMoGoObuSaveMessage(type, content, tts)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.mogo.eagle.core.function.call.obucombine
|
||||
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
|
||||
import com.mogo.eagle.core.function.api.obucombine.IMoGoObuDcCombineListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import mogo.v2x.ObuWarningEvent
|
||||
@@ -15,44 +13,6 @@ object CallerObuDcCombineListenerManager : CallerBase<IMoGoObuDcCombineListener>
|
||||
private val M_DC_COMBINE_LISTENERS: ConcurrentHashMap<String, IMoGoObuDcCombineListener> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
/**
|
||||
* 添加 obu和dc数据通道 监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
* @param listener 监听回调
|
||||
*/
|
||||
// fun addListener(
|
||||
// @Nullable tag: String,
|
||||
// @Nullable listener: IMoGoObuDcCombineListener
|
||||
// ) {
|
||||
// if (M_DC_COMBINE_LISTENERS.containsKey(tag)) {
|
||||
// return
|
||||
// }
|
||||
// M_DC_COMBINE_LISTENERS[tag] = listener
|
||||
// }
|
||||
|
||||
/**
|
||||
* 删除监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
*/
|
||||
// fun removeListener(@Nullable tag: String) {
|
||||
// if (!M_DC_COMBINE_LISTENERS.containsKey(tag)) {
|
||||
// return
|
||||
// }
|
||||
// M_DC_COMBINE_LISTENERS.remove(tag)
|
||||
// }
|
||||
|
||||
/**
|
||||
* 删除自动驾驶按钮选中监听
|
||||
* @param listener 要删除的监听对象
|
||||
*/
|
||||
// fun removeListener(@Nullable listener: IMoGoObuDcCombineListener) {
|
||||
// M_DC_COMBINE_LISTENERS.forEach {
|
||||
// if (it.value == listener) {
|
||||
// M_DC_COMBINE_LISTENERS.remove(it.key)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* v2i数据
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.mogo.eagle.core.utilcode.mogo
|
||||
|
||||
|
||||
fun AppIdentityModeUtils.getMisChannelCode(appIdentityMode: String): Int {
|
||||
return when {
|
||||
isTaxi(appIdentityMode) && isPassenger(appIdentityMode) -> 1
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
apply plugin: 'com.android.library'
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
id 'kotlin-android'
|
||||
id 'kotlin-android-extensions'
|
||||
id 'kotlin-kapt'
|
||||
id 'com.alibaba.arouter'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
@@ -36,13 +42,18 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
|
||||
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
implementation rootProject.ext.dependencies.analytics
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||
implementation rootProject.ext.dependencies.rxjava
|
||||
implementation rootProject.ext.dependencies.mogoaicloudrealtime
|
||||
|
||||
implementation rootProject.ext.dependencies.amapnavi3dmap
|
||||
implementation rootProject.ext.dependencies.analytics
|
||||
|
||||
api 'org.greenrobot:eventbus:3.1.1'
|
||||
api rootProject.ext.dependencies.androidautoSize
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
api rootProject.ext.dependencies.mogoaicloudservicesdk
|
||||
@@ -60,8 +71,7 @@ dependencies {
|
||||
api project(':core:mogo-core-network')
|
||||
|
||||
}
|
||||
api 'org.greenrobot:eventbus:3.1.1'
|
||||
api rootProject.ext.dependencies.androidautoSize
|
||||
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
@@ -1,56 +0,0 @@
|
||||
package com.mogo.commons.analytics;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.elegant.analytics.Analytics;
|
||||
import com.elegant.analytics.AnalyticsConfig;
|
||||
import com.elegant.analytics.IAnalyticsParamsProvider;
|
||||
import com.elegant.analytics.UploadMode;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.network.ParamsUtil;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-23
|
||||
* <p>
|
||||
* 埋点
|
||||
*/
|
||||
public class AnalyticsUtils {
|
||||
|
||||
@Keep
|
||||
public static void init( Context context ) {
|
||||
// 1 - debug 近实时上报,积累一条埋点上报,或者积累3秒上报一次。
|
||||
// 2 - 本地缓存,聚合上报,积累30条埋点上报,或者积累60秒上报一次。
|
||||
AnalyticsConfig.getInstance( context ).setAppKey( "0915430e5fdcbb553391f2a35cb8489f" );
|
||||
AnalyticsConfig.getInstance( context ).setUploadMode( DebugConfig.isDebug() ? UploadMode.instant : UploadMode.cache );
|
||||
AnalyticsConfig.getInstance( context ).setShouldLog( DebugConfig.isDebug() );
|
||||
AnalyticsConfig.getInstance( AbsMogoApplication.getApp() ).setParamsProvider(new IAnalyticsParamsProvider() {
|
||||
@Override
|
||||
public Map< String, Object > staticParams() {
|
||||
return ParamsUtil.getAnalyticsCustomParams();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map< String, Object > dynamicParams() {
|
||||
return null;
|
||||
}
|
||||
} );
|
||||
Analytics.getInstance().start( context );
|
||||
}
|
||||
|
||||
/**
|
||||
* 埋点
|
||||
*
|
||||
* @param event 事件名称
|
||||
* @param properties 事件参数
|
||||
*/
|
||||
public static void track( String event, Map< String, Object > properties ) {
|
||||
Analytics.getInstance().track( event, properties );
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.call.analytics
|
||||
package com.mogo.commons.utils
|
||||
|
||||
import android.content.Context
|
||||
import androidx.annotation.Keep
|
||||
@@ -15,7 +15,7 @@ import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||
* 埋点&数据统计 管理
|
||||
* @author donghongyu
|
||||
*/
|
||||
object AnalyticsManager {
|
||||
object MogoAnalyticUtils {
|
||||
|
||||
@Keep
|
||||
fun init(context: Context?, isDebug: Boolean) {
|
||||
@@ -45,7 +45,7 @@ object AnalyticsManager {
|
||||
* @param event 事件名称
|
||||
* @param properties 事件参数
|
||||
*/
|
||||
fun track(event: String?, properties: HashMap<String, Any>) {
|
||||
fun track(event: String?, properties: MutableMap<String, Any>) {
|
||||
Analytics.getInstance().track(event, properties)
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import mogo.telematics.pad.MessagePad;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
|
||||
/**
|
||||
* 自动驾驶启动统计
|
||||
* 自动驾驶启动统计 todo 凤坤,后续封装成pb,或者放入adas-data
|
||||
*/
|
||||
public class AutopilotStatistics {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user