Merge branch 'dev_robotaxi-d_240523_6.4.4' into dev_robo_240612_6.5.0_tmp
This commit is contained in:
@@ -21,6 +21,7 @@ import com.mogo.eagle.core.utilcode.mogo.view.SpacesItemDecoration
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.bus.R
|
||||
import com.mogo.och.bus.bean.response.BusQueryLineTaskResponse
|
||||
import com.mogo.och.common.module.utils.ResourcesUtils
|
||||
import java.util.ArrayList
|
||||
|
||||
/**
|
||||
@@ -139,7 +140,7 @@ class BusSwitchLineActivity : MvpActivity<BusSwitchLineView?, BusLinePresenter?>
|
||||
}
|
||||
|
||||
override fun onChangeLineIdSuccess() {
|
||||
ToastUtils.showLong(resources.getString(R.string.bus_change_line_commit_tip_s))
|
||||
ToastUtils.showLong(ResourcesUtils.getString(R.string.bus_change_line_commit_tip_s))
|
||||
mPresenter?.queryBusRoutes()
|
||||
mAdapter.setOnLineItemClickListener(null)
|
||||
mPresenter?.removeListener()
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.passenger.presenter.PM2DrivingPresenter
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil.*
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil
|
||||
import com.mogo.och.common.module.utils.ResourcesUtils
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
import kotlinx.android.synthetic.main.bus_p_m2_driving_info_fragment.auto_tv
|
||||
import kotlinx.android.synthetic.main.bus_p_m2_driving_info_fragment.clg_distance_left_time
|
||||
@@ -66,12 +67,12 @@ class PM2DrivingInfoFragment :
|
||||
true
|
||||
}
|
||||
|
||||
line_name_tv.setTextColor(resources.getColor(R.color.bus_p_m2_line_name_tv_color))
|
||||
station_name_tv.setTextColor(resources.getColor(R.color.bus_p_m2_line_name_tv_color))
|
||||
line_name_tv.setTextColor(ResourcesUtils.getColor(R.color.bus_p_m2_line_name_tv_color))
|
||||
station_name_tv.setTextColor(ResourcesUtils.getColor(R.color.bus_p_m2_line_name_tv_color))
|
||||
speed_tv.setVertrial(true)
|
||||
val intArrayOf = intArrayOf(
|
||||
requireContext().resources.getColor(R.color.bus_p_m2_color_43cefe),
|
||||
requireContext().resources.getColor(R.color.bus_p_m2_color_1466fb)
|
||||
ResourcesUtils.getColor(R.color.bus_p_m2_color_43cefe),
|
||||
ResourcesUtils.getColor(R.color.bus_p_m2_color_1466fb)
|
||||
)
|
||||
speed_tv.setmColorList(intArrayOf)
|
||||
|
||||
@@ -152,7 +153,7 @@ class PM2DrivingInfoFragment :
|
||||
}
|
||||
|
||||
fun showNoTaskView(){
|
||||
line_name_tv.text = resources.getString(R.string.bus_p_m2_not_select_line_content)
|
||||
line_name_tv.text = ResourcesUtils.getString(R.string.bus_p_m2_not_select_line_content)
|
||||
updateNoStationView()
|
||||
overMapView?.let {
|
||||
it.clearSiteMarkers()
|
||||
@@ -166,10 +167,10 @@ class PM2DrivingInfoFragment :
|
||||
}
|
||||
}
|
||||
private fun updateNoStationView(){
|
||||
station_name_tv.setTextColor(resources.getColor(R.color.bus_p_m2_next_tv_color))
|
||||
station_name_tv.text = resources.getString(R.string.bus_p_m2_empty_tv)
|
||||
tv_distance.text = resources.getString(R.string.bus_p_m2_empty_remain_km)
|
||||
tv_left_time.text = resources.getString(R.string.bus_p_m2_empty_remain_minute)
|
||||
station_name_tv.setTextColor(ResourcesUtils.getColor(R.color.bus_p_m2_next_tv_color))
|
||||
station_name_tv.text = ResourcesUtils.getString(R.string.bus_p_m2_empty_tv)
|
||||
tv_distance.text = ResourcesUtils.getString(R.string.bus_p_m2_empty_remain_km)
|
||||
tv_left_time.text = ResourcesUtils.getString(R.string.bus_p_m2_empty_remain_minute)
|
||||
noLineShow()
|
||||
}
|
||||
|
||||
@@ -214,19 +215,19 @@ class PM2DrivingInfoFragment :
|
||||
fun updateStationsInfo(stations: MutableList<BusStationBean>, currentStationIndex: Int, isArrived: Boolean){
|
||||
if (stations.size == 0) return
|
||||
if (0<= currentStationIndex && currentStationIndex<stations.size){
|
||||
station_name_tv.setTextColor(resources.getColor(R.color.bus_p_m2_next_tv_color))
|
||||
station_name_tv.setTextColor(ResourcesUtils.getColor(R.color.bus_p_m2_next_tv_color))
|
||||
station_name_tv.text = stations[currentStationIndex].name
|
||||
}
|
||||
if (currentStationIndex == 0 && isArrived){
|
||||
clearCustomPolyline()
|
||||
}
|
||||
if (isArrived){//到站
|
||||
tv_distance.text = resources.getString(R.string.bus_p_m2_empty_remain_km)
|
||||
tv_left_time.text = resources.getString(R.string.bus_p_m2_empty_remain_minute)
|
||||
tv_next_station_title.text = resources.getString(R.string.bus_p_m2_station_title_arrived_tv)
|
||||
tv_distance.text = ResourcesUtils.getString(R.string.bus_p_m2_empty_remain_km)
|
||||
tv_left_time.text = ResourcesUtils.getString(R.string.bus_p_m2_empty_remain_minute)
|
||||
tv_next_station_title.text = ResourcesUtils.getString(R.string.bus_p_m2_station_title_arrived_tv)
|
||||
haveLineAndArrivedStation()
|
||||
}else{ //前往目的地中
|
||||
tv_next_station_title.text = resources.getString(R.string.bus_p_m2_next_station_title)
|
||||
tv_next_station_title.text = ResourcesUtils.getString(R.string.bus_p_m2_next_station_title)
|
||||
haveLineAndArriveingStation()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView
|
||||
import com.mogo.eagle.core.function.smp.view.SmallMapView
|
||||
import com.mogo.eagle.core.function.view.MapBizView
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.och.common.module.utils.ResourcesUtils
|
||||
import com.mogo.och.common.module.utils.SoundPoolHelper
|
||||
import kotlinx.android.synthetic.main.charter_base_fragment.module_mogo_och_arrived_tv
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
@@ -69,7 +70,7 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
|
||||
flStationPanelContainer = findViewById(R.id.module_mogo_och_station_panel_container)
|
||||
|
||||
slidePanelView = findViewById(R.id.charter_slide_panel)
|
||||
slidePanelView?.setText(resources.getString(R.string.charter_back_car))
|
||||
slidePanelView?.setText(ResourcesUtils.getString(R.string.charter_back_car))
|
||||
slidePanelView?.setOnSlidePanelMoveToEndListener(onSlideToEndListener)
|
||||
|
||||
|
||||
@@ -191,9 +192,9 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
|
||||
requireActivity().runOnUiThread {
|
||||
module_mogo_och_arrived_tv.isEnabled = isClickable
|
||||
if (isClickable) {
|
||||
module_mogo_och_arrived_tv.setTextColor(resources.getColor(android.R.color.white))
|
||||
module_mogo_och_arrived_tv.setTextColor(ResourcesUtils.getColor(android.R.color.white))
|
||||
} else {
|
||||
module_mogo_och_arrived_tv.setTextColor(resources.getColor(R.color.charter_arrived_btn_un_clickable_color))
|
||||
module_mogo_och_arrived_tv.setTextColor(ResourcesUtils.getColor(R.color.charter_arrived_btn_un_clickable_color))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.mogo.och.common.module.manager.autopilot.autopilot
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.R
|
||||
import com.mogo.och.common.module.manager.autopilot.trajectory.TrajectoryManager
|
||||
@@ -24,13 +26,15 @@ object OchAutoPilotStatusListenerManager : CallerBase<IOchAutopilotStatusListene
|
||||
|
||||
private var autopilotState: Int by Delegates.observable(0) { _, oldValue, newValue ->
|
||||
if (oldValue != newValue) {
|
||||
if(oldValue==IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
|
||||
if(newValue==IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE){
|
||||
ToastUtils.showLong(R.string.common_change2_autopilot2_manual)
|
||||
}
|
||||
}else if(oldValue==IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING){
|
||||
if(newValue==IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE){
|
||||
ToastUtils.showLong(R.string.common_change2_pxjs_manual)
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
if(oldValue==IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
|
||||
if(newValue==IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE){
|
||||
ToastUtils.showLong(R.string.common_change2_autopilot2_manual)
|
||||
}
|
||||
}else if(oldValue==IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING){
|
||||
if(newValue==IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE){
|
||||
ToastUtils.showLong(R.string.common_change2_pxjs_manual)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package com.mogo.och.common.module.manager.autopilot.autopilot
|
||||
|
||||
import android.text.TextUtils
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
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.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
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.DateTimeUtils
|
||||
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
@@ -19,11 +19,7 @@ abstract class OchAutopilotAnalytics {
|
||||
|
||||
companion object{
|
||||
private const val EVENT_PARAM_AUTOPILOTANALYTICS_GROUP = "start_autopilot_group"
|
||||
private const val EVENT_PARAM_SN = "sn"
|
||||
private const val EVENT_PARAM_PLATE_NUM = "plate_number" // 车牌号
|
||||
private const val EVENT_PARAM_ENV_ONLINE = "env_online" // 是否线上环境:true/false
|
||||
private const val EVENT_PARAM_TIME = "time"
|
||||
private const val EVENT_PARAM_ACCURATE_TIME = "time_accurate"
|
||||
private const val EVENT_PARAM_START_SUCCESS_TIME = "time_success"
|
||||
private const val EVENT_PARAM_START_FAIL_TIME = "time_fail"
|
||||
private const val EVENT_PARAM_CLICK_TIME = "time_click"
|
||||
@@ -43,32 +39,34 @@ abstract class OchAutopilotAnalytics {
|
||||
|
||||
private const val EVENT_KEY_START_AUTOPILOT_ACK = "event_key_och_start_autopilot_ack"
|
||||
private const val EVENT_PARAM_START_AUTOPILOT_ACK= "start_autopilot_parameters_ack" // 启动自驾参数
|
||||
private const val EVENT_PARAM_START_AUTOPILOT_ACK_SUCCESS= "start_autopilot_parameters_ack" // 启动自驾参数
|
||||
private const val EVENT_PARAM_START_AUTOPILOT_ACK_SUCCESS= "start_autopilot_parameters_ack_isSuccess" // 启动自驾参数
|
||||
|
||||
|
||||
private const val EVENT_KEY_INFO_AUTOPILOT_DISTANCE = "event_key_vehicle_start_autopilot_state_distance_15"
|
||||
|
||||
|
||||
fun triggerStartAutopilotParameters(controlParameters: AutopilotControlParameters?){
|
||||
val plateNum = AppConfigInfo.plateNumber
|
||||
val params = HashMap<String, Any>()
|
||||
params[EVENT_PARAM_SN] = SharedPrefsMgr.getInstance().sn
|
||||
params[EVENT_PARAM_PLATE_NUM] = if (TextUtils.isEmpty(plateNum)) "" else plateNum
|
||||
params[EVENT_PARAM_ENV_ONLINE] = DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE
|
||||
params[EVENT_PARAM_TIME] = DateTimeUtils.getTimeText(System.currentTimeMillis(),DateTimeUtils.yyyy_MM_dd_HH_mm_ss_SSS)
|
||||
params[EVENT_PARAM_START_AUTOPILOT_PARAMETERS] = "${controlParameters.toString()}_${controlParameters?.autoPilotLine}_routeID:${controlParameters?.routeID}_routeName:${controlParameters?.routeName}"
|
||||
params[EVENT_PARAM_AUTOPILOTANALYTICS_GROUP] = EVENT_PARAM_AUTOPILOTANALYTICS_GROUP
|
||||
OchChainLogManager.addCommonParams(params)
|
||||
MogoAnalyticUtils.track(EVENT_KEY_START_AUTOPILOT_PARAMETERS, params)
|
||||
}
|
||||
fun triggerStartAutopilotParametersAck(data:String,isSuccess:Boolean){
|
||||
val plateNum = AppConfigInfo.plateNumber
|
||||
val params = HashMap<String, Any>()
|
||||
params[EVENT_PARAM_SN] = SharedPrefsMgr.getInstance().sn
|
||||
params[EVENT_PARAM_PLATE_NUM] = if (TextUtils.isEmpty(plateNum)) "" else plateNum
|
||||
params[EVENT_PARAM_ENV_ONLINE] = DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE
|
||||
params[EVENT_PARAM_TIME] = DateTimeUtils.getTimeText(System.currentTimeMillis(),DateTimeUtils.yyyy_MM_dd_HH_mm_ss_SSS)
|
||||
params[EVENT_PARAM_START_AUTOPILOT_ACK] = data
|
||||
params[EVENT_PARAM_START_AUTOPILOT_ACK_SUCCESS] = isSuccess
|
||||
params[EVENT_PARAM_AUTOPILOTANALYTICS_GROUP] = EVENT_PARAM_AUTOPILOTANALYTICS_GROUP
|
||||
OchChainLogManager.addCommonParams(params)
|
||||
MogoAnalyticUtils.track(EVENT_KEY_START_AUTOPILOT_ACK, params)
|
||||
}
|
||||
fun triggerDistance2LineorStation(info: String){
|
||||
val map = hashMapOf<String, Any>()
|
||||
map[EVENT_PARAM_AUTOPILOTANALYTICS_GROUP] = EVENT_PARAM_AUTOPILOTANALYTICS_GROUP
|
||||
OchChainLogManager.writeChainLog("启动自驾距离判断",info, eventID = EVENT_KEY_INFO_AUTOPILOT_DISTANCE, patch = map)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -102,6 +100,7 @@ abstract class OchAutopilotAnalytics {
|
||||
mStartAutopilotParams[EVENT_PARAM_START_FAIL_TIME] = DateTimeUtils.getTimeText(startFailDate,DateTimeUtils.yyyy_MM_dd_HH_mm_ss_SSS)
|
||||
mStartAutopilotParams[EVENT_PARAM_START_RESULT] = CallerAutoPilotStatusListenerManager.getState() == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
|
||||
mStartAutopilotParams[EVENT_PARAM_AUTOPILOTANALYTICS_GROUP] = EVENT_PARAM_AUTOPILOTANALYTICS_GROUP
|
||||
OchChainLogManager.addCommonParams(mStartAutopilotParams)
|
||||
MogoAnalyticUtils.track(mStartAutopilotKey, mStartAutopilotParams)
|
||||
clearStartAutopilotParams() //清空参数数据,防止误传
|
||||
}
|
||||
@@ -132,15 +131,11 @@ abstract class OchAutopilotAnalytics {
|
||||
// 自动驾驶状态变更时间
|
||||
mStartAutopilotParams[EVENT_PARAM_START_SUCCESS_TIME] = DateTimeUtils.getTimeText(triggerDate,DateTimeUtils.yyyy_MM_dd_HH_mm_ss_SSS)
|
||||
mStartAutopilotParams[EVENT_PARAM_AUTOPILOTANALYTICS_GROUP] = EVENT_PARAM_AUTOPILOTANALYTICS_GROUP
|
||||
OchChainLogManager.addCommonParams(mStartAutopilotParams)
|
||||
MogoAnalyticUtils.track(mStartAutopilotKey, mStartAutopilotParams)
|
||||
clearStartAutopilotParams() //清空参数数据,防止误传
|
||||
} else {
|
||||
val plateNum = AppConfigInfo.plateNumber
|
||||
mStartAutopilotParams[EVENT_PARAM_SN] = SharedPrefsMgr.getInstance().sn
|
||||
mStartAutopilotParams[EVENT_PARAM_PLATE_NUM] = if (TextUtils.isEmpty(plateNum)) "" else plateNum
|
||||
mStartAutopilotParams[EVENT_PARAM_ENV_ONLINE] = DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE
|
||||
mStartAutopilotParams[EVENT_PARAM_TIME] = DateTimeUtils.getTimeText(DateTimeUtils.yyyy_MM_dd_HH_mm_ss)
|
||||
mStartAutopilotParams[EVENT_PARAM_ACCURATE_TIME] = DateTimeUtils.getTimeText(DateTimeUtils.yyyy_MM_dd_HH_mm_ss_SSS)
|
||||
// 外部点击时间
|
||||
mStartAutopilotParams[EVENT_PARAM_CLICK_TIME] = DateTimeUtils.getTimeText(triggerDate,DateTimeUtils.yyyy_MM_dd_HH_mm_ss_SSS)
|
||||
mStartAutopilotParams[EVENT_PARAM_START_NAME] = startName
|
||||
@@ -163,19 +158,15 @@ abstract class OchAutopilotAnalytics {
|
||||
fun triggerUnableStartAPReasonEvent(
|
||||
startName: String, endName: String, lineId: String, orderNo:String ,reason: String
|
||||
) {
|
||||
val plateNum = AppConfigInfo.plateNumber
|
||||
val params = HashMap<String, Any>()
|
||||
params[EVENT_PARAM_SN] = SharedPrefsMgr.getInstance().sn
|
||||
params[EVENT_PARAM_PLATE_NUM] = if (TextUtils.isEmpty(plateNum)) "" else plateNum
|
||||
params[EVENT_PARAM_ENV_ONLINE] = DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE
|
||||
params[EVENT_PARAM_TIME] = DateTimeUtils.getTimeText(DateTimeUtils.yyyy_MM_dd_HH_mm_ss)
|
||||
params[EVENT_PARAM_ACCURATE_TIME] = DateTimeUtils.getTimeText(DateTimeUtils.yyyy_MM_dd_HH_mm_ss_SSS)
|
||||
params[EVENT_PARAM_START_NAME] = startName
|
||||
params[EVENT_PARAM_END_NAME] = endName
|
||||
params[EVENT_PARAM_LINE_ID] = lineId
|
||||
params[EVENT_PARAM_ORDER_NUMBER] = orderNo
|
||||
params[EVENT_PARAM_UNABLE_START_REASON] = reason
|
||||
params[EVENT_PARAM_AUTOPILOTANALYTICS_GROUP] = EVENT_PARAM_AUTOPILOTANALYTICS_GROUP
|
||||
OchChainLogManager.addCommonParams(mStartAutopilotParams)
|
||||
MogoAnalyticUtils.track(getEventKeyApUnableStartReason(), params)
|
||||
}
|
||||
|
||||
@@ -185,11 +176,10 @@ abstract class OchAutopilotAnalytics {
|
||||
fun triggerClickStartAutopilotTime(triggerDate: Long) {
|
||||
val plateNum = AppConfigInfo.plateNumber
|
||||
val params = HashMap<String, Any>()
|
||||
params[EVENT_PARAM_SN] = SharedPrefsMgr.getInstance().sn
|
||||
params[EVENT_PARAM_PLATE_NUM] = if (TextUtils.isEmpty(plateNum)) "" else plateNum
|
||||
params[EVENT_PARAM_ENV_ONLINE] = DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE
|
||||
params[EVENT_PARAM_CLICK_TIME] = DateTimeUtils.getTimeText(triggerDate,DateTimeUtils.yyyy_MM_dd_HH_mm_ss_SSS)
|
||||
params[EVENT_PARAM_AUTOPILOTANALYTICS_GROUP] = EVENT_PARAM_AUTOPILOTANALYTICS_GROUP
|
||||
OchChainLogManager.addCommonParams(mStartAutopilotParams)
|
||||
MogoAnalyticUtils.track(getEventKeyClickStartAutopilot(), params)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package com.mogo.och.common.module.manager.device.checkvin
|
||||
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisDoorStateListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.ActivityUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusManager
|
||||
@@ -9,16 +10,22 @@ import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.manager.loop.LoopInfo
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import mogo.telematics.pad.MessagePad
|
||||
|
||||
object CheckVinManager : IMoGoChassisDoorStateListener {
|
||||
object CheckVinManager : IMoGoAutopilotCarConfigListener {
|
||||
private val TAG = CheckVinManager::class.java.simpleName
|
||||
|
||||
init {
|
||||
BizLoopManager.setLoopFunction(TAG, LoopInfo(60*5,::checkVin,scheduler = Schedulers.io()))
|
||||
CallerAutopilotCarConfigListenerManager.addListener(TAG,this)
|
||||
}
|
||||
|
||||
private var checkVinErrorDialog:CheckVinErrorDialog?=null
|
||||
|
||||
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
|
||||
checkVin()
|
||||
}
|
||||
|
||||
private fun checkVin() {
|
||||
LoginStatusManager.getLoginInfo()?.let {loginInfo ->
|
||||
val serverVin = loginInfo.vin
|
||||
|
||||
@@ -12,8 +12,8 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
|
||||
import com.mogo.eagle.core.utilcode.util.LocationUtils
|
||||
import com.mogo.och.common.module.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutopilotAnalytics
|
||||
import com.mogo.och.common.module.manager.autopilot.trajectory.TrajectoryCache
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.manager.loop.LoopInfo
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil
|
||||
@@ -662,11 +662,11 @@ object TrajectoryAndDistanceManager : IMoGoPlanningRottingListener {
|
||||
*/
|
||||
fun canStartAutopilot(lineId: Long?): String {
|
||||
if (lineId == null) {
|
||||
OchChainLogManager.writeChainLog("启动自驾距离判断","未传轨迹ID", eventID = OchChainLogManager.EVENT_KEY_INFO_AUTOPILOT_DISTANCE)
|
||||
OchAutopilotAnalytics.triggerDistance2LineorStation("未传轨迹ID")
|
||||
return "请确认线路ID"
|
||||
}
|
||||
|
||||
OchChainLogManager.writeChainLog("启动自驾距离判断","条件记录:lineId:${lineId}----this.lineId:${this.lineId}", eventID = OchChainLogManager.EVENT_KEY_INFO_AUTOPILOT_DISTANCE)
|
||||
OchAutopilotAnalytics.triggerDistance2LineorStation("条件记录:lineId:${lineId}----this.lineId:${this.lineId}")
|
||||
|
||||
try {
|
||||
if (mRoutePoints.isNullOrEmpty()) {
|
||||
@@ -701,7 +701,7 @@ object TrajectoryAndDistanceManager : IMoGoPlanningRottingListener {
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
OchChainLogManager.writeChainLog("启动自驾距离判断","距离站点距离:不支持的条件直接放过", eventID = OchChainLogManager.EVENT_KEY_INFO_AUTOPILOT_DISTANCE)
|
||||
OchAutopilotAnalytics.triggerDistance2LineorStation("距离站点距离:不支持的条件直接放过")
|
||||
return ""
|
||||
}
|
||||
|
||||
@@ -719,7 +719,7 @@ object TrajectoryAndDistanceManager : IMoGoPlanningRottingListener {
|
||||
startStationInfo.stationPoint!!.longitude,
|
||||
startStationInfo.stationPoint!!.latitude
|
||||
)
|
||||
OchChainLogManager.writeChainLog("启动自驾距离判断","距离站点距离:${distance}", eventID = OchChainLogManager.EVENT_KEY_INFO_AUTOPILOT_DISTANCE)
|
||||
OchAutopilotAnalytics.triggerDistance2LineorStation("距离站点距离:${distance}")
|
||||
return if (distance <= OchCommonConst.AUTOMATIC_PLANNING_MAX_DISTANCE) {
|
||||
""
|
||||
} else {
|
||||
@@ -743,12 +743,12 @@ object TrajectoryAndDistanceManager : IMoGoPlanningRottingListener {
|
||||
currentPoint.latitude
|
||||
)
|
||||
if(pointToLine<=OchCommonConst.AUTOMATIC_PLANNING_MAX_DISTANCE){
|
||||
OchChainLogManager.writeChainLog("启动自驾距离判断","距离轨迹线距离:${pointToLine}", eventID = OchChainLogManager.EVENT_KEY_INFO_AUTOPILOT_DISTANCE)
|
||||
OchAutopilotAnalytics.triggerDistance2LineorStation("距离轨迹线距离:${pointToLine}")
|
||||
return ""
|
||||
}
|
||||
}
|
||||
}
|
||||
OchChainLogManager.writeChainLog("启动自驾距离判断","距离轨迹线超过15m,无法启动自驾", eventID = OchChainLogManager.EVENT_KEY_INFO_AUTOPILOT_DISTANCE)
|
||||
OchAutopilotAnalytics.triggerDistance2LineorStation("距离轨迹线超过15m,无法启动自驾")
|
||||
return "距离轨迹线超过15米"
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,9 @@ import com.mogo.commons.debug.DebugConfig
|
||||
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.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils
|
||||
@@ -27,8 +29,6 @@ object OchChainLogManager {
|
||||
const val EVENT_KEY_INFO_SOCKET = "analytics_event_och_track_screen_msg"
|
||||
const val EVENT_KEY_INFO_SOCKET_CONNECT = "analytics_event_och_track_screen_connect"
|
||||
|
||||
const val EVENT_KEY_INFO_AUTOPILOT_DISTANCE = "event_key_vehicle_start_autopilot_state_distance_15"
|
||||
|
||||
|
||||
fun writeChainLogNet(title: String, info: String){
|
||||
writeChainLog(title,info,true,EVENT_KEY_INFO_Net)
|
||||
@@ -67,12 +67,8 @@ object OchChainLogManager {
|
||||
d(SceneConstant.M_OCHCOMMON + TAG, title)
|
||||
d(SceneConstant.M_OCHCOMMON + TAG, info)
|
||||
if(upload) {
|
||||
val plateNum = AppConfigInfo.plateNumber
|
||||
val params = HashMap<String, Any>()
|
||||
params["sn"] = SharedPrefsMgr.getInstance().sn
|
||||
params["env"] = DebugConfig.getNetMode()
|
||||
params["plate_number"] = if (TextUtils.isEmpty(plateNum)) "" else plateNum
|
||||
params["time"] = DateTimeUtils.getTimeText(DateTimeUtils.yyyy_MM_dd_HH_mm_ss)
|
||||
addCommonParams(params)
|
||||
params["info"] = title
|
||||
params["changeInfo"] = info
|
||||
patch?.let {
|
||||
@@ -85,4 +81,17 @@ object OchChainLogManager {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun addCommonParams(params:MutableMap<String,Any>){
|
||||
val plateNum = AppConfigInfo.plateNumber
|
||||
params["sn"] = SharedPrefsMgr.getInstance().sn
|
||||
params["env"] = DebugConfig.getNetMode()
|
||||
params["product"] = AppIdentityModeUtils.getProduct(FunctionBuildConfig.appIdentityMode).name
|
||||
params["role"] = AppIdentityModeUtils.getRole(FunctionBuildConfig.appIdentityMode).name
|
||||
params["cartype"] = AppIdentityModeUtils.getCarType(FunctionBuildConfig.appIdentityMode).name
|
||||
params["plate_number"] = if (TextUtils.isEmpty(plateNum)) "" else plateNum
|
||||
params["time"] = DateTimeUtils.getTimeText(DateTimeUtils.yyyy_MM_dd_HH_mm_ss_SSS)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -18,10 +18,12 @@ class OchCommonSubscribeImpl<T : BaseData>(
|
||||
const val TAG = "OchCommonSubscribeImpl"
|
||||
}
|
||||
|
||||
private var tag:Long = System.currentTimeMillis()
|
||||
|
||||
init {
|
||||
CallerLogger.e("$flavorTag$TAG", "$apiName: 去请求()")
|
||||
if(writeLog) {
|
||||
OchChainLogManager.writeChainLogNet("接口:${apiName}", "去请求")
|
||||
OchChainLogManager.writeChainLogNet("接口:${apiName}_${tag}", "去请求")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +31,7 @@ class OchCommonSubscribeImpl<T : BaseData>(
|
||||
super.onSuccess(o)
|
||||
CallerLogger.d("$flavorTag$TAG", "$apiName: onSuccess() ${o.msg}")
|
||||
if(writeLog) {
|
||||
OchChainLogManager.writeChainLogNet("接口:${apiName}", "请求成功:${o}")
|
||||
OchChainLogManager.writeChainLogNet("接口:${apiName}_${tag}", "请求成功:${o}")
|
||||
}
|
||||
callback?.onSuccess(o)
|
||||
}
|
||||
@@ -38,7 +40,7 @@ class OchCommonSubscribeImpl<T : BaseData>(
|
||||
super.onError(e)
|
||||
CallerLogger.e("$flavorTag$TAG", "$apiName: onError() ${e.message}")
|
||||
if(writeLog) {
|
||||
OchChainLogManager.writeChainLogNet("接口:${apiName}", "请求失败:${e.message}")
|
||||
OchChainLogManager.writeChainLogNet("接口:${apiName}_${tag}", "请求失败:${e.message}")
|
||||
}
|
||||
callback?.onError("$apiName: onError() ${e.message}")
|
||||
callback?.onError()
|
||||
@@ -49,7 +51,7 @@ class OchCommonSubscribeImpl<T : BaseData>(
|
||||
CallerLogger.e("$flavorTag$TAG", "$apiName: onError() code = $code; message = $message")
|
||||
if(writeLog) {
|
||||
OchChainLogManager.writeChainLogNet(
|
||||
"接口:${apiName}",
|
||||
"接口:${apiName}_${tag}",
|
||||
"请求失败: onError() code = $code; message = $message\""
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/common_5F6582"/>
|
||||
<solid android:color="@color/common_3B4577"/>
|
||||
<corners android:radius="46dp"/>
|
||||
</shape>
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="@dimen/dp_939"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/common_3B4577">
|
||||
android:background="@drawable/common_error_vin">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_error_head"
|
||||
|
||||
@@ -233,20 +233,23 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
}
|
||||
|
||||
public void onAutopilotStatusChanged(int status,boolean canStart) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
if (isStarting && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING != status) {
|
||||
// 1. 主动开启自动驾驶中,不为2(为0、1)则继续loading
|
||||
return;
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (isStarting && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING != status) {
|
||||
// 1. 主动开启自动驾驶中,不为2(为0、1)则继续loading
|
||||
return;
|
||||
}
|
||||
if (isStarting && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status) {
|
||||
// 2. 主动开启自动驾驶中,为2则停止loading,并isStarting = false
|
||||
startAutopilotDone(true);
|
||||
return;
|
||||
}
|
||||
// 3. 其他过程直接更新
|
||||
startOrStopLoadingAnim(false);
|
||||
autopilotStatusAnimchanged(status,canStart);
|
||||
}
|
||||
if (isStarting && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status) {
|
||||
// 2. 主动开启自动驾驶中,为2则停止loading,并isStarting = false
|
||||
startAutopilotDone(true);
|
||||
return;
|
||||
}
|
||||
// 3. 其他过程直接更新
|
||||
startOrStopLoadingAnim(false);
|
||||
autopilotStatusAnimchanged(status,canStart);
|
||||
});
|
||||
},UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
|
||||
public void stopAnimAndUpdateBtnStatus() {
|
||||
@@ -302,6 +305,9 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
}
|
||||
|
||||
private void startAutopilotDone(boolean success) {
|
||||
if(mAutopilotImage==null){
|
||||
return;
|
||||
}
|
||||
if (autopilotLoadingAnimator != null) {
|
||||
autopilotLoadingAnimator.end();
|
||||
mAutopilotImage.clearAnimation();
|
||||
@@ -375,15 +381,21 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
}
|
||||
|
||||
public void hidPanel() {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
flStationPanelContainer.setVisibility(View.GONE);
|
||||
});
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
flStationPanelContainer.setVisibility(View.GONE);
|
||||
}
|
||||
},UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
|
||||
public void showPanel() {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
flStationPanelContainer.setVisibility(View.VISIBLE);
|
||||
});
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
flStationPanelContainer.setVisibility(View.VISIBLE);
|
||||
}
|
||||
},UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -400,12 +412,15 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
|
||||
|
||||
public void changeOperationViewVisible(int visible) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
if (tvOperationStatus == null) {
|
||||
return;
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (tvOperationStatus == null) {
|
||||
return;
|
||||
}
|
||||
tvOperationStatus.setVisibility(visible);
|
||||
}
|
||||
tvOperationStatus.setVisibility(visible);
|
||||
});
|
||||
},UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
|
||||
protected void showAmapNaviToStationFragment(boolean isShow) {
|
||||
|
||||
@@ -106,6 +106,10 @@ class ConnectionProcessView @JvmOverloads constructor(
|
||||
isDisconnectTimeout = false
|
||||
disconnectTimer?.cancel()
|
||||
disconnectTimer = null
|
||||
//如果之前IPC连接状态为未连接且当前显示异常状态,则改为显示域控连接成功状态
|
||||
if(!ipcConnectStatus && clConnectionTip.visibility == View.VISIBLE){
|
||||
connectIPCSuccess()
|
||||
}
|
||||
}else{
|
||||
//域控连接失败
|
||||
if(ipcConnectStatus && disconnectTimer == null && !isDisconnectTimeout){
|
||||
@@ -132,7 +136,7 @@ class ConnectionProcessView @JvmOverloads constructor(
|
||||
*/
|
||||
override fun onAutopilotStatusRespByQuery(status: SystemStatusInfo.StatusInfo) {
|
||||
if(HmiBuildConfig.isShowConnectionProgressView){
|
||||
if(status.autoPilotReady){
|
||||
if(status.hasAutoPilotReady() && status.autoPilotReady){
|
||||
//冷启动成功
|
||||
autopilotReady()
|
||||
}else{
|
||||
@@ -150,7 +154,7 @@ class ConnectionProcessView @JvmOverloads constructor(
|
||||
*/
|
||||
override fun onSystemStatus(statusInf: SsmInfo.SsmStatusInf) {
|
||||
if(HmiBuildConfig.isShowConnectionProgressView){
|
||||
if(statusInf.autoPilotReady){
|
||||
if(statusInf.hasAutoPilotReady() && statusInf.autoPilotReady){
|
||||
//冷启动成功
|
||||
autopilotReady()
|
||||
}else{
|
||||
@@ -167,6 +171,7 @@ class ConnectionProcessView @JvmOverloads constructor(
|
||||
if(!ipcConnectStatus){
|
||||
showIPCConnectSuccessView()
|
||||
//开始连接SSM超时等待倒计时
|
||||
currentProcess = 25
|
||||
connectSSMProcess()
|
||||
}
|
||||
ipcConnectStatus = true
|
||||
@@ -182,10 +187,11 @@ class ConnectionProcessView @JvmOverloads constructor(
|
||||
//取消连接SSM超时等待倒计时
|
||||
connectSSMTimer?.cancel()
|
||||
//开始启动冷启动等待倒计时
|
||||
currentProcess = 50
|
||||
autopilotReadyProcess()
|
||||
}
|
||||
ssmConnectStatus = true
|
||||
|
||||
autopilotReadyStatus = false
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -302,8 +308,12 @@ class ConnectionProcessView @JvmOverloads constructor(
|
||||
* 更新进度条进度
|
||||
*/
|
||||
private fun updateProcess(){
|
||||
currentProcess++
|
||||
pbConnectionProgress.progress = currentProcess
|
||||
if(currentProcess < 100){
|
||||
currentProcess++
|
||||
if(pbConnectionProgress.progress < currentProcess){
|
||||
pbConnectionProgress.progress = currentProcess
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -353,6 +363,8 @@ class ConnectionProcessView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun onFinish() {
|
||||
//将SSM连接状态置为false
|
||||
ssmConnectStatus = false
|
||||
//展示连接SSM失败视图
|
||||
showSSMConnectFailView()
|
||||
}
|
||||
@@ -373,9 +385,11 @@ class ConnectionProcessView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun onFinish() {
|
||||
//将冷启动状态置为false
|
||||
autopilotReadyStatus = false
|
||||
if(CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().ssmAutoPilotReady){
|
||||
//冷启动成功
|
||||
showAutopilotReadySuccessView()
|
||||
autopilotReady()
|
||||
}else{
|
||||
//展示冷启动失败视图
|
||||
showAutopilotReadyFailView()
|
||||
|
||||
@@ -9,16 +9,19 @@ import android.view.ViewGroup
|
||||
import android.widget.LinearLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
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.FUNC_MODE_DEMO
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.FUNC_MODE_RAIN
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
||||
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.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.kotlin.scope
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
@@ -27,12 +30,13 @@ import kotlinx.coroutines.Runnable
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import java.util.concurrent.CopyOnWriteArrayList
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
|
||||
class StatusBarView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : LinearLayout(context, attrs, defStyleAttr), IMoGoSkinModeChangeListener, IViewControlListener {
|
||||
) : LinearLayout(context, attrs, defStyleAttr), IMoGoSkinModeChangeListener, IViewControlListener, IMoGoAutopilotStatusListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "StatusBarView"
|
||||
@@ -46,6 +50,8 @@ class StatusBarView @JvmOverloads constructor(
|
||||
private val rightViewList = CopyOnWriteArrayList<String>()
|
||||
private val leftViewList = CopyOnWriteArrayList<String>()
|
||||
|
||||
private val lineId = AtomicLong(Long.MIN_VALUE)
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
post {
|
||||
@@ -60,8 +66,8 @@ class StatusBarView @JvmOverloads constructor(
|
||||
CallerSkinModeListenerManager.addListener(TAG, this)
|
||||
//将状态窗口中的状态移到状态栏上
|
||||
CallerDevaToolsManager.showStatusBar(context, status_container)
|
||||
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
updateStatusBarLeftView(true, FUNC_MODE_DEMO, DemoModeView(this.context))
|
||||
updateStatusBarLeftView(true, FUNC_MODE_RAIN, RainModeView(this.context))
|
||||
routeDownloadStatusRoot?.visibility = View.GONE
|
||||
@@ -101,6 +107,20 @@ class StatusBarView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotRouteLineId(lineId: Long) {
|
||||
super.onAutopilotRouteLineId(lineId)
|
||||
if (lineId != this.lineId.get()) {
|
||||
this.lineId.set(lineId)
|
||||
Logger.d(TAG, "--- onAutopilotRouteLineId ---: $lineId")
|
||||
routeDownloadStatusRoot?.scope?.launch {
|
||||
Logger.d(TAG, "--- onAutopilotRouteLineId 1 ---: $lineId")
|
||||
if ((routeDownloadStatusRoot?.visibility == View.VISIBLE) && AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
routeDownloadStatusRoot?.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun setStatusBarDarkOrLight(light: Boolean) = if (light) {
|
||||
setTextColor(resources.getColor(R.color.color_2C2E30))
|
||||
} else {
|
||||
@@ -158,6 +178,9 @@ class StatusBarView @JvmOverloads constructor(
|
||||
CallerSkinModeListenerManager.removeListener(TAG)
|
||||
CallerDevaToolsManager.hideStatusBar()
|
||||
CallerDevaToolsManager.unRegisterRouteDownloadListener(TAG)
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -284,10 +284,7 @@ object AppIdentityModeUtils {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@JvmStatic
|
||||
fun getProduct(appIdentityMode: String): Product {
|
||||
val (bussness, _, _) = getInfo(appIdentityMode)
|
||||
return when (bussness) {
|
||||
@@ -299,9 +296,39 @@ object AppIdentityModeUtils {
|
||||
else -> Product.NONE
|
||||
}
|
||||
}
|
||||
@JvmStatic
|
||||
fun getRole(appIdentityMode: String): Role {
|
||||
val (_, role, _) = getInfo(appIdentityMode)
|
||||
return when (role) {
|
||||
DRIVER -> Role.Driver
|
||||
PASSENGER -> Role.PASSENGER
|
||||
else -> Role.NONE
|
||||
}
|
||||
}
|
||||
@JvmStatic
|
||||
fun getCarType(appIdentityMode: String): CarType {
|
||||
val (_, _, carType) = getInfo(appIdentityMode)
|
||||
return when (carType) {
|
||||
B1 -> CarType.B1
|
||||
B2 -> CarType.B2
|
||||
C1 -> CarType.C1
|
||||
M1 -> CarType.M1
|
||||
T1T2 -> CarType.T1T2
|
||||
else -> CarType.NONE
|
||||
}
|
||||
}
|
||||
|
||||
enum class Product {
|
||||
NONE, BUS, TAXI, SWEEPER, SHUTTLE, CHARTER
|
||||
}
|
||||
|
||||
enum class Role {
|
||||
NONE, Driver, PASSENGER
|
||||
}
|
||||
|
||||
enum class CarType {
|
||||
NONE, B1, B2, C1, M1, T1T2,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user