Merge branch 'dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0' into 'dev_robobus-m1-p-app-module_1.1.0_230112_1.1.0'

Dev robobus m1 p app module 1.0.0 230112 1.0.0

See merge request zhjt/AndroidApp/MoGoEagleEye!620
This commit is contained in:
wangmingjun
2023-02-27 07:40:16 +00:00
3 changed files with 41 additions and 17 deletions

View File

@@ -145,7 +145,7 @@ class PM2DrivingModel private constructor() {
override fun onReceivedMsg(type: Int, byteArray: ByteArray) {//接收司机端发来的信息
if (TelematicConstant.BUSINESS_STRING == type){
val msg = GsonUtils.fromJson(String(byteArray),AppConnectMsg::class.java) as AppConnectMsg
Logger.d(TAG,"onReceivedMsg = "+GsonUtils.toJson(msg))
Logger.d(SceneConstant.M_BUS_P+TAG,"onReceivedMsg = "+GsonUtils.toJson(msg))
if (msg.isPlay){ //播报
speakTTS(msg.msg)
}
@@ -227,7 +227,7 @@ class PM2DrivingModel private constructor() {
super.onAutopilotStatusResponse(autoPilotStatusInfo)
val status = autoPilotStatusInfo.state
if (mCurrentAutoStatus == status) return
d(SceneConstant.M_BUS_P+TAG, "onAutopilotStatusResponse ===== $status")
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING != status){
//美化模式下且行程中
if (FunctionBuildConfig.isDemoMode &&
@@ -241,6 +241,7 @@ class PM2DrivingModel private constructor() {
}else{//自驾状态 2
mAutoStatusCallback?.updateAutoStatus(true)
}
mCurrentAutoStatus = status
}
}
@@ -260,7 +261,7 @@ class PM2DrivingModel private constructor() {
if (data?.data == null) return
if (data.data.driverStatus != operationStatus?.driverStatus
|| data.data.plateNumber != operationStatus?.plateNumber){
d(TAG, "queryDriverOperationStatus ===== 车牌或者登陆状态有变更")
d(SceneConstant.M_BUS_P+TAG, "queryDriverOperationStatus ===== 车牌或者登陆状态有变更")
mDrivingInfoCallback?.changeOperationStatus(data.data.driverStatus == 1)
}
operationStatus = data.data as PM2OperationStatusResponse.Result
@@ -294,7 +295,7 @@ class PM2DrivingModel private constructor() {
}
if (data?.result?.sites === null) {
d(TAG, "queryDriverSiteByCoordinate ===== 没有路线")
d(SceneConstant.M_BUS_P+TAG, "queryDriverSiteByCoordinate ===== 没有路线")
routesResult = null
mNextStationIndex = 0
isGoingToNextStation = false
@@ -314,7 +315,7 @@ class PM2DrivingModel private constructor() {
queryDriverOperationDelay()
return
}
d(TAG, "queryDriverSiteByCoordinate = %s", msg)
d(SceneConstant.M_BUS_P+TAG, "queryDriverSiteByCoordinate = %s", msg)
}
})
@@ -335,7 +336,7 @@ class PM2DrivingModel private constructor() {
&& station.isLeaving && i + 1 < stations.size) {
mDrivingInfoCallback?.updateStationsInfo(stations as MutableList<PM2Station>, i + 1, false)
if (mNextStationIndex != i + 1) {
d(TAG,"轨迹排查--开始行程")
d(SceneConstant.M_BUS_P+TAG,"轨迹排查--开始行程")
mTwoStationsRouts.clear()
startRemainRouteInfo()
}
@@ -467,7 +468,7 @@ class PM2DrivingModel private constructor() {
* @param isStart
*/
fun startOrStopCalculateRouteInfo(isStart: Boolean) {
d(TAG, "startOrStopCalculateRouteInfo() $isStart")
d(SceneConstant.M_BUS_P+TAG, "startOrStopCalculateRouteInfo() $isStart")
if (isStart) {
PM2ModelLoopManager.startCalculateRouteInfoLoop()
} else {

View File

@@ -2,16 +2,13 @@ package com.mogo.och.bus.passenger.ui
import android.graphics.BitmapFactory
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.os.Message
import android.view.View
import androidx.core.content.ContextCompat
import com.amap.api.maps.model.LatLng
import com.mogo.commons.mvp.MvpFragment
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.NoticeFrCloudMsg
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.eagle.core.utilcode.util.DateTimeUtils
@@ -21,6 +18,7 @@ import com.mogo.och.bus.passenger.presenter.PM2DrivingPresenter
import com.mogo.och.common.module.utils.DateTimeUtil.*
import com.mogo.och.common.module.utils.NumberFormatUtil
import kotlinx.android.synthetic.m2.p_m2_driving_info_fragment.*
import java.lang.ref.WeakReference
import kotlin.math.ceil
import kotlin.math.roundToInt
@@ -30,6 +28,9 @@ import kotlin.math.roundToInt
*/
class PM2DrivingInfoFragment :
MvpFragment<PM2DrivingInfoFragment?, PM2DrivingPresenter?>() {
private var timeHandler: TimeHandler? = null
/**
* 改变自动驾驶状态
*
@@ -71,6 +72,8 @@ class PM2DrivingInfoFragment :
// BPRouteDataTestUtils.converToRouteData()
}
updateCurrentTime()
timeHandler = TimeHandler(this)
timeHandler?.sendEmptyMessageDelayed(WHAT_TIME_CURRENT, LOOP_TIME_TEXT)
}
override fun initViews(savedInstanceState: Bundle?) {
@@ -89,6 +92,7 @@ class PM2DrivingInfoFragment :
}
override fun onDestroy() {
timeHandler?.removeCallbacksAndMessages(null)
super.onDestroy()
overMapView.onDestroy()
}
@@ -216,8 +220,27 @@ class PM2DrivingInfoFragment :
"$remainDis$disUnit | $time 分钟".also { remain_mt.text = it }
}
companion object {
private val TAG = PM2DrivingInfoFragment::class.java.simpleName
class TimeHandler(obj: PM2DrivingInfoFragment) : Handler(Looper.getMainLooper()) {
private val mRef: WeakReference<PM2DrivingInfoFragment> = WeakReference(obj)
val drivingInfoFragment = mRef.get() as PM2DrivingInfoFragment
override fun handleMessage(msg: Message) {
mRef.get()?.run {
when (msg.what) {
WHAT_TIME_CURRENT -> {
drivingInfoFragment.updateCurrentTime()
sendEmptyMessageDelayed(
WHAT_TIME_CURRENT, LOOP_TIME_TEXT)
} //可以直接访问Activity中的变量
else -> {}
}
}
}
}
companion object {
private val TAG = PM2DrivingInfoFragment::class.java.simpleName
const val LOOP_TIME_TEXT = 60 * 1000L
const val WHAT_TIME_CURRENT = 10001 //MSG_WHAT
}
}

View File

@@ -18,8 +18,8 @@ project.android.variantFilter { variant ->
// region 过滤shuttle 的flavors
if (names.contains("shuttle")) {
//Gradle会忽略满足上述条件的所有变体
if (names.contains("fOchBus")) {
} else if (names.contains("fOchBusPassenger")) {
if (names.contains("fOchShuttle")) {
} else if (names.contains("fOchShuttlePassenger")) {
} else {
setIgnore(true)
}