[code_opt_3.3.0]merge 3.2.0

This commit is contained in:
zhongchao
2023-05-30 16:57:31 +08:00
112 changed files with 1862 additions and 570 deletions

View File

@@ -299,7 +299,7 @@
android:src="@drawable/icon_bad_case" />
</RelativeLayout>
<com.mogo.eagle.core.function.hmi.ui.widget.RomaView
<com.mogo.eagle.core.function.hmi.ui.widget.RomaBusView
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
app:layout_constraintBottom_toBottomOf="@id/module_mogo_och_badcase_rl"

View File

@@ -15,17 +15,17 @@ data class OrderInfoResponse(val data: OrderInfo?) : BaseData() {
var startSiteId: Int?,
var startSiteName: String?,
var startSiteNameKr: String?,
val siteId: Long?,//站点id
val siteName: String?,//站点名称
var siteId: Long?,//站点id
var siteName: String?,//站点名称
val siteNameKr: String?,//站点名称
val wgs84Lat: Double?,
val wgs84Lon: Double?,
var wgs84Lat: Double?,
var wgs84Lon: Double?,
var gcj02Lat: Double?,
var gcj02Lon: Double?,
val startTime: Long?,//开始时间
val endTime: Long?,//结束时间
val passengerPhone: String?,//乘客手机号
val arriveStatus:Int?,//1:未到达 2:到达
var arriveStatus:Int?,//1:未到达 2:到达
)
companion object{
val ARRIVING = 1

View File

@@ -31,6 +31,7 @@ import com.mogo.och.bus.passenger.callback.*
import com.mogo.och.bus.passenger.constant.CharterPassengerConst
import com.mogo.och.bus.passenger.net.BusPassengerModelLoopManager
import com.mogo.och.bus.passenger.net.BusPassengerServiceManager
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.bus.passenger.utils.VoiceFocusManager
import com.mogo.och.common.module.bean.dpmsg.BaseDPMsg
import com.mogo.och.common.module.bean.dpmsg.ChangeDestMsg
@@ -45,6 +46,7 @@ import com.mogo.och.common.module.manager.OCHAdasAbilityManager
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil
import com.mogo.och.common.module.utils.DateTimeUtil
import com.mogo.och.common.module.utils.PinYinUtil
import com.mogo.och.common.module.utils.RxUtils
import com.mogo.och.common.module.voice.VoiceManager
import com.mogo.och.common.module.voice.VoiceNotice
import io.reactivex.Observable
@@ -84,13 +86,15 @@ object CharterPassengerModel {
private var mLocationWgs: MogoLocation? = null
// 订单信息 有订单有线路结束订单
@Volatile
private var orderInfo: OrderInfoResponse.OrderInfo? = null
// 轨迹信息 用来启动自动驾驶
private var locusInfo: LocusResponse.LocusInfo? = null
// 轨迹点、底盘透传的
private val mRoutePoints: MutableList<MogoLocation> = ArrayList()
@Volatile
private var mRoutePoints: MutableList<MogoLocation>? = ArrayList()
private var orderStatus: OrderStatusEnum = OrderStatusEnum.NoOrderUnuse
@@ -108,6 +112,7 @@ object CharterPassengerModel {
private var broadcastList : MutableMap<String,Boolean> = HashMap()
// 到站仅一次
private val endKey = "arrivedLine"
private val endKeyRequestIng = "arrivedLineRequestIng"
private val ending100Key = "arrivingLine"
private val min5Speak = "min5Speak"
@@ -116,6 +121,9 @@ object CharterPassengerModel {
private var subscribeCountDown: Disposable?=null
var switchLine5minWait: Disposable?=null
@Volatile
var newCheckedSite: SiteInfoResponse.SiteInfo? = null
fun init() {
initListeners()
queryLoginStatus()
@@ -178,6 +186,7 @@ object CharterPassengerModel {
// 3、车控页面、
// 4、打开选择线路页面
BusPassengerModelLoopManager.removeLoopFunction(TAGLOGIN)
CallerLogger.d(M_BUS_P + TAG, "结束登录状态轮询")
// 启动订单轮
startOrderLoop()
} else {
@@ -185,6 +194,7 @@ object CharterPassengerModel {
TAGLOGIN,
LoopInfo(3, ::queryLoginStatus)
)
CallerLogger.d(M_BUS_P + TAG, "启动登录状态轮询")
}
}
})
@@ -227,7 +237,11 @@ object CharterPassengerModel {
}
when (state) {
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
CallerAutoPilotControlManager.getGlobalPath()
RxUtils.createSubscribe(5_000) {
cleanRoutePoints()
CallerLogger.d(M_BUS_P + TAG,"请求底盘轨迹")
CallerAutoPilotControlManager.getGlobalPath()
}
}
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> {}
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {}
@@ -237,7 +251,7 @@ object CharterPassengerModel {
}
}
override fun onAutopilotArriveAtStation(arrivalNotification: MessagePad.ArrivalNotification?) {
CallerLogger.d(SceneConstant.M_BUS_P + TAG,"底盘给到站信息")
CallerLogger.d(M_BUS_P + TAG,"底盘给到站信息")
arriveDest()
}
}
@@ -254,6 +268,10 @@ object CharterPassengerModel {
)
globalPathResp?.wayPointsList?.let {
if (it.size > 0) {
CallerLogger.d(
M_BUS_P + TAG,
"收到轨迹:${it.size}--第一个点${it[0]}--最后一个点:${it.last()}"
)
updateRoutePoints(it)
startCalculateDistanceLoop()
}
@@ -262,10 +280,13 @@ object CharterPassengerModel {
}
fun updateRoutePoints(routePoints: List<MessagePad.Location?>?) {
mRoutePoints.clear()
mRoutePoints = null
val latLngModels = CoordinateCalculateRouteUtil
.coordinateConverterWgsToGcjLocations(mContext, routePoints)
mRoutePoints.addAll(latLngModels)
mRoutePoints = latLngModels
}
fun cleanRoutePoints(){
mRoutePoints = null
}
fun setStatusChangeListener(tag:String,orderStatusChangeListener: IOrderStatusChangeListener?) {
@@ -343,6 +364,7 @@ object CharterPassengerModel {
TAGORDER,
LoopInfo(3, ::queryOrder)
)
CallerLogger.d(M_BUS_P + TAG, "启动订单轮询")
}
/**
@@ -350,6 +372,7 @@ object CharterPassengerModel {
*/
private fun endOrderLoop() {
BusPassengerModelLoopManager.removeLoopFunction(TAGORDER)
CallerLogger.d(M_BUS_P + TAG, "结束订单轮询")
}
/**
@@ -359,6 +382,7 @@ object CharterPassengerModel {
BusPassengerServiceManager.queryOrderInfo(
mContext, object : OchCommonServiceCallback<OrderInfoResponse> {
override fun onSuccess(data: OrderInfoResponse?) {
CallerLogger.d(M_BUS_P+TAG,"订单信息:$data")
if (data?.data == null){
if(orderInfo!=null){
// 启动车辆服务状态
@@ -366,12 +390,12 @@ object CharterPassengerModel {
}
}else {
// 判断是否有订单
ordrLagic(data?.data)
ordrLagic(data.data)
}
}
override fun onFail(code: Int, msg: String) {
ToastUtils.showShort("$code:$msg")
ToastCharterUtils.showShort("$code:$msg")
}
})
}
@@ -449,7 +473,7 @@ object CharterPassengerModel {
fun hasSetLineAndSite(): Pair<LineInfoResponse.LineInfo, SiteInfoResponse.SiteInfo>? {
orderInfo?.let {
if (it.lineId != null && it.lineId > 0 && it.siteId != null && it.siteId > 0) {
if (it.lineId != null && it.lineId > 0 && it.siteId != null && it.siteId!! > 0) {
if(it.arriveStatus==OrderInfoResponse.ARRIVED){
return null
}
@@ -482,6 +506,7 @@ object CharterPassengerModel {
*/
private fun startCarStatusLoop() {
BusPassengerModelLoopManager.setLoopFunction(TAGCARSTATUS, LoopInfo(3, ::queryCarStatus))
CallerLogger.d(M_BUS_P + TAG, "启动车态轮询")
}
/**
@@ -489,6 +514,7 @@ object CharterPassengerModel {
*/
private fun endCarStatusLoop() {
BusPassengerModelLoopManager.removeLoopFunction(TAGCARSTATUS)
CallerLogger.d(M_BUS_P + TAG, "结束车态轮询")
}
/**
@@ -503,7 +529,7 @@ object CharterPassengerModel {
}
override fun onFail(code: Int, msg: String) {
ToastUtils.showShort("$code:$msg")
ToastCharterUtils.showShort("$code:$msg")
}
})
}
@@ -520,6 +546,7 @@ object CharterPassengerModel {
orderInfo = null
locusInfo = null
if (data.businessStatus == 2) {// 订单结束 没有还车
RxUtils.disposeSubscribe(switchLine5minWait)
setOrderStatus(OrderStatusEnum.NoOrderUse)
} else {
// 车辆空闲 订单结束已经还车
@@ -540,6 +567,7 @@ object CharterPassengerModel {
TAGCALIBRATION,
LoopInfo(120, ::queryBusinessTime,immediately = true)
)
CallerLogger.d(M_BUS_P + TAG, "启动时间校准轮询")
}
/**
@@ -547,6 +575,7 @@ object CharterPassengerModel {
*/
private fun endCalibrationLoop() {
BusPassengerModelLoopManager.removeLoopFunction(TAGCALIBRATION)
CallerLogger.d(M_BUS_P + TAG, "结束时间校准轮询")
}
/**
@@ -606,7 +635,7 @@ object CharterPassengerModel {
}
override fun onFail(code: Int, msg: String) {
ToastUtils.showShort("$code:$msg")
ToastCharterUtils.showShort("$code:$msg")
}
})
}
@@ -627,7 +656,7 @@ object CharterPassengerModel {
}
override fun onFail(code: Int, msg: String) {
ToastUtils.showShort("$code:$msg")
ToastCharterUtils.showShort("$code:$msg")
}
})
}
@@ -639,13 +668,18 @@ object CharterPassengerModel {
*/
private fun startCalculateDistanceLoop() {
BusPassengerModelLoopManager.setLoopFunction(TAGDISTANCE, LoopInfo(1, ::calculateDistance))
CallerLogger.d(M_BUS_P + TAG, "开始路距计算")
}
/**
* 结束启动路距计算
* ① 订单结束
* ② 选择站点司机端同意后
* ③ 到站成功后
*/
private fun endCalculateDistanceLoop() {
BusPassengerModelLoopManager.removeLoopFunction(TAGDISTANCE)
CallerLogger.d(M_BUS_P + TAG, "结束路距计算")
}
/**
@@ -655,6 +689,20 @@ object CharterPassengerModel {
//mLocation gcj坐标
mLocationGCJ02?.let {
orderInfo?.let { order ->
CallerLogger.d(M_BUS_P + "calculateDistance", "订单信息:$order")
if(order.siteId==null||order.siteId==0L||
order.wgs84Lat==null||order.wgs84Lat==0.0||
order.wgs84Lon==null||order.wgs84Lon==0.0
){
CallerLogger.d(M_BUS_P + "calculateDistance", "站点信息未获得")
return
}
newCheckedSite?.let {
if(it.siteId!=order.siteId){
CallerLogger.d(M_BUS_P + "calculateDistance", "站点和已选不吻合")
return
}
}
// 启动轨迹计算
var lastSumLength = 0f
val orderLonLat =
@@ -673,25 +721,33 @@ object CharterPassengerModel {
mogoLocation.longitude,
mogoLocation.latitude
)
CallerLogger.d(M_BUS_P + "calculateDistance", "两点距离和站点的直线距离:${lastSumLength}")
if(lastSumLength>100) {
if (mRoutePoints.size == 0){
ToastUtils.showLong("缺少轨迹数据")
if (mRoutePoints==null||mRoutePoints?.size == 0){
ToastCharterUtils.showLong("缺少轨迹数据暂停计算")
CallerLogger.d(M_BUS_P + "calculateDistance两点距离",
"缺少轨迹数据"
)
return
}
// 计算距离
lastSumLength =
val templastSumLength =
CoordinateCalculateRouteUtil.calculateRouteSumLength(
mRoutePoints,
it,
mogoLocation
)
CallerLogger.d(M_BUS_P + TAG, "使用轨迹轨迹:${mRoutePoints?.size}--第一个点${mRoutePoints!![0]}--最后一个点:${mRoutePoints!!.last()}")
CallerLogger.d(M_BUS_P + "calculateDistance", "轨迹计算的距离$templastSumLength")
if(templastSumLength>100){
lastSumLength = templastSumLength
}
}
val lastTime: Double = lastSumLength / CharterPassengerConst.Charter_AVERAGE_SPEED * 3.6 //秒
CallerLogger.d(M_BUS_P + "calculateDistance",
"---lastSumLength: " + lastSumLength + "----lastTime : " + lastTime
+ " thread = " + Thread.currentThread().name
"最终信息:lastSumLength: ${lastSumLength}lastTime : $lastTime thread = ${Thread.currentThread().name}"
)
if (lastSumLength < CharterPassengerConst.ARRIVE_SOON_AT_START_STATION_DISTANCE&&lastSumLength>0) {
CallerLogger.d(M_BUS_P + TAG,"小于100米到站2")
@@ -715,6 +771,7 @@ object CharterPassengerModel {
private fun setOrderStatus(orderStatus: OrderStatusEnum) {
if (this.orderStatus != orderStatus) {
CallerLogger.d(M_BUS_P + TAG,"${this.orderInfo?.orderNo}新的状态:$orderStatus")
this.orderStatus = orderStatus
for (callback in orderStatusChangeListeners.values) {
callback.onStatusChange(this.orderStatus)
@@ -850,24 +907,37 @@ object CharterPassengerModel {
fun arriveDest() {
val (order, lineId, siteId) = getOrderInfo()
if(order!=null&&lineId!=null&&siteId!=null){
val requestSuccessSign = "${siteId}$endKey"
val requestIngSign = "${siteId}$endKeyRequestIng"//正在请求中
CallerLogger.d(M_BUS_P + BaseDPMsg.TAG,
"requestSuccessSign${isSuccess(requestSuccessSign)}---requestIngSign${isSuccess(requestIngSign)}")
if (order.arriveStatus == OrderInfoResponse.ARRIVING) {
if (broadcastList["${siteId}$endKey"] == null || broadcastList["${siteId}$endKey"] == false) {
if (isSuccess(requestSuccessSign)&&//true 请求还没有成功 false 请求成功
isSuccess(requestIngSign)) {// true 还没有正在请求 false 正在请求中
val currentTimeStamp = DateTimeUtil.getCurrentTimeStamp()
broadcastList[requestIngSign] = true //正在请求中
BusPassengerServiceManager.arriveDest(
mContext,
lindId = lineId,
writtenVersion = currentTimeStamp,
object : OchCommonServiceCallback<BaseData> {
override fun onSuccess(data: BaseData?) {
if (null != data && 0 == data.code) {
arrivedDeskSuccess(currentTimeStamp,true)
override fun onSuccess(data: BaseData?) {
if (null != data && 0 == data.code) {
arrivedDeskSuccess(currentTimeStamp,true)
broadcastList[requestIngSign] = false
}
}
}
override fun onFail(code: Int, msg: String) {
ToastUtils.showShort("$code:$msg")
}
})
override fun onFail(code: Int, msg: String) {
ToastCharterUtils.showShort("$code:$msg")
broadcastList[requestIngSign] = false
}
override fun onError() {
super.onError()
broadcastList[requestIngSign] = false
}
})
}
}
}
@@ -878,13 +948,20 @@ object CharterPassengerModel {
needSendDriver:Boolean
) {
val (order, lineId, siteId) = getOrderInfo()
val requestSuccessSign = "${siteId}$endKey"
if (!isSuccess(requestSuccessSign)){
return
}
if(order!=null&&lineId!=null&&siteId!=null){
VoiceManager.arrivedStation(
order.siteName!!,
order.siteNameKr ?: "",
VoiceFocusManager.getVoiceCmdCallBack()
)
broadcastList["${siteId}$endKey"] = true
// 请求成功了
broadcastList[requestSuccessSign] = true
// 给司机端
if (needSendDriver) {
val msg = ChangeDestMsg(
@@ -894,7 +971,7 @@ object CharterPassengerModel {
order.startSiteId ?: 0,
order.startSiteName ?: "",
siteId.toInt(),
order.siteName,
order.siteName?:"",
true,
OrderInfoResponse.ARRIVED,
currentTimeStamp
@@ -906,12 +983,9 @@ object CharterPassengerModel {
CallerLogger.d(M_BUS_P + BaseDPMsg.TAG, "到站发送数据${msg}")
}
switchLine5minWait?.let {
if (!it.isDisposed) {
it.dispose()
}
}
RxUtils.disposeSubscribe(switchLine5minWait)
// 清理轨迹
cleanRoutePoints()
// 到站结束自驾
CallerAutoPilotControlManager.cancelAutoPilot()
// 结束路距计算
@@ -937,7 +1011,7 @@ object CharterPassengerModel {
orderInfo?.let { order ->
order.siteId?.let { siteId ->
if (order.arriveStatus == OrderInfoResponse.ARRIVING) {
if (broadcastList["${siteId}$ending100Key"] == null || broadcastList["${siteId}$ending100Key"] == false) {
if (isSuccess("${siteId}$ending100Key")) {
val string = mContext.getString(R.string.arrived_station_left_100,order.siteName)
VoiceNotice.showNotice(string)
broadcastList["${siteId}$ending100Key"] = true
@@ -947,8 +1021,29 @@ object CharterPassengerModel {
}
}
fun cleanbroadcastListInfo(){
private fun isSuccess(requestSuccessSign: String) =
broadcastList[requestSuccessSign] == null || broadcastList[requestSuccessSign] == false
fun cleanbroadcastListInfo(checkSite: SiteInfoResponse.SiteInfo?) {
switchLine5minWait = RxUtils.createSubscribe(5 * 60 * 1000) {
CallerLogger.d(M_BUS_P + BaseDPMsg.TAG, "5分钟倒计时可以选择线路了")
}
newCheckedSite = checkSite
cleanRoutePoints()
broadcastList.clear()
orderInfo?.let {
it.siteId = checkSite?.siteId
it.wgs84Lon = checkSite?.Wgs84Lon
it.wgs84Lat = checkSite?.Wgs84Lat
it.siteName = checkSite?.siteName
it.arriveStatus = OrderInfoResponse.ARRIVING
}
// 到站结束自驾
CallerAutoPilotControlManager.cancelAutoPilot()
// 停止路距计算
endCalculateDistanceLoop()
// 到站置距离位0
invokeStationDistanceListener(-1, -1)
}
fun leaveStation() {
@@ -970,7 +1065,7 @@ object CharterPassengerModel {
*/
fun startAutopilot() {
if (!OCHAdasAbilityManager.getInstance().autopilotAbilityStatus) {
ToastUtils.showLong(
ToastCharterUtils.showLong(
OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason +
", 请稍候重试"
)
@@ -978,16 +1073,17 @@ object CharterPassengerModel {
}
orderInfo?.let {
if(it.arriveStatus==OrderInfoResponse.ARRIVED){
ToastUtils.showLong("已到达目的地请重新选择线路")
ToastCharterUtils.showLong("已到达目的地请重新选择线路")
return
}
val parameters = initAutopilotControlParameters()
if (null == parameters) {
ToastUtils.showShort("请选择站点")
ToastCharterUtils.showShort("请选择站点")
CallerLogger.e(SceneConstant.M_BUS + TAG, "行程日志-AutopilotControlParameters is empty.")
return
}
ToastUtils.showShort("启动自动驾驶中")
ToastCharterUtils.showShort("启动自动驾驶中")
cleanRoutePoints()
startAutoPilot(parameters)
CallerLogger.d(
SceneConstant.M_BUS + TAG,

View File

@@ -69,7 +69,7 @@ object BusPassengerModelLoopManager {
if (it % loopInfo.interval == 0L) {
try {
loopInfo.function.invoke()
CallerLogger.d(TAG, "${aLong}正在执行方法${tag}")
CallerLogger.d(TAG, "${aLong}对象${loopInfo}正在执行方法${tag}")
}catch (e:Throwable){
e.printStackTrace()
CallerLogger.e(TAG,"$tag:--$e")

View File

@@ -4,10 +4,10 @@ import android.content.Context
import com.mogo.eagle.core.data.BaseData
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.bus.passenger.bean.request.ArriveDestRequest
import com.mogo.och.bus.passenger.bean.request.EndOrderRequest
import com.mogo.och.bus.passenger.bean.response.*
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl
@@ -40,7 +40,7 @@ object BusPassengerServiceManager {
private fun beforeNet():Boolean{
if (draiverSn.isBlank()) {
ToastUtils.showShort("已断开司机屏连接、请联系安全员")
ToastCharterUtils.showShort("已断开司机屏连接、请联系安全员")
return true
}
return false

View File

@@ -12,7 +12,7 @@ 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.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.bus.passenger.bean.LoopInfo
import com.mogo.och.bus.passenger.bean.event.EventLineSites
import com.mogo.och.bus.passenger.bean.response.LineInfoListResponse
@@ -30,7 +30,7 @@ import com.mogo.och.common.module.bean.dpmsg.DPMsgType
import com.mogo.och.common.module.bean.dpmsg.LineSite
import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.manager.OCHPlanningStopSideStatusManager
import com.mogo.och.common.module.manager.StopSideStatusManager
import com.mogo.och.common.module.utils.RxUtils
import io.reactivex.disposables.Disposable
import org.greenrobot.eventbus.EventBus
@@ -66,9 +66,14 @@ class BusPassengerFunctionOrderPresenter(view: M1OrderLineFragment?) :
super.onCreate(owner)
CharterPassengerModel.setStatusChangeListener(TAG,this)
CallerTelematicListenerManager.addListener(TAG, msgReceived)
val currentOrderStatus = CharterPassengerModel.getCurrentOrderStatus()
if(currentOrderStatus==OrderStatusEnum.OrderNoLine||currentOrderStatus==OrderStatusEnum.OrdersWithLine) {
onStatusChange(currentOrderStatus)
extracted()
}
private fun extracted() {
val currentOrderStatus = CharterPassengerModel.getCurrentOrderStatus()
if (currentOrderStatus == OrderStatusEnum.OrderNoLine || currentOrderStatus == OrderStatusEnum.OrdersWithLine) {
val hasSetLineAndSite = CharterPassengerModel.hasSetLineAndSite()
if (hasSetLineAndSite != null) {// 已经设置了线路和站点
checkLine = hasSetLineAndSite.first
@@ -140,28 +145,42 @@ class BusPassengerFunctionOrderPresenter(view: M1OrderLineFragment?) :
}
override fun onFail(code: Int, msg: String?) {
ToastUtils.showShort("查询站点失败")
ToastCharterUtils.showShort("查询站点失败")
mView?.setVisableByTrun(showNetError = true)
}
override fun onError() {
super.onError()
ToastCharterUtils.showShort("查询站点失败")
mView?.setVisableByTrun(showNetError = true)
}
})
}
private fun queryLineList() {
mView?.setVisableByTrun(showLoading = true)
BusPassengerServiceManager.queryLineList(context, object :
OchCommonServiceCallback<LineInfoListResponse> {
override fun onSuccess(data: LineInfoListResponse?) {
if (data?.data == null) return
mView?.setVisableByTrun(showBiz = true)
mView?.lineAdapterSetData(data.data,checkLine)
}
override fun onFail(code: Int, msg: String) {
ToastUtils.showShort("查询线路失败")
ToastCharterUtils.showShort("查询线路失败")
mView?.setVisableByTrun(showNetError = true)
}
override fun onError() {
super.onError()
mView?.setVisableByTrun(showNetError = true)
}
})
}
override fun onResume(owner: LifecycleOwner) {
super.onResume(owner)
mView?.setViewByOrderStatus(CharterPassengerModel.getCurrentOrderStatus())
}
override fun onDestroy(owner: LifecycleOwner) {
@@ -192,7 +211,7 @@ class BusPassengerFunctionOrderPresenter(view: M1OrderLineFragment?) :
) as ChangeDestMsg
CallerLogger.d(M_BUS_P + BaseDPMsg.TAG, "接受数据:切换站点${msg}")
if (msg.isConfirmed) {
ToastUtils.showShort("站点确定")
ToastCharterUtils.showShort("站点确定")
mView?.setEnableSiteStatus(true)
checkLine = tempCheckLine
checkSite = tempCheckSite
@@ -202,13 +221,10 @@ class BusPassengerFunctionOrderPresenter(view: M1OrderLineFragment?) :
mView?.lineAdapterSubmit(it)
}
mView?.hideDataDriverAgree()
CharterPassengerModel.switchLine5minWait = RxUtils.createSubscribe(5 * 60 * 1000) {
CallerLogger.d(M_BUS_P + BaseDPMsg.TAG, "5分钟倒计时可以选择线路了")
}
CharterPassengerModel.cleanbroadcastListInfo(checkSite)
CharterPassengerModel.queryOrder()
CharterPassengerModel.cleanbroadcastListInfo()
} else {
ToastUtils.showShort("司机端拒绝请重新选择")
ToastCharterUtils.showShort("司机端拒绝请重新选择")
mView?.hideDataDriverRefuse()
}
RxUtils.disposeSubscribe(subscribeSelectSite)
@@ -221,7 +237,7 @@ class BusPassengerFunctionOrderPresenter(view: M1OrderLineFragment?) :
fun changeSites(siteList: MutableList<SiteInfoResponse.SiteInfo>){
if (!CallerTelematicManager.getClientConnStatus()) {
ToastUtils.showLong("乘客屏无法连接司机屏请联系安全员")
ToastCharterUtils.showLong("乘客屏无法连接司机屏请联系安全员")
return
}
val sentDataSite: MutableList<LineSite> = mutableListOf()
@@ -259,13 +275,13 @@ class BusPassengerFunctionOrderPresenter(view: M1OrderLineFragment?) :
RxUtils.disposeSubscribe(subscribeSelectSite)
subscribeSelectSite = RxUtils.createSubscribe(120_000){
ToastUtils.showShort("请联系安全员确认")
ToastCharterUtils.showShort("请联系安全员确认")
mView?.hideDataDriverRefuse()
}
}
private fun checkServerStatus() {
if (!CallerTelematicManager.getClientConnStatus()) {
ToastUtils.showShort("断开和司机端连接、请联系安全员")
ToastCharterUtils.showShort("断开和司机端连接、请联系安全员")
BusPassengerModelLoopManager.removeLoopFunction(TAGLINELOOP)
mView?.hideDataDriverRefuse()
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "endAni666")
@@ -273,15 +289,26 @@ class BusPassengerFunctionOrderPresenter(view: M1OrderLineFragment?) :
}
override fun onStatusChange(currentStatus: OrderStatusEnum) {
mView?.setViewByOrderStatus(currentStatus)
UiThreadHandler.post {
when (currentStatus) {
OrderStatusEnum.OrderNoLine -> {
mView?.setVisableByTrun(showBiz = true)
extracted()
}
OrderStatusEnum.OrdersWithLine ->{
mView?.setVisableByTrun(showBiz = true)
}
else ->{
mView?.setVisableByTrun(showNorOrder = true)
}
}
}
}
fun canSwitchLine():Boolean {
val gnssSpeed =
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().gnssSpeed
if (gnssSpeed < 0.5) {
// TODO: 自驾中 需要 靠边停车中、到站
// TODO: 没有自驾中 需要 靠边停车中、到站
when (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state) {
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {// 不可自动驾驶
return true
@@ -291,24 +318,24 @@ class BusPassengerFunctionOrderPresenter(view: M1OrderLineFragment?) :
}
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
// 自动驾驶中
when (OCHPlanningStopSideStatusManager.stopSiteStatus) {
OCHPlanningStopSideStatusManager.Status.EndingSuccess -> {
when (StopSideStatusManager.stopSiteStatus) {
StopSideStatusManager.Status.EndingSuccess -> {
return true
}
else ->{
ToastUtils.showShort("自动驾驶中无法切换线路")
ToastCharterUtils.showShort("自动驾驶中无法切换线路")
return false
}
}
}
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> {
ToastUtils.showShort("因车辆正在平行驾驶中无法切换线路")
ToastCharterUtils.showShort("因车辆正在平行驾驶中无法切换线路")
return false
}
else -> {}
}
} else {
ToastUtils.showShort("请停车后再修改目的地~")
ToastCharterUtils.showShort("请停车后再修改目的地~")
return false
}
return true

View File

@@ -4,15 +4,14 @@ import androidx.lifecycle.LifecycleOwner
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
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.ToastUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.bus.passenger.ui.dialogfragment.fragment.M1SoftFragment
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.common.module.manager.devicemanage.LightAirconditionDoorCallback
import com.mogo.och.common.module.manager.devicemanage.LightAirconditionDoorStatusManager
import com.mogo.och.common.module.manager.devicemanage.data.AirconditionStatus
import com.mogo.och.common.module.manager.devicemanage.data.HeaterStatue
import com.mogo.och.common.module.manager.devicemanage.data.LightStatus
import com.mogo.och.common.module.voice.VoiceNotice
import io.reactivex.disposables.Disposable
class BusPassengerFunctionSoftPresenter(view: M1SoftFragment?) :
@@ -146,7 +145,7 @@ class BusPassengerFunctionSoftPresenter(view: M1SoftFragment?) :
LightAirconditionDoorStatusManager.airconditionStatus.windSpeed!=windSpeedCmd&&
LightAirconditionDoorStatusManager.airconditionStatus.temperature!=temperatureCmd&&
LightAirconditionDoorStatusManager.airconditionStatus.pattert!=modeCmd) {
ToastUtils.showShort("控制系统繁忙,请稍后再试")
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
}
}
}
@@ -156,7 +155,7 @@ class BusPassengerFunctionSoftPresenter(view: M1SoftFragment?) :
disposeSubscribe(airconditionDisposable)
airconditionDisposable = createSubscribe(10000){
if (LightAirconditionDoorStatusManager.airconditionStatus.isOpen) {
ToastUtils.showShort("控制系统繁忙,请稍后再试")
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
}
}
}
@@ -170,7 +169,7 @@ class BusPassengerFunctionSoftPresenter(view: M1SoftFragment?) :
heaterDisposable = createSubscribe(10000){
if (!LightAirconditionDoorStatusManager.heaterStatue.isOpen&&
LightAirconditionDoorStatusManager.heaterStatue.windSpeed!=windSpeedCmd) {
ToastUtils.showShort("暖风机操作未生效,请稍后重试吧~")
ToastCharterUtils.showShort("暖风机操作未生效,请稍后重试吧~")
}
}
}
@@ -181,7 +180,7 @@ class BusPassengerFunctionSoftPresenter(view: M1SoftFragment?) :
disposeSubscribe(heaterDisposable)
heaterDisposable = createSubscribe(10000){
if (LightAirconditionDoorStatusManager.heaterStatue.isOpen) {
ToastUtils.showShort("暖风机操作未生效,请稍后重试吧~")//还是开着的
ToastCharterUtils.showShort("暖风机操作未生效,请稍后重试吧~")//还是开着的
}
}
}
@@ -193,14 +192,14 @@ class BusPassengerFunctionSoftPresenter(view: M1SoftFragment?) :
CallerAutoPilotControlManager.sendRoboBusJinlvM1MainLamp1Cmd(1)
subscribeLightTop1 = createSubscribe{
if (!LightAirconditionDoorStatusManager.lightStatus.isOpenLight1) {
ToastUtils.showShort("控制系统繁忙,请稍后再试")
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
}
}
}else{
CallerAutoPilotControlManager.sendRoboBusJinlvM1MainLamp1Cmd(2)
subscribeLightTop1 = createSubscribe{
if (LightAirconditionDoorStatusManager.lightStatus.isOpenLight1) {
ToastUtils.showShort("控制系统繁忙,请稍后再试")
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
}
}
}
@@ -212,14 +211,14 @@ class BusPassengerFunctionSoftPresenter(view: M1SoftFragment?) :
CallerAutoPilotControlManager.sendRoboBusJinlvM1MainLamp2Cmd(1)
subscribeLightTop2 = createSubscribe{
if (!LightAirconditionDoorStatusManager.lightStatus.isOpenLight2) {
ToastUtils.showShort("控制系统繁忙,请稍后再试")
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
}
}
}else{
CallerAutoPilotControlManager.sendRoboBusJinlvM1MainLamp2Cmd(2)
subscribeLightTop2 = createSubscribe{
if (LightAirconditionDoorStatusManager.lightStatus.isOpenLight2) {
ToastUtils.showShort("控制系统繁忙,请稍后再试")
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
}
}
}
@@ -231,14 +230,14 @@ class BusPassengerFunctionSoftPresenter(view: M1SoftFragment?) :
CallerAutoPilotControlManager.sendRoboBusJinlvM1SmallLampCmd(1)
subscribeLightAtmosphere = createSubscribe{
if (!LightAirconditionDoorStatusManager.lightStatus.isOpenatmosphere) {
ToastUtils.showShort("控制系统繁忙,请稍后再试")
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
}
}
} else {
CallerAutoPilotControlManager.sendRoboBusJinlvM1SmallLampCmd(2)
subscribeLightAtmosphere = createSubscribe{
if (LightAirconditionDoorStatusManager.lightStatus.isOpenatmosphere) {
ToastUtils.showShort("控制系统繁忙,请稍后再试")
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
}
}
}

View File

@@ -17,7 +17,6 @@ import com.mogo.eagle.core.function.view.SiteMarkerBean
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
import com.mogo.eagle.core.utilcode.util.SharedPrefs
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.bean.response.LineInfoResponse
@@ -32,10 +31,11 @@ import com.mogo.och.bus.passenger.model.IOrderStatusChangeListener
import com.mogo.och.bus.passenger.model.OrderStatusEnum
import com.mogo.och.bus.passenger.receive.DriverMessage
import com.mogo.och.bus.passenger.ui.MainFragment
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.bus.passenger.view.MakerWithSiteName
import com.mogo.och.bus.passenger.view.MakerWithSiteNamewithCheck
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.manager.OCHPlanningStopSideStatusManager
import com.mogo.och.common.module.manager.StopSideStatusManager
import com.mogo.och.common.module.manager.devicemanage.LightAirconditionDoorCallback
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil
import com.mogo.och.common.module.utils.DateTimeUtil
@@ -48,7 +48,7 @@ import kotlin.math.ceil
class BusPassengerPresenter(view: MainFragment?) :
BusBasePassengerFunctionDevicePresenter<MainFragment?>(view),
IDistanceCallback, IOrderChangeCallback, IOrderStatusChangeListener,
OCHPlanningStopSideStatusManager.OCHPlanningActionsCallback, LightAirconditionDoorCallback, IBusPassengerControllerStatusCallback {
StopSideStatusManager.OCHPlanningActionsCallback, LightAirconditionDoorCallback, IBusPassengerControllerStatusCallback {
private val lindIdAndView = ConcurrentHashMap<Long, MakerWithSiteNamewithCheck?>()
@@ -66,7 +66,7 @@ class BusPassengerPresenter(view: MainFragment?) :
CharterPassengerModel.setCarTypeChangeListener(this)
CharterPassengerModel.setStatusChangeListener(TAG, this)
CallerTelematicListenerManager.addListener(TAG, DriverMessage)
OCHPlanningStopSideStatusManager.addListener(TAG, this)
StopSideStatusManager.addListener(TAG, this)
setCarChangeListener(R.raw.m1)
}
@@ -76,7 +76,7 @@ class BusPassengerPresenter(view: MainFragment?) :
CharterPassengerModel.setStationDistanceListener(TAG, null)
CharterPassengerModel.setCarTypeChangeListener(null)
CallerTelematicListenerManager.removeListener(TAG)
OCHPlanningStopSideStatusManager.removeListener(TAG)
StopSideStatusManager.removeListener(TAG)
}
override fun onCarLocationChanged(location: MogoLocation?) {
@@ -123,7 +123,7 @@ class BusPassengerPresenter(view: MainFragment?) :
}
}
val time = ceil(timeInSecond / 60f).toInt()
val arriveTime = DateTimeUtil.getAfterSecondTime(time)
val arriveTime = DateTimeUtil.getAfterSecondTime(timeInSecond.toInt())
setDistanceAndTime(dis.toString(), disUnit, time.toString(), arriveTime)
}
@@ -152,8 +152,10 @@ class BusPassengerPresenter(view: MainFragment?) :
when (currentStatus) {
OrderStatusEnum.Nothing -> {}
OrderStatusEnum.NoOrderUnuse -> {
mView?.closeOpenAndCloseDoor()
clearShowNoviceGuidanceSharedPrefs()
UiThreadHandler.post {
mView?.closeOpenAndCloseDoor()
clearShowNoviceGuidanceSharedPrefs()
}
}
OrderStatusEnum.OrderNoLine -> {
CallerOrderListenerManager.invokeOrderRemoval();
@@ -163,24 +165,25 @@ class BusPassengerPresenter(view: MainFragment?) :
OrderStatusEnum.NoOrderUse -> {
when (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state) {
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {// 不可自动驾驶
ToastUtils.showShort("设备未就绪请稍等,请安全员主动停止车辆")
ToastCharterUtils.showShort("设备未就绪请稍等,请安全员主动停止车辆")
}
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> {//
ToastUtils.showShort("因车辆正在人工驾驶中无法靠边停车,请安全员主动停止车辆")
ToastCharterUtils.showShort("因车辆正在人工驾驶中无法靠边停车,请安全员主动停止车辆")
}
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
// 靠边停车 订单结束 靠边停车
CallerAutoPilotControlManager.sendPlanningCmd(1)
}
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> {
ToastUtils.showShort("因车辆正在平行驾驶中无法靠边停车,请安全员主动停止车辆")
ToastCharterUtils.showShort("因车辆正在平行驾驶中无法靠边停车,请安全员主动停止车辆")
}
else -> {}
}
UiThreadHandler.post {
mView?.showOpenAndCloseDoor()
mView?.cleanEndStation()
setDistancecAndTime(-1, -1)
UiThreadHandler.post {
mView?.showOpenAndCloseDoor()
setDistancecAndTime(-1, -1)
}
}
}
}
@@ -224,33 +227,33 @@ class BusPassengerPresenter(view: MainFragment?) :
}
override fun onStartAutopilotFailure(
actionStatus: OCHPlanningStopSideStatusManager.Status,
actionStatus: StopSideStatusManager.Status,
stopSideStatus: Boolean?,
errorInfo: String?
) {
UiThreadHandler.post {
when (actionStatus) {
OCHPlanningStopSideStatusManager.Status.NOSTART -> {
ToastUtils.showShort(errorInfo)
StopSideStatusManager.Status.NOSTART -> {
ToastCharterUtils.showShort(errorInfo)
}
OCHPlanningStopSideStatusManager.Status.START -> {
StopSideStatusManager.Status.START -> {
VoiceNotice.showNotice(
context.getString(R.string.m1_stop_site_zh),
AIAssist.LEVEL0
)
}
OCHPlanningStopSideStatusManager.Status.DOING -> {
StopSideStatusManager.Status.DOING -> {
// 正在靠边停车
}
OCHPlanningStopSideStatusManager.Status.EndingSuccess -> {
ToastUtils.showShort("靠边停车成功")
StopSideStatusManager.Status.EndingSuccess -> {
ToastCharterUtils.showShort("靠边停车成功")
VoiceNotice.showNotice(
context.getString(R.string.m1_stop_site_success),
AIAssist.LEVEL0
)
}
OCHPlanningStopSideStatusManager.Status.EndingFaile -> {
ToastUtils.showShort("车辆系统繁忙,请稍后再试")
StopSideStatusManager.Status.EndingFaile -> {
ToastCharterUtils.showShort("车辆系统繁忙,请稍后再试")
}
}
}
@@ -259,9 +262,9 @@ class BusPassengerPresenter(view: MainFragment?) :
override fun onDoorStatusCallback(isOpen: Boolean, isFirst: Boolean) {
if (!isFirst) {
if (isOpen) {
ToastUtils.showShort("已开启车门")
ToastCharterUtils.showShort("已开启车门")
} else {
ToastUtils.showShort("已关门车门")
ToastCharterUtils.showShort("已关门车门")
}
}
}
@@ -286,7 +289,7 @@ class BusPassengerPresenter(view: MainFragment?) :
}
override fun onFail(code: Int, msg: String) {
ToastUtils.showShort("$code:$msg")
ToastCharterUtils.showShort("$code:$msg")
}
})
@@ -297,7 +300,7 @@ class BusPassengerPresenter(view: MainFragment?) :
val stationsNameList: MutableList<SiteMarkerBean> = mutableListOf()
val stationIcon = BitmapFactory.decodeResource(context.resources, R.drawable.map_staton_icon)
sites.forEach {
stationsList.add(SiteMarkerBean(LatLng(it.GcjLat!!,it.GcjLon!!),stationIcon,0.5f,0.5f))
stationsList.add(SiteMarkerBean(LatLng(it.GcjLat!!,it.GcjLon!!),stationIcon,0.5f,1f))
val bitmap = getBitmap(it.siteId!!,it.siteName ?: "", it.isCheck)
stationsNameList.add(SiteMarkerBean(LatLng(it.GcjLat,it.GcjLon),bitmap,0.0f,0.2f))
}
@@ -347,10 +350,9 @@ class BusPassengerPresenter(view: MainFragment?) :
it.wgs84Lon!!,
it.wgs84Lat!!
)
setEndStationCallBack(
it.siteId, it.siteName,
coordinateConverterWgsToGcj.longitude, coordinateConverterWgsToGcj.latitude
)
val latLng = LatLng(coordinateConverterWgsToGcj.latitude, coordinateConverterWgsToGcj.longitude)
mView?.drawEndStation(latLng)
}
}

View File

@@ -6,7 +6,7 @@ import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.bus.passenger.callback.ITimeCallback
import com.mogo.och.bus.passenger.model.CharterPassengerModel
import com.mogo.och.bus.passenger.ui.dialogfragment.fragment.OrderInfoFragment
@@ -55,7 +55,7 @@ class OrderInfoPresenter(view: OrderInfoFragment?) :
CharterPassengerModel.endOrder(object : OchCommonServiceCallback<BaseData> {
override fun onSuccess(data: BaseData?) {
if (null != data && 0 == data.code) {
ToastUtils.showShort("结束成功")
ToastCharterUtils.showShort("结束成功")
CharterPassengerModel.setEndOrderStatus()
mView?.closeDialogContaion()
val msg = EndOrderMsg(
@@ -70,7 +70,7 @@ class OrderInfoPresenter(view: OrderInfoFragment?) :
}
override fun onFail(code: Int, msg: String) {
ToastUtils.showShort("$code:$msg")
ToastCharterUtils.showShort("$code:$msg")
}
})
}

View File

@@ -7,23 +7,18 @@ 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.ActivityUtils
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.bean.response.OrderInfoResponse
import com.mogo.och.bus.passenger.model.CharterPassengerModel
import com.mogo.och.bus.passenger.net.BusPassengerModelLoopManager
import com.mogo.och.bus.passenger.presenter.BusPassengerFunctionOrderPresenter
import com.mogo.och.common.module.bean.dpmsg.*
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager
import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.och.common.module.manager.devicemanage.LightAirconditionDoorManager
import com.mogo.och.common.module.manager.devicemanage.LightAirconditionDoorStatusManager
import com.mogo.och.common.module.utils.DateTimeUtil
import com.mogo.och.common.module.utils.RxUtils
import com.mogo.och.common.module.utils.SoundPoolHelper
import com.mogo.och.common.module.voice.VoiceNotice
import com.mogo.tts.base.IMogoTTSCallback
object DriverMessage: IReceivedMsgListener {
override fun onReceivedMsg(type: Int, byteArray: ByteArray) {
@@ -67,7 +62,7 @@ object DriverMessage: IReceivedMsgListener {
) as ChangeDestMsg
if (msg.isConfirmed&&msg.arriveStatus== OrderInfoResponse.ARRIVED) {
CallerLogger.d(SceneConstant.M_BUS_P + BaseDPMsg.TAG, "接受数据:到站${msg}")
CharterPassengerModel.arrivedDeskSuccess(msg.writtenVersion?:0,false)
CharterPassengerModel.arrivedDeskSuccess(msg.writeVersion?:0,false)
}
}
else -> {}

View File

@@ -16,12 +16,13 @@ import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
import com.mogo.eagle.core.function.view.SiteMarkerBean
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.map.uicontroller.VisualAngleMode
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.bean.event.DebugView
import com.mogo.och.bus.passenger.bean.event.EventLineSites
import com.mogo.och.bus.passenger.bean.response.OrderInfoResponse
import com.mogo.och.bus.passenger.model.CharterPassengerModel
import com.mogo.och.bus.passenger.presenter.BusPassengerPresenter
import com.mogo.och.bus.passenger.ui.dialogfragment.DebugViewWatchDogFragment
@@ -97,10 +98,10 @@ class MainFragment :
if(mPresenter?.haveOrder()==true){
openSettingPage(M1ContainFragment.ORDERINFO)
}else{
ToastUtils.showShort("请确认订单")
ToastCharterUtils.showShort("请确认订单")
}
}else{
ToastUtils.showShort(AbsMogoApplication.getApp().getString(R.string.m1_please_login_driver))
ToastCharterUtils.showShort(AbsMogoApplication.getApp().getString(R.string.m1_please_login_driver))
}
}
bb_boorombar.setLineClickListener{
@@ -126,6 +127,28 @@ class MainFragment :
debug_show_noviceGuidance.setOnClickListener {
showNoviceGuidanceFragment()
}
debug_change_modle.setOnClickListener {
ToastCharterUtils.showShort("因车辆正在人工驾驶中无法靠边停车,请安全员主动停止车辆")
when (HdMapBuildConfig.currentCarVrIconRes) {
R.raw.aiqinghao -> {
mPresenter?.setCarChangeListener(OrderInfoResponse.M1_FAMILY)
}
R.raw.jiatinghao -> {
mPresenter?.setCarChangeListener(OrderInfoResponse.M1_FRIENDLY)
}
R.raw.pengyouhao -> {
mPresenter?.setCarChangeListener(0)
}
else -> {
mPresenter?.setCarChangeListener(OrderInfoResponse.M1_LOVE)
}
}
}
debug_show_endview.setOnClickListener {
showOpenAndCloseDoor()
}
}
private fun openSettingPage(tab: String) {
@@ -178,7 +201,7 @@ class MainFragment :
fun drawEndStation(latLng: LatLng) {
val listOf = listOf(latLng)
omvOverMap.drawSiteMarkers(listOf,endStation,0.5f,0.5f)
omvOverMap.drawSiteMarkers(listOf,endStation,0.5f,1f)
}
fun cleanEndStation(){
omvOverMap.clearSiteMarkers()
@@ -238,6 +261,9 @@ class MainFragment :
bpFunctionGroup?.let {
bpFunctionGroup.dismissAllowingStateLoss()
}
UiThreadHandler.postDelayed({
cleanEndStation()
},2_000)
}
@Subscribe(threadMode = ThreadMode.MAIN)

View File

@@ -8,7 +8,7 @@ import android.widget.ImageView
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.bean.event.EventLineSites
import com.mogo.och.bus.passenger.bean.response.LineInfoResponse
@@ -96,9 +96,9 @@ class OrderSiteItemAdapter(
checkChangeListener?.onCheckListener(tempInfo)
} else {
if (siteInfo.isNear) {
ToastUtils.showShort("您已在此站点附近")
ToastCharterUtils.showShort("您已在此站点附近")
} else {
ToastUtils.showShort("站点已过,请选择返程路线")
ToastCharterUtils.showShort("站点已过,请选择返程路线")
}
}
}

View File

@@ -10,7 +10,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.och.bus.passenger.utils.ToastCharterUtils;
import com.mogo.och.bus.passenger.R;
import com.mogo.och.bus.passenger.bean.TaxiPassengerVideoPlay;
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack;
@@ -102,12 +102,12 @@ public class RecyclerVideoAdapter extends RecyclerView.Adapter<RecyclerItemVideo
@Override
public void onPlayError(String url, Object... objects) {
ToastUtils.showLong("哎呀,出错了,看看其他视频吧");
ToastCharterUtils.INSTANCE.showLong("哎呀,出错了,看看其他视频吧");
}
@Override
public void onClickStartError(String url, Object... objects) {
ToastUtils.showLong("哎呀,出错了,看看其他视频吧");
ToastCharterUtils.INSTANCE.showLong("哎呀,出错了,看看其他视频吧");
}
});
}

View File

@@ -17,7 +17,7 @@ import com.mogo.eagle.core.utilcode.util.AppStateManager
import com.mogo.eagle.core.utilcode.util.BarUtils
import com.mogo.eagle.core.utilcode.util.ClickUtils
import com.mogo.eagle.core.utilcode.util.KeyboardUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.presenter.DebugWatchDogPresenter
import com.mogo.och.bus.passenger.ui.MainFragment
@@ -45,7 +45,7 @@ class DebugViewWatchDogFragment :
actv_password_submit.setOnClickListener {
val text = acet_close.text
if(text==null||text.isEmpty()){
ToastUtils.showShort("请输入密码")
ToastCharterUtils.showShort("请输入密码")
}else{
if(text.toString() == "123987"){
dismissAllowingStateLoss()
@@ -54,7 +54,7 @@ class DebugViewWatchDogFragment :
}
ToggleDebugView.toggleDebugView.toggle(requireContext())
}else{
ToastUtils.showShort("请输入正确密码")
ToastCharterUtils.showShort("请输入正确密码")
}
}
}

View File

@@ -24,6 +24,7 @@ import com.mogo.och.bus.passenger.ui.dialogfragment.fragment.M1VideoFragment
import com.mogo.och.bus.passenger.ui.dialogfragment.fragment.OrderInfoFragment
import com.mogo.och.bus.passenger.ui.view.bottom.BottomBar
import com.mogo.och.bus.passenger.ui.view.bottom.BottomClickView
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.common.module.biz.constant.LoginStatusManager
import kotlinx.android.synthetic.main.m1_contain_fragment.*
import org.greenrobot.eventbus.EventBus
@@ -136,11 +137,11 @@ class M1ContainFragment :
if(mPresenter?.haveOrder()==true){
}else{
ToastUtils.showShort("请确认订单")
ToastCharterUtils.showShort("请确认订单")
return@setOrderInfoClickListener
}
}else{
ToastUtils.showShort(AbsMogoApplication.getApp().getString(R.string.m1_please_login_driver))
ToastCharterUtils.showShort(AbsMogoApplication.getApp().getString(R.string.m1_please_login_driver))
return@setOrderInfoClickListener
}

View File

@@ -125,11 +125,7 @@ class NoviceGuidanceFragment :
}
v_next_page_notice.setOnClickListener {
setTargetVisable(complierGuidance = true)
val currentOrderInfo = CharterPassengerModel.getCurrentOrderInfo()
currentOrderInfo?.orderNo?.let { order ->
val orderNoSet = mutableSetOf(order)
SharedPrefs.getInstance(requireContext()).putStringSet(BusPassengerPresenter.KEY4SHOWNOVICEGUIDANCE, orderNoSet)
}
saveOrderInfo()
if (m1_novice_guidance_complier_tts) {
val m1NoviceGuidanceStopSiteTts =
AbsMogoApplication.getApp().getString(R.string.m1_novice_guidance_complier_tts)
@@ -145,8 +141,18 @@ class NoviceGuidanceFragment :
}
private fun saveOrderInfo() {
val currentOrderInfo = CharterPassengerModel.getCurrentOrderInfo()
currentOrderInfo?.orderNo?.let { order ->
val orderNoSet = mutableSetOf(order)
SharedPrefs.getInstance(requireContext())
.putStringSet(BusPassengerPresenter.KEY4SHOWNOVICEGUIDANCE, orderNoSet)
}
}
override fun onClick(v: View?) {
dismissAllowingStateLoss()
saveOrderInfo()
}

View File

@@ -1,15 +1,17 @@
package com.mogo.och.bus.passenger.ui.dialogfragment.fragment
import android.animation.ObjectAnimator
import android.graphics.drawable.AnimationDrawable
import android.os.Bundle
import android.view.View
import android.view.animation.LinearInterpolator
import androidx.recyclerview.widget.LinearLayoutManager
import com.elegant.utils.UiThreadHandler
import com.mogo.commons.mvp.MvpFragment
import com.mogo.eagle.core.utilcode.kotlin.onClick
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.ToastUtils
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.bean.response.LineInfoResponse
import com.mogo.och.bus.passenger.bean.response.SiteInfoResponse
@@ -23,6 +25,7 @@ import com.mogo.och.bus.passenger.view.BottomDecoration
import com.mogo.och.common.module.utils.RxUtils
import io.reactivex.disposables.Disposable
import kotlinx.android.synthetic.main.m1_order_fragment.*
import kotlinx.android.synthetic.main.m1_order_loading.iv_loading_wait_ent
import me.jessyan.autosize.utils.AutoSizeUtils
/**
@@ -44,6 +47,14 @@ class M1OrderLineFragment :
private var subscribeDirverAgree: Disposable? = null
private var subscribeDirverRefuse: Disposable? = null
private val loadingAni =
ObjectAnimator.ofFloat(iv_loading_wait_ent, "rotation", 0f, 90f, 180f, 270f, 360f)
.apply {
repeatCount = -1
interpolator = LinearInterpolator()
duration = 1000
}
override fun getLayoutId(): Int {
return R.layout.m1_order_fragment
@@ -57,6 +68,7 @@ class M1OrderLineFragment :
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "initViews")
lineAdapter = OrderLineItemAdapter(requireContext(), lineList)
siteAdapter = OrderSiteItemAdapter(requireContext(), siteList)
loadingAni.target = iv_loading_wait_ent
rlv_line_list.layoutManager =
LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
rlv_line_list.addItemDecoration(
@@ -107,7 +119,7 @@ class M1OrderLineFragment :
tv_site_submit.onClick {
CharterPassengerModel.switchLine5minWait?.let {
if (!it.isDisposed) {
ToastUtils.showShort("选择线路后5分钟内不可用选")
ToastCharterUtils.showShort("选择线路后5分钟内不可用选")
return@onClick
}
}
@@ -122,17 +134,19 @@ class M1OrderLineFragment :
*/
fun setEnableSiteStatus(cancleAndSubmit: Boolean) {
if (cancleAndSubmit) {
g_side_cancle_submit_group.visibility = View.VISIBLE
g_side_cancle_submit_group?.visibility = View.VISIBLE
} else {
g_side_cancle_submit_group.visibility = View.GONE
g_side_cancle_submit_group?.visibility = View.GONE
}
}
fun hideDataWaitDriverMsg() {
g_lines_sites_data.visibility = View.GONE
g_loading_group.visibility = View.VISIBLE
val animationDrawable = iv_loading_wait_driver.drawable as AnimationDrawable
animationDrawable.start()
g_lines_sites_data?.visibility = View.GONE
g_loading_group?.visibility = View.VISIBLE
iv_loading_wait_driver?.let {
val animationDrawable = it.drawable as AnimationDrawable
animationDrawable.start()
}
}
fun showSelectData() {
@@ -145,41 +159,63 @@ class M1OrderLineFragment :
}
fun hideDataDriverAgree(){
group_driver_agrenn_line.visibility = View.VISIBLE
aciv_driver_refuse_group.visibility = View.GONE
g_loading_group.visibility = View.GONE
g_lines_sites_data.visibility = View.GONE
subscribeDirverAgree = RxUtils.createSubscribe(3_000) {
dismiss?.closeDialog()
group_driver_agrenn_line?.visibility = View.VISIBLE
aciv_driver_refuse_group?.visibility = View.GONE
g_loading_group?.visibility = View.GONE
g_lines_sites_data?.let {
it.visibility = View.GONE
subscribeDirverAgree = RxUtils.createSubscribe(3_000) {
dismiss?.closeDialog()
}
}
}
fun hideDataDriverRefuse(){
group_driver_agrenn_line.visibility = View.GONE
aciv_driver_refuse_group.visibility = View.VISIBLE
g_loading_group.visibility = View.GONE
g_lines_sites_data.visibility = View.GONE
subscribeDirverRefuse = RxUtils.createSubscribe(3_000) {
showSelectData()
group_driver_agrenn_line?.visibility = View.GONE
aciv_driver_refuse_group?.visibility = View.VISIBLE
g_loading_group?.visibility = View.GONE
g_lines_sites_data?.let {
it.visibility = View.GONE
subscribeDirverRefuse = RxUtils.createSubscribe(3_000) {
showSelectData()
}
}
}
fun setViewByOrderStatus(currentStatus: OrderStatusEnum) {
when (currentStatus) {
OrderStatusEnum.NoOrderUnuse -> {
// 无订单页面
m1_order_noorder.visibility = View.VISIBLE
lsv_line_site.visibility = View.GONE
}
OrderStatusEnum.OrderNoLine -> {
// 选择线路页面
m1_order_noorder.visibility = View.GONE
lsv_line_site.visibility = View.VISIBLE
}
OrderStatusEnum.OrdersWithLine -> {
// 选择线路页面
m1_order_noorder.visibility = View.GONE
lsv_line_site.visibility = View.VISIBLE
fun setVisableByTrun(
showBiz: Boolean = false,
showNetError: Boolean = false,
showNorOrder: Boolean = false,
showLoading: Boolean = false
) {
if(showBiz){
// 选择线路页面
m1_order_noorder?.visibility = View.GONE
m1_order_neterror?.visibility = View.GONE
lsv_line_site?.visibility = View.VISIBLE
m1_order_loading?.visibility = View.GONE
return
}
if(showNetError){
m1_order_noorder?.visibility = View.GONE
m1_order_neterror?.visibility = View.VISIBLE
lsv_line_site?.visibility = View.GONE
m1_order_loading?.visibility = View.GONE
return
}
if(showNorOrder){
m1_order_noorder?.visibility = View.VISIBLE
m1_order_neterror?.visibility = View.GONE
lsv_line_site?.visibility = View.GONE
m1_order_loading?.visibility = View.GONE
return
}
if(showLoading){
m1_order_noorder?.visibility = View.GONE
m1_order_neterror?.visibility = View.GONE
lsv_line_site?.visibility = View.GONE
m1_order_loading?.visibility = View.VISIBLE
if (!loadingAni.isRunning) {
loadingAni.start()
}
}
}
@@ -196,7 +232,7 @@ class M1OrderLineFragment :
override fun onDestroyView() {
super.onDestroyView()
//loadingAni.cancel()
loadingAni.cancel()
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "onDestroyView")
RxUtils.disposeSubscribe(subscribeDirverAgree)
RxUtils.disposeSubscribe(subscribeDirverRefuse)

View File

@@ -21,7 +21,7 @@ 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.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.util.ClickUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.bean.Temperature
@@ -550,22 +550,22 @@ class M1SoftFragment :
if (leftLight) {
tv_light_top_01.text = requireContext().getString(R.string.bus_p_m1_close_light1)
tv_light_top_01.isChecked = true
if(!isFirst) ToastUtils.showShort("打开顶灯1")
if(!isFirst) ToastCharterUtils.showShort("打开顶灯1")
} else {
tv_light_top_01.text = requireContext().getString(R.string.bus_p_m1_open_light1)
tv_light_top_01.isChecked = false
if(!isFirst) ToastUtils.showShort("关闭顶灯1")
if(!isFirst) ToastCharterUtils.showShort("关闭顶灯1")
}
}
fun setLightTop2View(rightLight: Boolean, isFirst: Boolean){
if (rightLight) {
tv_light_top_02.text = requireContext().getString(R.string.bus_p_m1_close_light2)
tv_light_top_02.isChecked = true
if(!isFirst) ToastUtils.showShort("打开顶灯2")
if(!isFirst) ToastCharterUtils.showShort("打开顶灯2")
} else {
tv_light_top_02.text = requireContext().getString(R.string.bus_p_m1_open_light2)
tv_light_top_02.isChecked = false
if(!isFirst) ToastUtils.showShort("关闭顶灯2")
if(!isFirst) ToastCharterUtils.showShort("关闭顶灯2")
}
}
fun setLightAtmosphereView(atmosphereLight: Boolean, isFirst: Boolean){
@@ -573,12 +573,12 @@ class M1SoftFragment :
tv_light_atmosphere.text = requireContext().getString(R.string.bus_p_m1_close_atmosphere)
tv_light_atmosphere.isChecked = true
iv_bottom_light_setting.setImageResource(R.drawable.bus_p_function_atmosphere_select)
if(!isFirst) ToastUtils.showShort("打开氛围灯")
if(!isFirst) ToastCharterUtils.showShort("打开氛围灯")
} else {
tv_light_atmosphere.text = requireContext().getString(R.string.bus_p_m1_open_atmosphere)
tv_light_atmosphere.isChecked = false
iv_bottom_light_setting.setImageResource(R.drawable.bus_p_function_atmosphere_nor)
if(!isFirst) ToastUtils.showShort("关闭氛围灯")
if(!isFirst) ToastCharterUtils.showShort("关闭氛围灯")
}
}

View File

@@ -7,15 +7,9 @@ import android.view.LayoutInflater
import android.view.MotionEvent
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
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.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.ActivityUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.bus.passenger.R
import com.mogo.och.common.module.utils.SoundPoolHelper
import kotlinx.android.synthetic.main.m1_bottom_stop_site.view.*
open class BottomClickView @JvmOverloads constructor(

View File

@@ -7,6 +7,7 @@ import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.commons.AbsMogoApplication
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.UiThreadHandler
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.callback.ITimeCallback
import com.mogo.och.bus.passenger.model.CharterPassengerModel
@@ -14,6 +15,8 @@ import com.mogo.och.bus.passenger.model.IOrderStatusChangeListener
import com.mogo.och.bus.passenger.model.OrderStatusEnum
import com.mogo.och.common.module.utils.DateTimeUtil
import kotlinx.android.synthetic.main.m1_bottom_orderinfo.view.*
import java.util.UUID
import kotlin.random.Random
open class BottomOrderInfoView @JvmOverloads constructor(
context: Context,
@@ -32,6 +35,7 @@ open class BottomOrderInfoView @JvmOverloads constructor(
} catch (e: Exception) {
e.printStackTrace()
}
tag = UUID.randomUUID().toString()
}
fun setCheck(isCheck:Boolean){
@@ -50,16 +54,16 @@ open class BottomOrderInfoView @JvmOverloads constructor(
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerLogger.d(SceneConstant.M_BUS_P + TAG,"onAttachedToWindow$this")
CharterPassengerModel.setOrderLeftTimeListeners(this.toString(),this)
CharterPassengerModel.setStatusChangeListener(this.toString(),this)
CallerLogger.d(SceneConstant.M_BUS_P + TAG,"onAttachedToWindow$tag")
CharterPassengerModel.setOrderLeftTimeListeners(tag.toString(),this)
CharterPassengerModel.setStatusChangeListener(tag.toString(),this)
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerLogger.d(SceneConstant.M_BUS_P + TAG,"onDetachedFromWindow$this")
CharterPassengerModel.setOrderLeftTimeListeners(this.toString(),null)
CharterPassengerModel.setStatusChangeListener(this.toString(),null)
CallerLogger.d(SceneConstant.M_BUS_P + TAG,"onDetachedFromWindow$tag")
CharterPassengerModel.setOrderLeftTimeListeners(tag.toString(),null)
CharterPassengerModel.setStatusChangeListener(tag.toString(),null)
}
private fun setViewByOrderStatus(currentOrderStatus: OrderStatusEnum) {
@@ -84,10 +88,15 @@ open class BottomOrderInfoView @JvmOverloads constructor(
val arriveTime = DateTimeUtil.second2Time(timeInSecond)
actv_order_end_time.text = arriveTime
}
setViewByOrderStatus(CharterPassengerModel.getCurrentOrderStatus())
UiThreadHandler.post {
setViewByOrderStatus(CharterPassengerModel.getCurrentOrderStatus())
}
}
override fun onStatusChange(currentStatus: OrderStatusEnum) {
setViewByOrderStatus(currentStatus)
UiThreadHandler.post {
setViewByOrderStatus(currentStatus)
}
}
}

View File

@@ -2,18 +2,11 @@ package com.mogo.och.bus.passenger.ui.view.bottom.impl
import android.content.Context
import android.util.AttributeSet
import androidx.appcompat.widget.AppCompatTextView
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
import com.mogo.eagle.core.utilcode.util.ActivityUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.ui.view.bottom.BottomClickView
import com.mogo.och.common.module.manager.devicemanage.LightAirconditionDoorManager
import com.mogo.och.common.module.utils.RxUtils
import com.mogo.och.common.module.manager.devicemanage.LightAirconditionDoorStatusManager
import com.mogo.och.common.module.utils.SoundPoolHelper
import io.reactivex.disposables.Disposable
class CloseDoorView @JvmOverloads constructor(
context: Context,

View File

@@ -15,7 +15,8 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
import com.mogo.eagle.core.utilcode.util.ActivityUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.eagle.core.utilcode.util.ClickUtils
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.callback.ICharterPassengerAutoStatusChangeCallback
import com.mogo.och.bus.passenger.model.CharterPassengerModel
@@ -65,6 +66,10 @@ class GoViewWithArrive @JvmOverloads constructor(
}
})
setOnClickListener {
if (ClickUtils.isClickTooFrequent(this,3000)) {
ToastCharterUtils.showShort("请稍后点击")
return@setOnClickListener
}
startGo()
applyClickListener?.onApplyClick()
}
@@ -74,12 +79,12 @@ class GoViewWithArrive @JvmOverloads constructor(
if (LightAirconditionDoorStatusManager.doorStatus.isOpen) {
val string = AbsMogoApplication.getApp().getString(R.string.m1_close_door_and_startauto)
ToastUtils.showShort(string)
ToastCharterUtils.showShort(string)
return
}
when (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state) {
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {// 不可自动驾驶
ToastUtils.showShort("设备未就绪请稍等")
ToastCharterUtils.showShort("设备未就绪请稍等")
}
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> {//
onceRegisterAutoStatus()
@@ -90,7 +95,7 @@ class GoViewWithArrive @JvmOverloads constructor(
CharterPassengerModel.leaveStation()
}
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> {
ToastUtils.showShort("因车辆正在平行驾驶中无法靠边停车,请稍后再试")
ToastCharterUtils.showShort("因车辆正在平行驾驶中无法靠边停车,请稍后再试")
}
else -> {}
}
@@ -119,7 +124,7 @@ class GoViewWithArrive @JvmOverloads constructor(
startAutoTimeOut = RxUtils.createSubscribe(20_000) {
if (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
val string = AbsMogoApplication.getApp().getString(R.string.m1_start_auto_fail)
ToastUtils.showLong(string)
ToastCharterUtils.showLong(string)
}
CharterPassengerModel.setAutoStatusCallback(TAG, null)
}

View File

@@ -1,19 +1,12 @@
package com.mogo.och.bus.passenger.ui.view.bottom.impl
import android.annotation.SuppressLint
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.MotionEvent
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
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.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.ActivityUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.ui.view.bottom.BottomClickView
import com.mogo.och.common.module.utils.SoundPoolHelper
@@ -38,17 +31,17 @@ class StopSiteView @JvmOverloads constructor(
private fun stopSite(){
when (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state) {
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {// 不可自动驾驶
ToastUtils.showShort("设备未就绪请稍等,请稍后再试")
ToastCharterUtils.showShort("设备未就绪请稍等,请稍后再试")
}
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> {//
ToastUtils.showShort("因车辆正在人工驾驶中无法靠边停车,请稍后再试")
ToastCharterUtils.showShort("因车辆正在人工驾驶中无法靠边停车,请稍后再试")
}
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
// 靠边停车
CallerAutoPilotControlManager.sendPlanningCmd(1)
}
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> {
ToastUtils.showShort("因车辆正在平行驾驶中无法靠边停车,请稍后再试")
ToastCharterUtils.showShort("因车辆正在平行驾驶中无法靠边停车,请稍后再试")
}
else -> {}
}

View File

@@ -0,0 +1,46 @@
package com.mogo.och.bus.passenger.utils
import android.view.View
import com.mogo.eagle.core.utilcode.util.ActivityUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.bus.passenger.view.ToastCharterView
import me.jessyan.autosize.utils.AutoSizeUtils
object ToastCharterUtils {
fun showTaost(toastText:String){
val context = ActivityUtils.getTopActivity()
val marker = ToastCharterView(context)
marker.setText(toastText)
marker.measure(
View.MeasureSpec.makeMeasureSpec(AutoSizeUtils.dp2px(context, 145f), View.MeasureSpec.UNSPECIFIED),
View.MeasureSpec.makeMeasureSpec(AutoSizeUtils.dp2px(context, 34f), View.MeasureSpec.EXACTLY)
)
marker.layout(0, 0, marker.measuredWidth, marker.measuredHeight)
ToastUtils.showShort(marker)
}
fun showLong(toastText:String){
val context = ActivityUtils.getTopActivity()
val marker = ToastCharterView(context)
marker.setText(toastText)
marker.measure(
View.MeasureSpec.makeMeasureSpec(AutoSizeUtils.dp2px(context, 145f), View.MeasureSpec.UNSPECIFIED),
View.MeasureSpec.makeMeasureSpec(AutoSizeUtils.dp2px(context, 34f), View.MeasureSpec.EXACTLY)
)
marker.layout(0, 0, marker.measuredWidth, marker.measuredHeight)
ToastUtils.showLong(marker)
}
fun showShort(toastText:String?){
toastText?.let {
val context = ActivityUtils.getTopActivity()
val marker = ToastCharterView(context)
marker.setText(toastText)
marker.measure(
View.MeasureSpec.makeMeasureSpec(AutoSizeUtils.dp2px(context, 145f), View.MeasureSpec.UNSPECIFIED),
View.MeasureSpec.makeMeasureSpec(AutoSizeUtils.dp2px(context, 34f), View.MeasureSpec.EXACTLY)
)
marker.layout(0, 0, marker.measuredWidth, marker.measuredHeight)
ToastUtils.showShort(marker)
}
}
}

View File

@@ -18,7 +18,7 @@ import androidx.appcompat.widget.AppCompatImageView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.app.ActivityCompat
import com.mogo.eagle.core.utilcode.util.TimeTransformUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.utils.FullVideoUtils
@@ -141,7 +141,7 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
override fun setStateAndUi(state: Int) {
super.setStateAndUi(state)
if(state==CURRENT_STATE_PLAYING_BUFFERING_START){
ToastUtils.showShort("加载中请稍等")
ToastCharterUtils.showShort("加载中请稍等")
}
}
@@ -265,7 +265,7 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
override fun onError(what: Int, extra: Int) {
super.onError(what, extra)
mThumbImageViewLayout?.visibility = View.VISIBLE
ToastUtils.showLong("哎呀,出错了,看看其他视频吧")
ToastCharterUtils.showLong("哎呀,出错了,看看其他视频吧")
currentTime = -1
if(isIfCurrentIsFullscreen){
smalllPlayer?.clearFullscreenLayout(this)

View File

@@ -0,0 +1,27 @@
package com.mogo.och.bus.passenger.view
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.och.bus.passenger.R
import kotlinx.android.synthetic.main.charter_p_view_toast.view.*
class ToastCharterView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout (
context,
attrs,
defStyleAttr
) {
init {
LayoutInflater.from(context).inflate(R.layout.charter_p_view_toast, this, true)
}
fun setText(siteName: String) {
tv_taost_texit.text = siteName
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/bus_p_m1_B3EFF6FF"/>
<corners android:radius="@dimen/dp_13"/>
</shape>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_taost_texit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/charter_p_toast_shape"
android:button="@null"
android:gravity="center"
android:paddingStart="@dimen/dp_31"
android:paddingTop="@dimen/dp_16"
android:paddingEnd="@dimen/dp_31"
android:paddingBottom="@dimen/dp_16"
android:textColor="@color/bus_p_m1_203555"
android:textSize="25dp"
android:layout_marginBottom="@dimen/dp_76"
tools:text="18" />
</LinearLayout>

View File

@@ -268,10 +268,29 @@
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:text="切换模型"
android:id="@+id/debug_change_modle"
app:layout_constraintTop_toBottomOf="@+id/debug_show_noviceGuidance"
android:layout_marginTop="@dimen/dp_17"
app:layout_constraintEnd_toEndOf="@+id/mapBizView"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:text="显示结束页面"
android:id="@+id/debug_show_endview"
app:layout_constraintTop_toBottomOf="@+id/debug_change_modle"
android:layout_marginTop="@dimen/dp_17"
app:layout_constraintEnd_toEndOf="@+id/mapBizView"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<androidx.constraintlayout.widget.Group
android:id="@+id/group_debug"
app:constraint_referenced_ids="debug_arrive_dest,debug_show_noviceGuidance"
app:constraint_referenced_ids="debug_arrive_dest,debug_show_noviceGuidance,debug_change_modle,debug_show_endview"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

View File

@@ -68,7 +68,7 @@
android:id="@+id/actv_userinfo_title"
app:layout_constraintTop_toTopOf="@+id/actv_contain_order_info"
app:layout_constraintStart_toStartOf="@+id/actv_contain_order_info"
android:layout_marginTop="@dimen/dp_59"
android:layout_marginTop="@dimen/dp_74"
android:layout_marginStart="@dimen/dp_100"
android:text="用户信息:"
android:textColor="@color/bus_p_m1_20418D"
@@ -81,6 +81,8 @@
app:layout_constraintTop_toBottomOf="@+id/actv_userinfo_title"
app:layout_constraintStart_toStartOf="@+id/actv_userinfo_title"
android:text="*** *** ***"
android:fontFamily="@font/din"
android:layout_marginTop="@dimen/dp_15"
android:textColor="@color/bus_p_m1_222222"
android:textSize="@dimen/dp_45"
android:layout_width="wrap_content"
@@ -90,7 +92,7 @@
android:id="@+id/actv_order_time_title"
app:layout_constraintTop_toBottomOf="@+id/actv_userinfo"
app:layout_constraintStart_toStartOf="@+id/actv_userinfo"
android:layout_marginTop="@dimen/dp_29"
android:layout_marginTop="@dimen/dp_60"
android:text="用车时间:"
android:textColor="@color/bus_p_m1_20418D"
android:textSize="@dimen/dp_30"
@@ -102,6 +104,8 @@
app:layout_constraintTop_toBottomOf="@+id/actv_order_time_title"
app:layout_constraintStart_toStartOf="@+id/actv_order_time_title"
android:text="9:00-18:00"
android:fontFamily="@font/din"
android:layout_marginTop="@dimen/dp_15"
android:textColor="@color/bus_p_m1_222222"
android:textSize="@dimen/dp_45"
android:layout_width="wrap_content"
@@ -113,7 +117,7 @@
app:layout_constraintStart_toStartOf="@+id/actv_contain_order_info"
app:layout_constraintEnd_toEndOf="@+id/actv_contain_order_info"
app:layout_constraintBottom_toBottomOf="@+id/actv_contain_order_info"
android:layout_marginBottom="@dimen/dp_81"
android:layout_marginBottom="@dimen/dp_85"
android:layout_width="@dimen/dp_360"
android:layout_height="@dimen/dp_80"/>
@@ -126,6 +130,7 @@
app:layout_constraintBottom_toBottomOf="@+id/v_clikc_go_explore_bg"
android:layout_marginEnd="@dimen/dp_10"
android:text="点击开始探索"
android:textStyle="bold"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_30"
android:layout_width="wrap_content"

View File

@@ -4,64 +4,72 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/m1_function_bg"
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/charter_end_order_openclosedoor"
android:clickable="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1031:500"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginBottom="@dimen/dp_181"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintWidth_percent="0.53698">
<!-- 结束包车 后展示的界面 根据车辆状态来显示 -->
<ImageView
android:id="@+id/iv_end_order_opendoor"
android:layout_width="@dimen/dp_108"
android:layout_height="@dimen/dp_108"
android:layout_marginBottom="@dimen/dp_100"
android:src="@drawable/m1_order_end_opendoor_selecotr"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/iv_end_order_closedoor"
app:layout_constraintStart_toStartOf="parent" />
<ImageView
android:id="@+id/iv_end_order_closedoor"
android:layout_width="@dimen/dp_108"
android:layout_height="@dimen/dp_108"
android:layout_marginBottom="@dimen/dp_100"
android:src="@drawable/m1_order_end_closedoor_selecotr"
android:layout_width="match_parent"
android:background="@drawable/m1_function_bg"
android:layout_marginEnd="@dimen/dp_5"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/charter_end_order_openclosedoor"
android:clickable="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1031:500"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/iv_end_order_opendoor" />
android:layout_marginBottom="@dimen/dp_181"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintWidth_percent="0.53698">
<!-- 结束包车 后展示的界面 根据车辆状态来显示 -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_19"
android:text="开车门"
android:textColor="@color/bus_p_m1_23293b"
android:textSize="@dimen/dp_28"
app:layout_constraintEnd_toEndOf="@+id/iv_end_order_opendoor"
app:layout_constraintStart_toStartOf="@+id/iv_end_order_opendoor"
app:layout_constraintTop_toBottomOf="@+id/iv_end_order_opendoor" />
<ImageView
android:id="@+id/iv_end_order_opendoor"
android:layout_width="@dimen/dp_108"
android:layout_height="@dimen/dp_108"
android:layout_marginBottom="@dimen/dp_100"
android:src="@drawable/m1_order_end_opendoor_selecotr"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/iv_end_order_closedoor"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_19"
android:text="关车门"
android:textColor="@color/bus_p_m1_23293b"
android:textSize="@dimen/dp_28"
app:layout_constraintEnd_toEndOf="@+id/iv_end_order_closedoor"
app:layout_constraintStart_toStartOf="@+id/iv_end_order_closedoor"
app:layout_constraintTop_toBottomOf="@+id/iv_end_order_closedoor" />
<ImageView
android:id="@+id/iv_end_order_closedoor"
android:layout_width="@dimen/dp_108"
android:layout_height="@dimen/dp_108"
android:layout_marginBottom="@dimen/dp_100"
android:src="@drawable/m1_order_end_closedoor_selecotr"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/iv_end_order_opendoor" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_19"
android:text="开车门"
android:textColor="@color/bus_p_m1_23293b"
android:textSize="@dimen/dp_28"
app:layout_constraintEnd_toEndOf="@+id/iv_end_order_opendoor"
app:layout_constraintStart_toStartOf="@+id/iv_end_order_opendoor"
app:layout_constraintTop_toBottomOf="@+id/iv_end_order_opendoor" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_19"
android:text="关车门"
android:textColor="@color/bus_p_m1_23293b"
android:textSize="@dimen/dp_28"
app:layout_constraintEnd_toEndOf="@+id/iv_end_order_closedoor"
app:layout_constraintStart_toStartOf="@+id/iv_end_order_closedoor"
app:layout_constraintTop_toBottomOf="@+id/iv_end_order_closedoor" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -56,14 +56,13 @@
android:id="@+id/rv_site_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_26"
/>
android:layout_marginTop="@dimen/dp_26" />
<View
app:layout_constraintBottom_toBottomOf="parent"
android:background="@drawable/charter_p_selct_site_bottom_corner"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_90"/>
android:layout_height="@dimen/dp_90"
android:background="@drawable/charter_p_selct_site_bottom_corner"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -167,34 +166,34 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/aciv_driver_agree_title_top"
app:layout_constraintStart_toStartOf="@+id/aciv_driver_agree_image"
app:layout_constraintEnd_toEndOf="@+id/aciv_driver_agree_image"
app:layout_constraintTop_toBottomOf="@+id/aciv_driver_agree_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_34"
android:text="确认完毕!"
android:textColor="@color/bus_p_m1_112b57"
android:textStyle="bold"
android:textSize="@dimen/dp_34"
android:layout_marginTop="@dimen/dp_34"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="@+id/aciv_driver_agree_image"
app:layout_constraintStart_toStartOf="@+id/aciv_driver_agree_image"
app:layout_constraintTop_toBottomOf="@+id/aciv_driver_agree_image" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/aciv_driver_agree_title_bottom"
app:layout_constraintStart_toStartOf="@+id/aciv_driver_agree_image"
app:layout_constraintEnd_toEndOf="@+id/aciv_driver_agree_image"
app:layout_constraintTop_toBottomOf="@+id/aciv_driver_agree_title_top"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="小助手已记录您的选择。"
android:textColor="@color/bus_p_m1_112b57"
android:textSize="@dimen/dp_29"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
app:layout_constraintEnd_toEndOf="@+id/aciv_driver_agree_image"
app:layout_constraintStart_toStartOf="@+id/aciv_driver_agree_image"
app:layout_constraintTop_toBottomOf="@+id/aciv_driver_agree_title_top" />
<androidx.constraintlayout.widget.Group
android:id="@+id/group_driver_agrenn_line"
app:constraint_referenced_ids="aciv_driver_agree_image,aciv_driver_agree_title_top,aciv_driver_agree_title_bottom"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content"
android:visibility="gone"
app:constraint_referenced_ids="aciv_driver_agree_image,aciv_driver_agree_title_top,aciv_driver_agree_title_bottom" />
<!--endregion 司机同意显示-->
<!--region 司机拒绝显示-->
@@ -211,24 +210,24 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/aciv_driver_refuse_title"
app:layout_constraintStart_toStartOf="@+id/aciv_driver_refuse_image"
app:layout_constraintEnd_toEndOf="@+id/aciv_driver_refuse_image"
app:layout_constraintTop_toBottomOf="@+id/aciv_driver_refuse_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_35"
android:gravity="center"
android:text="啊哦,加载失败了\n联系车内领航员或尝试再次提交。"
android:textColor="@color/bus_p_m1_112b57"
android:textSize="@dimen/dp_34"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
app:layout_constraintEnd_toEndOf="@+id/aciv_driver_refuse_image"
app:layout_constraintStart_toStartOf="@+id/aciv_driver_refuse_image"
app:layout_constraintTop_toBottomOf="@+id/aciv_driver_refuse_image" />
<androidx.constraintlayout.widget.Group
android:id="@+id/aciv_driver_refuse_group"
android:visibility="gone"
app:constraint_referenced_ids="aciv_driver_refuse_image,aciv_driver_refuse_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content"
android:visibility="gone"
app:constraint_referenced_ids="aciv_driver_refuse_image,aciv_driver_refuse_title" />
<!--endregion 司机拒绝显示-->
@@ -239,6 +238,16 @@
layout="@layout/m1_order_noorder"
android:visibility="gone" />
<include
android:id="@+id/m1_order_neterror"
layout="@layout/m1_order_net_fail"
android:visibility="gone" />
<include
android:id="@+id/m1_order_loading"
layout="@layout/m1_order_loading"
android:visibility="gone" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ll_noorder"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:gravity="center"
android:orientation="vertical"
xmlns:app="http://schemas.android.com/apk/res-auto">
<ImageView
android:id="@+id/iv_loading_wait_ent"
android:layout_width="@dimen/dp_71"
android:layout_height="@dimen/dp_73"
android:src="@drawable/bus_p_loading"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.372" />
<TextView
android:id="@+id/tv_loading_wait_driver_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="63dp"
android:text="加载中 请稍等"
android:gravity="center"
android:textColor="@color/bus_p_m1_4a5375"
android:textSize="@dimen/dp_30"
app:layout_constraintEnd_toEndOf="@+id/iv_loading_wait_driver"
app:layout_constraintStart_toStartOf="@+id/iv_loading_wait_driver"
app:layout_constraintTop_toBottomOf="@+id/iv_loading_wait_driver" />
</LinearLayout>

View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/ll_noorder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<!-- 无订单页面 -->
<ImageView
android:layout_width="@dimen/dp_387"
android:layout_height="@dimen/dp_230"
android:src="@drawable/m1_order_net_fail"
android:layout_marginTop="@dimen/dp_68"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_see_next_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_42"
android:text="@string/m1_net_error"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="@dimen/dp_99"
android:textColor="@color/bus_p_m1_112b57"
android:textSize="@dimen/dp_29" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_42"
android:text="网络不佳"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@+id/tv_see_next_time"
android:layout_marginBottom="@dimen/dp_5"
android:textColor="@color/bus_p_m1_112b57"
android:textSize="@dimen/dp_34" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -46,6 +46,7 @@
<color name="bus_p_m1_3060ABFE">#3060ABFE</color>
<color name="bus_p_m1_0060ABFE">#0060ABFE</color>
<color name="bus_p_m1_00EFF6FF">#00EFF6FF</color>
<color name="bus_p_m1_B3EFF6FF">#B3EFF6FF</color>
<color name="bus_p_m1_91EFF6FF">#91EFF6FF</color>
<color name="bus_p_m1_CCFFFFFF">#CCFFFFFF</color>
<color name="bus_p_m1_80ffffff">#80FFFFFF</color>

View File

@@ -38,7 +38,7 @@
<string name="m1_bottom_reach_time">--:--</string>
<string name="m1_stop_site">靠边停车</string>
<string name="m1_welcome_tts">欢迎乘坐蘑菇车联自动驾驶小巴车,按照桌面屏幕的指引,开始探索吧!</string>
<string name="m1_welcome_tts">欢迎乘坐\'蘑菇车联\'自动驾驶小巴车,按照桌面屏幕的指引,开始探索吧!</string>
<string name="m1_novice_guidance_tts">接下来由蘑菇小助手为您\'指引方向\'</string>
<string name="m1_novice_guidance_door_tts">关闭车门后,点击‘出发’按钮启动</string>
@@ -48,7 +48,8 @@
<string name="m1_close_door_and_startauto">先关闭车门再启动吧~</string>
<string name="m1_start_auto_fail">自驾系统繁忙,稍后再试试吧~</string>
<string name="arrived_station_left_100">%1$s就要到啦!</string>
<string name="arrived_station_left_100">%1$s就要到啦</string>
<string name="m1_net_error">稍后再来看看吧</string>
<!-- <string name="m1_novice_guidance_tts">正在为您靠边停车,扶稳坐好哟</string>-->
<!-- <string name="m1_novice_guidance_tts">靠边停车成功</string>-->
<!-- <string name="m1_novice_guidance_tts">车辆系统繁忙,请稍后再试</string>-->

View File

@@ -5,6 +5,7 @@ import com.mogo.eagle.core.network.utils.GsonUtil
import com.mogo.eagle.core.utilcode.util.CoordinateTransform
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil
import com.mogo.och.common.module.utils.DateTimeUtil
import org.json.JSONException
import org.json.JSONObject
import org.junit.Test

View File

@@ -4,4 +4,5 @@ package com.magic.mogo.och.charter.bean
* @author: wangmingjun
* @date: 2023/2/24
*/
data class RequestChangeDest(var sn: String,var lineId: Int,var startSiteId: Int,var siteId: Int)
data class RequestChangeDest(var sn: String,var lineId: Int,var startSiteId: Int,var siteId: Int,
val writeVersion: Long)

View File

@@ -16,8 +16,10 @@ import com.magic.mogo.och.charter.manager.CharterAnalyticsManager
import com.magic.mogo.och.charter.manager.CharterTrajectoryManager
import com.magic.mogo.och.charter.net.DriverM1ServiceManager
import com.mogo.aicloud.services.socket.IMogoOnMessageListener
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.module.intent.IMogoIntentListener
import com.mogo.commons.module.intent.IntentManager
import com.mogo.commons.voice.AIAssist
import com.mogo.eagle.core.data.BaseData
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
import com.mogo.eagle.core.data.map.MogoLocation
@@ -29,6 +31,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager.sendMsgToAllClients
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.i
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
@@ -51,6 +54,7 @@ import com.mogo.och.common.module.manager.CharterSendTripInfoManager.END_TRIP
import com.mogo.och.common.module.manager.CharterSendTripInfoManager.START_TRIP
import com.mogo.och.common.module.manager.OCHAdasAbilityManager
import com.mogo.och.common.module.utils.*
import com.mogo.och.common.module.voice.VoiceNotice
import com.mogo.och.data.bean.*
import io.reactivex.exceptions.UndeliverableException
import io.reactivex.functions.Consumer
@@ -236,6 +240,22 @@ class DriverM1Model {
}
}else if (msg.type == DPMsgType.TYPE_TASK_DETAILS.type){
updateToClientData()
} else if (msg.type == DPMsgType.TYPE_COMMON.type) {
val msg = GsonUtils.fromJson(
String(byteArray),
AppConnectMsg::class.java
) as AppConnectMsg
CallerLogger.d(SceneConstant.M_BUS_P + BaseDPMsg.TAG, "收到数据:常规数据:$msg")
if (msg.isViewShow) { //消息盒子显示内容
pushOperationalToMsgBox(
DateTimeUtil.getCurrentTimeStamp(),
msg.msg,
msg.boxType
)
}
if(msg.isPlay){
VoiceNotice.showNotice(msg.msg, AIAssist.LEVEL1)
}
}
d(SceneConstant.M_CHARTER_D,"onReceivedMsg = "+ GsonUtils.toJson(msg))
}catch (e: Exception){
@@ -275,7 +295,7 @@ class DriverM1Model {
pushOperationalToMsgBox(DateTimeUtil.getCurrentTimeStamp(), obj.context)
}
if (list != null && list.contains(2)){ //发送乘客屏
sendMsgToClient(DPCommonOperationMsg(obj.context))
sendMsgToClient(AppConnectMsg(msg = obj.context))
}
}
@@ -462,9 +482,20 @@ class DriverM1Model {
,mCurrentOrder!!.siteName
,true
,mCurrentOrder!!.arriveStatus
,mCurrentOrder!!.writeVersion)
,if(mCurrentOrder!!.writeVersion == 0L){
DateTimeUtils.getCurTimeInMillis()
}else{
mCurrentOrder!!.writeVersion
})
}
}
currentChangeDestMsg?.writeVersion = if(mCurrentOrder!!.writeVersion == 0L){
DateTimeUtils.getCurTimeInMillis()
}else{
mCurrentOrder!!.writeVersion
}
sendMsgToClient(currentChangeDestMsg)
}
@@ -609,10 +640,11 @@ class DriverM1Model {
/**
* 司机端发送消息给乘客屏
*/
fun sendCommitMsgToClient(isConfirmed: Boolean) {
if (currentChangeDestMsg !== null) {
fun sendCommitMsgToClient(isConfirmed: Boolean,writeVersion: Long) {
if (currentChangeDestMsg != null) {
d(SceneConstant.M_CHARTER_D + TAG, "confirmed station $isConfirmed" )
currentChangeDestMsg?.isConfirmed = isConfirmed
currentChangeDestMsg?.writeVersion = writeVersion
sendMsgToClient(currentChangeDestMsg)
}
}
@@ -773,16 +805,18 @@ class DriverM1Model {
// sendCommitMsgToClient(true)
// return
// }
val writeVersion = DateTimeUtil.getCurrentTimeStamp()
DriverM1ServiceManager.changeDest(mContext,currentChangeDestMsg!!.lineId,
currentChangeDestMsg!!.startSiteId,
currentChangeDestMsg!!.destSiteId,
writeVersion,
object : OchCommonServiceCallback<BaseData>{
override fun onSuccess(data: BaseData?) {
if (data != null && data.code == 0){
d(SceneConstant.M_CHARTER_D + TAG, "confirmed station .")
CallerAutoPilotControlManager.cancelAutoPilot()
queryCurrentServiceStatus()
sendCommitMsgToClient(true)
sendCommitMsgToClient(true,writeVersion)
}
}

View File

@@ -9,6 +9,7 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl
import com.mogo.och.common.module.biz.network.interceptor.transformTry
import com.mogo.och.common.module.utils.DateTimeUtil
/**
* Created by pangfan on 2021/8/19
@@ -66,20 +67,21 @@ object DriverM1ServiceManager {
?.subscribe(OchCommonSubscribeImpl(context!!, callback, "checkOrderCountDown"))
}
fun changeDest(context: Context?,lineId: Int,startSiteId: Int,siteId: Int,
fun changeDest(context: Context?,lineId: Int,startSiteId: Int,siteId: Int,writeVersion: Long,
callback: OchCommonServiceCallback<BaseData>?){
mDriverM1ServiceApi.changeDest(MoGoAiCloudClientConfig.getInstance().serviceAppId,
MoGoAiCloudClientConfig.getInstance().token,
RequestChangeDest(MoGoAiCloudClientConfig.getInstance().sn,lineId,startSiteId,siteId)
RequestChangeDest(MoGoAiCloudClientConfig.getInstance().sn,lineId,startSiteId,siteId,
writeVersion)
)?.transformTry()
?.subscribe(OchCommonSubscribeImpl(context!!, callback, "changeDest"))
}
fun arriveDest(context: Context,lindId: Long ,writtenVersion:Long
fun arriveDest(context: Context,lindId: Long ,writeVersion:Long
,callback: OchCommonServiceCallback<BaseData>?){
mDriverM1ServiceApi.arriveDest(MoGoAiCloudClientConfig.getInstance().serviceAppId,
MoGoAiCloudClientConfig.getInstance().token,
ArriveDestRequest(MoGoAiCloudClientConfig.getInstance().sn,lindId,writtenVersion)
ArriveDestRequest(MoGoAiCloudClientConfig.getInstance().sn,lindId,writeVersion)
).transformTry()
.subscribe(OchCommonSubscribeImpl(context!!, callback, "arriveDest"))
}

View File

@@ -16,13 +16,13 @@ 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.d
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.DateTimeUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.och.common.module.biz.bean.DriverStatusQueryRespBean
import com.mogo.och.common.module.biz.callback.ILoginCallback
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager.OPERATION_ROAD_SIDE_TYPE
import com.mogo.och.common.module.biz.constant.LoginStatusManager
import com.mogo.och.common.module.biz.constant.LoginStatusManager.isLogin
import com.mogo.och.common.module.manager.OCHPlanningStopSideStatusManager
import com.mogo.och.common.module.manager.StopSideStatusManager
import com.mogo.och.common.module.utils.DateTimeUtil
import mogo.telematics.pad.MessagePad
import mogo_msg.MogoReportMsg
@@ -33,7 +33,7 @@ import mogo_msg.MogoReportMsg
*/
class DriverM1Presenter(view: DriverM1Fragment?) :
Presenter<DriverM1Fragment?>(view),ILoginCallback, DriverM1OrderCallback, ChangeDestCallback,
IMoGoAutopilotStatusListener, OCHPlanningStopSideStatusManager.OCHPlanningActionsCallback,
IMoGoAutopilotStatusListener, StopSideStatusManager.OCHPlanningActionsCallback,
IDriverM1ControllerStatusCallback {
private val TAG = DriverM1Presenter::class.java.name
@@ -47,14 +47,14 @@ class DriverM1Presenter(view: DriverM1Fragment?) :
private fun registerListener() {
//2021.11.1 鹰眼架构整合由IMoGoAutopilotStatusListener逐步替代IMogoAdasOCHCallback接口
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
OCHPlanningStopSideStatusManager.addListener(TAG,this)
StopSideStatusManager.addListener(TAG,this)
DriverM1Model.get().setDriverM1OrderCallback(this)
DriverM1Model.get().setChangeDestCallback(this)
DriverM1Model.get().setControllerStatusCallback(this)
}
private fun releaseListener() {
OCHPlanningStopSideStatusManager.removeListener(TAG)
StopSideStatusManager.removeListener(TAG)
CallerAutoPilotStatusListenerManager.removeListener(TAG)
DriverM1Model.get().setDriverM1OrderCallback(null)
DriverM1Model.get().setChangeDestCallback(null)
@@ -119,7 +119,7 @@ class DriverM1Presenter(view: DriverM1Fragment?) :
}
fun sendCommitMsgToClient(isAffirm: Boolean){
DriverM1Model.get().sendCommitMsgToClient(isAffirm)
DriverM1Model.get().sendCommitMsgToClient(isAffirm,DateTimeUtils.getCurTimeInMillis())
}
fun changeDest(){
@@ -163,15 +163,23 @@ class DriverM1Presenter(view: DriverM1Fragment?) :
}
override fun onStartAutopilotFailure(
actionStatus: OCHPlanningStopSideStatusManager.Status,
actionStatus: StopSideStatusManager.Status,
stopSideStatus: Boolean?,
errorInfo: String?
) {
when (actionStatus) {
OCHPlanningStopSideStatusManager.Status.START -> { // 靠边停车 to 消息盒子
StopSideStatusManager.Status.START -> { // 靠边停车 to 消息盒子
DriverM1Model.get().pushOperationalToMsgBox(
DateTimeUtil.getCurrentTimeStamp(),
"",
"靠边停车",
OPERATION_ROAD_SIDE_TYPE
)
}
StopSideStatusManager.Status.EndingFaile,
StopSideStatusManager.Status.NOSTART-> {
DriverM1Model.get().pushOperationalToMsgBox(
DateTimeUtil.getCurrentTimeStamp(),
"靠边停车失败",
OPERATION_ROAD_SIDE_TYPE
)
}

View File

@@ -31,7 +31,7 @@ data class ChangeDestMsg(
var destSiteName: String = "",
var isConfirmed: Boolean = false, //司机端是否同意
var arriveStatus:Int?, //1:未到达 2:到达
var writtenVersion:Long?, //版本标记
var writeVersion:Long?, //版本标记
var lineSiteList: MutableList<LineSite>? = null
): BaseDPMsg(DPMsgType.TYPE_CHANGE_DEST.type)
@@ -76,8 +76,9 @@ data class DPOrderClosedMsg(
var closed: Boolean = true // true: 结束
): BaseDPMsg(DPMsgType.TYPE_ORDER_CLOSED.type)
data class AppConnectMsg(var isViewShow: Boolean, var isPlay: Boolean, var msg: String,
): BaseDPMsg(DPMsgType.TYPE_COMMON.type)
data class AppConnectMsg(
var isViewShow: Boolean = true, var isPlay: Boolean = false, var msg: String,var boxType:Int=-1
) : BaseDPMsg(DPMsgType.TYPE_COMMON.type)
data class TaskDetailsMsg(
var msg: String?,

View File

@@ -0,0 +1,29 @@
package com.mogo.och.common.module.manager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
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.GsonUtils
import com.mogo.och.common.module.bean.dpmsg.BaseDPMsg
import com.mogo.och.common.module.biz.constant.OchCommonConst
object LanSocketManager {
private const val TAG = "LanSocket"
fun sendMsgToClient(msg: BaseDPMsg?) {
CallerLogger.d(SceneConstant.M_CHARTER_D + TAG, "sendMsgToClient" + GsonUtils.toJson(msg))
CallerTelematicManager.sendMsgToAllClients(
OchCommonConst.BUSINESS_STRING,
GsonUtils.toJson(msg).toByteArray()
)
}
fun sendMsgToServer(msg: BaseDPMsg?) {
CallerLogger.d(SceneConstant.M_CHARTER_D + TAG, "sendMsgToServer" + GsonUtils.toJson(msg))
CallerTelematicManager.sendMsgToServer(
OchCommonConst.BUSINESS_STRING,
GsonUtils.toJson(msg).toByteArray()
)
}
}

View File

@@ -7,7 +7,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import mogo.telematics.pad.MessagePad
import java.util.concurrent.ConcurrentHashMap
object OCHPlanningStopSideStatusManager : IMoGoAutopilotPlanningActionsListener {
object StopSideStatusManager : IMoGoAutopilotPlanningActionsListener {
private const val TAG = "OCHPlanningActionsManager"
init {

View File

@@ -4,6 +4,8 @@ import com.mogo.commons.voice.AIAssist
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.common.module.bean.dpmsg.AppConnectMsg
import com.mogo.och.common.module.manager.LanSocketManager
import com.mogo.och.common.module.utils.RxUtils
import com.mogo.och.common.module.voice.VoiceNotice
import io.reactivex.disposables.Disposable
@@ -14,7 +16,7 @@ object LightAirconditionDoorManager {
private var dooorSubscribe: Disposable? = null
private var doorStatusSubscribe: Disposable? = null
fun go2OpenDoor(isOpen:Boolean){
fun go2OpenDoor(go2Open:Boolean){
val canOpenOrCloseDoor = canOpenOrCloseDoor()
if(!canOpenOrCloseDoor.isNullOrBlank()){
ToastUtils.showLong(canOpenOrCloseDoor)
@@ -24,7 +26,7 @@ object LightAirconditionDoorManager {
dooorSubscribe = RxUtils.createSubscribe(1000) {
CallerAutoPilotControlManager.sendRoboBusJinlvM1FrontDoorCmd(0)
}
if(isOpen) {
if(go2Open) {
CallerAutoPilotControlManager.sendRoboBusJinlvM1FrontDoorCmd(1)
}else{
CallerAutoPilotControlManager.sendRoboBusJinlvM1FrontDoorCmd(2)
@@ -32,21 +34,37 @@ object LightAirconditionDoorManager {
RxUtils.disposeSubscribe(doorStatusSubscribe)
doorStatusSubscribe = RxUtils.createSubscribe(6000) {
if (LightAirconditionDoorStatusManager.doorStatus.isOpen) {
ToastUtils.showShort("车辆系统繁忙,稍后再试试吧~")
VoiceNotice.showNotice(
"车辆系统繁忙,稍后再试试吧~",
AIAssist.LEVEL0
)
if(!go2Open) {// 关门失败
ToastUtils.showShort("车辆系统繁忙,稍后再试试吧~")
VoiceNotice.showNotice(
"车辆系统繁忙,稍后再试试吧~",
AIAssist.LEVEL0
)
sendMsg2Server("车门关闭失败")
}
}else{
ToastUtils.showShort("车辆系统繁忙,稍后再试试吧~")
VoiceNotice.showNotice(
"车辆系统繁忙,稍后再试试吧~",
AIAssist.LEVEL0
)
if(go2Open) {//开门失败
ToastUtils.showShort("车辆系统繁忙,稍后再试试吧~")
VoiceNotice.showNotice(
"车辆系统繁忙,稍后再试试吧~",
AIAssist.LEVEL0
)
sendMsg2Server("车门开启失败")
}
}
}
}
private fun sendMsg2Server(msg:String){
val appConnectMsg = AppConnectMsg(
isViewShow = true,
isPlay = false,
msg = msg,
boxType = 3
)
LanSocketManager.sendMsgToServer(appConnectMsg)
}
private fun canOpenOrCloseDoor(): String? {
val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
return if(location.gnssSpeed<0.01){

View File

@@ -79,7 +79,7 @@ public class CoordinateCalculateRouteUtil {
int currentRouteIndex = getArrivedPointIndexNew(
0, mRoutePoints, location.getLongitude(), location.getLatitude()
);
// 距离当前位置轨迹中最近的轨迹点
// 距离当前位置轨迹中最近的轨迹点坐标
MogoLocation currentPoint = mRoutePoints.get(currentRouteIndex);
// 当前位置距离最近的点的距离
float calculateCurrentdex = CoordinateUtils.calculateLineDistance(
@@ -135,7 +135,7 @@ public class CoordinateCalculateRouteUtil {
// region 当前位置和 对应轨迹点的坐标距离
// 需要加距离 和下一个轨迹点成钝角
if (currentRouteIndex + 1 < stationPointInRouteIndex) {
MogoLocation currentPointsNext = mRoutePoints.get(stationPointInRouteIndex + 1);
MogoLocation currentPointsNext = mRoutePoints.get(currentRouteIndex + 1);
double degree = getDegree(
location.getLongitude(),location.getLatitude(),
currentPoint.getLongitude(), currentPoint.getLatitude(),
@@ -147,7 +147,7 @@ public class CoordinateCalculateRouteUtil {
// 需要减距离 和上一个轨迹点成钝角
if (currentRouteIndex - 1 >= 0) {
MogoLocation lastPointsPre = mRoutePoints.get(stationPointInRouteIndex - 1);
MogoLocation lastPointsPre = mRoutePoints.get(currentRouteIndex - 1);
double degree = getDegree(
location.getLongitude(),location.getLatitude(),
currentPoint.getLongitude(), currentPoint.getLatitude(),
@@ -426,6 +426,16 @@ public class CoordinateCalculateRouteUtil {
return currentIndex;
}
/**
* https://blog.csdn.net/Jeanne_0523/article/details/106056255
* @param vertexPointX
* @param vertexPointY
* @param point0X 角
* @param point0Y 角
* @param point1X
* @param point1Y
* @return
*/
public static int getDegree(double vertexPointX, double vertexPointY, double point0X, double point0Y, double point1X, double point1Y) {
//向量的点乘
double vector = (point0X - vertexPointX) * (point1X - vertexPointX) + (point0Y - vertexPointY) * (point1Y - vertexPointY);

View File

@@ -109,7 +109,7 @@ public class BusStationBean {
&& drivingStatus == that.drivingStatus
&& leaving == that.leaving
&& name.equals(that.name)
&& nameKr.equals(that.nameKr);
&& (nameKr == null || nameKr.equals(that.nameKr));
}
@Override

View File

@@ -267,7 +267,11 @@ class PM2DrivingModel private constructor() {
.coordinateConverterWgsToGcjLocations(mContext, routePoints)
d(SceneConstant.M_BUS_P + TAG, "och-rotting==latLngModels = " + latLngModels.size)
mRoutePoints.addAll(latLngModels)
calculateTwoStationsRoute()
if (isGoingToNextStation){
mTwoStationsRouts.clear()
startRemainRouteInfo()
}
}
private fun updateSpeed(mogoLocation: MogoLocation) {
@@ -497,6 +501,10 @@ class PM2DrivingModel private constructor() {
}
fun dynamicCalculateRouteInfo(){
//如果轨迹点为空发送一次获取轨迹指令
if (mRoutePoints.size == 0){
CallerAutoPilotControlManager.getGlobalPath()
}
//计算当前位置和下一站的剩余点集合
//计算剩余点总里程和时间
d(SceneConstant.M_BUS_P + TAG, "och-rotting==mTwoStationsRouts.size() = " + mTwoStationsRouts.size)

View File

@@ -30,7 +30,7 @@ class PM2ADASPresenter(view: PM2HPMapFragment?) :
override fun updateHDMapStations(stations: MutableList<MutableList<Double>>) {
for (i in stations.indices){
mView?.setMapMaker(M2_MAP_STATION_MAKER,stations[i])
mView?.setMapMaker(M2_MAP_STATION_MAKER+i,stations[i])
}
}

View File

@@ -120,7 +120,7 @@ class PM2HPMapFragment :
val removeMapMarkerRunnable = Runnable {
d("RemoveMapMaker=" + Thread.currentThread().name, uuid)
val overlayManager = getOverlayManager()
overlayManager?.removePoint(uuid)
overlayManager?.removeAllPointsInOwner(TYPE_MARKER_M2_LINE)
}
OCHThreadPoolManager.getsInstance().execute(removeMapMarkerRunnable)
}

View File

@@ -235,6 +235,7 @@ public class OrderModel {
@Override
public void onReceivedMsg(int type, @NonNull byte[] byteArray) {
if (OchCommonConst.BUSINESS_STRING == type){
CallerLogger.INSTANCE.d(M_BUS + BaseDPMsg.TAG,new String(byteArray));
BaseDPMsg msg = GsonUtils.fromJson(new String(byteArray),BaseDPMsg.class);
if (msg!=null && msg.getType() == DPMsgType.TYPE_TASK_DETAILS.getType()){
sendTaskDetailsToClients();
@@ -266,7 +267,7 @@ public class OrderModel {
}
if (list != null && list.contains(2)){ //乘客屏
AppConnectMsg msg = new AppConnectMsg(true,false,obj.getContext());
AppConnectMsg msg = new AppConnectMsg(true,false,obj.getContext(),-1);
CallerTelematicManager.INSTANCE.sendMsgToAllClients(OchCommonConst.BUSINESS_STRING,
GsonUtils.toJson(msg).getBytes());
}
@@ -843,7 +844,7 @@ public class OrderModel {
private void sendArrivedStationToClient(String arriveStation) {
AppConnectMsg arrivedMsg = new AppConnectMsg(false,true,String.format(mContext
.getString(R.string.bus_arrived_station_tip),
arriveStation));
arriveStation),-1);
CallerTelematicManager.INSTANCE.sendMsgToAllClients(OchCommonConst.BUSINESS_STRING,
GsonUtils.toJson(arrivedMsg).getBytes());
}
@@ -851,7 +852,7 @@ public class OrderModel {
private void sendStartStationToClient(String nextStation) {
AppConnectMsg startMsg = new AppConnectMsg(false,true,String.format(mContext
.getString(R.string.bus_leave_station_tip),
nextStation));
nextStation),-1);
UiThreadHandler.postDelayed(()->
CallerTelematicManager.INSTANCE.sendMsgToAllClients(OchCommonConst.BUSINESS_STRING,
@@ -860,14 +861,14 @@ public class OrderModel {
private void sendEndTaskToClient() {
AppConnectMsg endMsg = new AppConnectMsg(false,true,mContext
.getString(R.string.bus_end_task_tip));
.getString(R.string.bus_end_task_tip),-1);
CallerTelematicManager.INSTANCE.sendMsgToAllClients(OchCommonConst.BUSINESS_STRING,
GsonUtils.toJson(endMsg).getBytes());
}
public void sendWriteOffNumToClient(String msg){
AppConnectMsg passengerMsg = new AppConnectMsg(false,true,msg);
AppConnectMsg passengerMsg = new AppConnectMsg(false,true,msg,-1);
CallerTelematicManager.INSTANCE.sendMsgToAllClients(OchCommonConst.BUSINESS_STRING,
GsonUtils.toJson(passengerMsg).getBytes());

View File

@@ -62,9 +62,8 @@ public class TaxiPassengerModelLoopManager {
public void startRouteAndWipe() {
CallerLogger.INSTANCE.i(M_TAXI_P + TAG, "startRouteAndWipe()");
if (mRouteWipeDisposable != null) return;
if (mRouteWipeDisposable == null){
mRouteWipeDisposable = new CompositeDisposable();
}
mRouteWipeDisposable = new CompositeDisposable();
Disposable disposable = startLoopRouteAndWipe()
.doOnSubscribe(new Consumer<Disposable>() {
@Override

View File

@@ -224,11 +224,15 @@ public class TaxiPassengerMapDirectionView
// 设置开始结束Marker位置
LatLng startLatLng = mCoordinatesLatLng.get(0);
LatLng endLatLng = mCoordinatesLatLng.get(mCoordinatesLatLng.size() - 1);
if (mStartMarker != null) {
mStartMarker.setPosition(startLatLng);
mStartMarker.setVisible(true);
}
mStartMarker.setPosition(startLatLng);
mEndMarker.setPosition(endLatLng);
mStartMarker.setVisible(true);
mEndMarker.setVisible(true);
if (mEndMarker != null) {
mEndMarker.setPosition(endLatLng);
mEndMarker.setVisible(true);
}
}
}

View File

@@ -128,9 +128,9 @@ public class TaxiModelLoopManager {
CallerLogger.INSTANCE.i(M_TAXI + TAG, "startCalculateRouteInfoLoop()");
if (mCalculateRouteDisposable != null) return;
if (mCalculateRouteDisposable == null){
mCalculateRouteDisposable = new CompositeDisposable();
}
mCalculateRouteDisposable = new CompositeDisposable();
Disposable disposable = loopDynamicCalculateRouteInfo()
.doOnSubscribe(new Consumer<Disposable>() {
@Override

View File

@@ -228,11 +228,14 @@ public class TaxiMapDirectionView
// 设置开始结束Marker位置
LatLng startLatLng = mCoordinatesLatLng.get(0);
LatLng endLatLng = mCoordinatesLatLng.get(mCoordinatesLatLng.size() - 1);
mStartMarker.setPosition(startLatLng);
mEndMarker.setPosition(endLatLng);
mStartMarker.setVisible(true);
mEndMarker.setVisible(true);
if (mStartMarker != null) {
mStartMarker.setPosition(startLatLng);
mStartMarker.setVisible(true);
}
if (mEndMarker != null) {
mEndMarker.setPosition(endLatLng);
mEndMarker.setVisible(true);
}
}
}

View File

@@ -320,15 +320,14 @@
android:background="@drawable/bad_case_selector_och"/>
</LinearLayout>
<com.mogo.eagle.core.function.hmi.ui.widget.RomaView
android:layout_width="@dimen/module_mogo_och_operation_status_bg_height"
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
<com.mogo.eagle.core.function.hmi.ui.widget.RomaTaxiView
android:layout_width="@dimen/dp_182"
android:layout_height="@dimen/dp_182"
app:layout_constraintBottom_toBottomOf="@id/module_och_taxi_badcase_ll"
app:layout_constraintLeft_toRightOf="@id/module_och_taxi_badcase_ll"
app:layout_constraintTop_toTopOf="@id/module_och_taxi_badcase_ll"
app:roma_open_bg="@drawable/taxi_operation_status_select_bg"
app:roma_close_bg="@drawable/taxi_operation_status_bg"
android:layout_marginStart="40dp"
/>
<!-- <LinearLayout-->

View File

@@ -15,7 +15,7 @@ bugly {
appKey = '3c736249-d6be-4066-b577-b7a6dc975cf7' // 注册时分配的App Key
}
Properties properties = new Properties();
Properties properties = new Properties()
properties.load(project.rootProject.file("gradle.properties").newDataInputStream())
android {
@@ -139,10 +139,10 @@ android {
buildConfigField 'String', 'URLs', "\"${readFileToJson("dali").replace("\"", "\\\"")}\""
buildConfigField 'String', 'tempConfig', "\"${readFileToJsonTemp("dali").replace("\"", "\\\"")}\""
}
fuzhou {
saas {
dimension "project"
buildConfigField 'String', 'URLs', "\"${readFileToJson("fuzhou").replace("\"", "\\\"")}\""
buildConfigField 'String', 'tempConfig', "\"${readFileToJsonTemp("fuzhou").replace("\"", "\\\"")}\""
buildConfigField 'String', 'URLs', "\"${readFileToJson("saas").replace("\"", "\\\"")}\""
buildConfigField 'String', 'tempConfig', "\"${readFileToJsonTemp("saas").replace("\"", "\\\"")}\""
}
// 配置网络环境QA、线上、演示
qa {
@@ -319,7 +319,7 @@ def variantName() {
if (taskName.contains("Yantai")) {
project.dependencies.add('implementation', project.project(':tts:tts-iflytek'))
}else if (taskName.contains("Mogo") || taskName.contains("Fuzhou")) {
}else if (taskName.contains("Mogo") || taskName.contains("Saas")) {
project.dependencies.add('implementation', project.project(':tts:tts-pad'))
}else if (taskName.contains("Dali")) {
project.dependencies.add('implementation', project.project(':tts:tts-pad'))

View File

@@ -197,7 +197,7 @@
]
}
},
"fuzhou": {
"saas": {
"shuttlepassenger": {
"ads": [
{

View File

@@ -104,7 +104,7 @@
"chart_socket_url":""
}
},
"fuzhou": {
"saas": {
"qa": {
"och_url": "https://och-a.zhidaozhixing.com",
"shuttle_url": "https://och-a.zhidaozhixing.com",

View File

@@ -48,10 +48,15 @@
"passenger": ["ochM1"]
}
},
"fuzhou": {
"saas": {
"shuttle" :{
"driver": ["ochJL","ochM2"],
"passenger": ["ochJL","ochM2"]
},
"bus" :{
"driver": ["ochJL"],
"driverpassenger": ["ochJL"],
"passenger": ["ochJL"]
}
}
}

View File

@@ -26,7 +26,7 @@ buildscript {
dependencies {
classpath "com.android.tools.build:gradle:${gradle_version}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}"
classpath "com.alibaba:arouter-register:${plugin_version}"
classpath "com.alibaba:arouter-register:10.0.5_mogo"
classpath 'com.tencent.bugly:symtabfileuploader:2.2.1'
classpath "com.bytedance.android.byteX:base-plugin:${plugin_version}"
classpath "com.mogo.cloud:hook:${service_chain_version}"

View File

@@ -38,6 +38,7 @@ import com.mogo.eagle.core.function.chat.facade.socket.SocketConnectManager
import com.mogo.eagle.core.function.chat.facade.voice.VoiceControlFacade
import com.mogo.eagle.core.utilcode.kotlin.safeCancel
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.Utils
import kotlinx.coroutines.*
import kotlinx.coroutines.android.asCoroutineDispatcher
@@ -191,7 +192,9 @@ object MoGoChatFacade: IMoGoChatFacade {
val openId = (temp["localUserId"] as? Double ?: return@launch).toInt().toString()
Logger.d(ChatConsts.TAG, "handleMessage --- openId:$openId")
//初始化房间
GMEApi.init(context(), openId = openId, cb = gmeCallback)
withContext(ThreadUtils.getIoPool().asCoroutineDispatcher()) {
GMEApi.init(context(), openId = openId, cb = gmeCallback)
}
}
else ->
Logger.d(ChatConsts.TAG, "handleMessage --- $t")

View File

@@ -96,12 +96,12 @@ class TeleMsgHandler : IMsgHandler {
AppConfigInfo.iPCMacAddress = carConfig.macAddress
AppConfigInfo.dockerVersion = carConfig.dockVersion
listener?.connectDevice(!carConfig.dockVersion.contains("2.3.0"))
CallerDevaToolsManager.getBindingCarInfo(carConfig.macAddress, MoGoAiCloudClientConfig.getInstance().sn)
invokeNettyConnResult(
"司机屏发送给乘客屏配置信息为:${
TextFormat.printer().escapingNonAscii(false).printToString(carConfig)
}"
)
CallerDevaToolsManager.getBindingCarInfo(carConfig.macAddress, MoGoAiCloudClientConfig.getInstance().sn)
}
// SN
10 -> {

View File

@@ -21,6 +21,7 @@ import com.mogo.eagle.core.function.datacenter.obu.drawer.*
import com.mogo.eagle.core.function.datacenter.obu.utils.TrafficDataConvertUtilsNew
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
import com.mogo.eagle.core.utilcode.util.ConvertUtils
import com.mogo.support.obu.ObuScene
import com.zhidao.support.obu.constants.MogoObuShowConstants
import kotlin.math.roundToInt
@@ -135,8 +136,10 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
)
ttsContent = String.format(
ttsContent,
Math.round(rsiWarningData.warningMsgList[0].distance).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius).toString()
ConvertUtils.intToChinese(
rsiWarningData.warningMsgList[0].distance.roundToInt()),
ConvertUtils.intToChinese(
rsiWarningData.warningMsgList[0].eventRadius.roundToInt())
)
}
@@ -224,7 +227,8 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
)
ttsContent = String.format(
ttsContent,
Math.round(rsiWarningData.warningMsgList[0].distance).toString()
ConvertUtils.intToChinese(
rsiWarningData.warningMsgList[0].distance.roundToInt())
)
}
@@ -240,8 +244,10 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
)
ttsContent = String.format(
ttsContent,
Math.round(rsiWarningData.warningMsgList[0].distance).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius).toString()
ConvertUtils.intToChinese(
rsiWarningData.warningMsgList[0].distance.roundToInt()),
ConvertUtils.intToChinese(
rsiWarningData.warningMsgList[0].eventRadius.roundToInt())
)
}
@@ -255,7 +261,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
)
ttsContent = String.format(
EventTypeEnumNew.getWarningTts(appId),
mLimitSpeed
ConvertUtils.intToChinese(mLimitSpeed)
)
}
}

View File

@@ -23,6 +23,7 @@ import com.mogo.eagle.core.function.datacenter.obu.utils.TrafficDataConvertUtils
import com.mogo.eagle.core.utilcode.download.Config
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
import com.mogo.eagle.core.utilcode.util.ConvertUtils
import com.mogo.eagle.core.utilcode.util.FileUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.support.obu.ObuBase
@@ -410,8 +411,10 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
)
ttsContent = String.format(
ttsContent,
Math.round(data.warningMsgList[0].distance).toString(),
Math.round(data.warningMsgList[0].eventRadius).toString()
ConvertUtils.intToChinese(
data.warningMsgList[0].distance.roundToInt()),
ConvertUtils.intToChinese(
data.warningMsgList[0].eventRadius.roundToInt())
)
}
@@ -506,7 +509,8 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
)
ttsContent = String.format(
ttsContent,
Math.round(data.warningMsgList[0].distance).toString()
ConvertUtils.intToChinese(
data.warningMsgList[0].distance.roundToInt())
)
}
@@ -522,8 +526,10 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
)
ttsContent = String.format(
ttsContent,
Math.round(data.warningMsgList[0].distance).toString(),
Math.round(data.warningMsgList[0].eventRadius).toString()
ConvertUtils.intToChinese(
data.warningMsgList[0].distance.roundToInt()),
ConvertUtils.intToChinese(
data.warningMsgList[0].eventRadius.roundToInt())
)
}
@@ -539,7 +545,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
)
ttsContent = String.format(
EventTypeEnumNew.getWarningTts(appId),
mLimitSpeed
ConvertUtils.intToChinese(mLimitSpeed)
)
}
}

View File

@@ -34,7 +34,7 @@ import com.zhjt.mogo_core_function_devatools.apm.*
import com.mogo.eagle.core.function.api.upgrade.*
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseManager
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
import com.zhjt.mogo_core_function_devatools.binding.BindingCarManager.Companion.bindingCarManager
import com.zhjt.mogo_core_function_devatools.binding.*
import com.zhjt.mogo_core_function_devatools.env.EnvChangeManager
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigCenter.Companion.bizConfigCenter
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigImpl
@@ -90,7 +90,7 @@ class DevaToolsProvider : IDevaToolsProvider {
//升级(鹰眼/工控)与监控服务
iPCReportManager.initServer()
moFangManager.init(mContext!!)
bindingCarManager.init(mContext!!)
BindingCarManager.init(mContext!!)
apmEnvProvider.init(if(DebugConfig.isDebug()) "0" else "1", "${ DebugConfig.getNetMode() }", mDockerVersion ?: "")
BadCaseManager.init()
}
@@ -313,29 +313,29 @@ class DevaToolsProvider : IDevaToolsProvider {
}
override fun modifyCarInfo(callBack: (ModifyBindingcarInfo) -> Unit) {
bindingCarManager.modifyCarInfo(callBack)
BindingCarManager.modifyCarInfo(callBack)
}
override fun getBindingCarInfo(macAddress: String, widevineIDWithMd5: String) {
bindingCarManager.getBindingCarInfo(macAddress, widevineIDWithMd5)
BindingCarManager.getBindingCarInfo(macAddress, widevineIDWithMd5)
}
override fun upgradeConfirm(images: List<String>, padSn: String, releaseId: String) {
bindingCarManager.upgradeConfirm(images, padSn, releaseId)
BindingCarManager.upgradeConfirm(images, padSn, releaseId)
}
override fun queryContainers(padSn: String, dockerVersion: String) {
bindingCarManager.queryContainers(padSn, dockerVersion)
BindingCarManager.queryContainers(padSn, dockerVersion)
}
override fun queryAppUpgrade() {
bindingCarManager.queryAppUpgrade()
BindingCarManager.queryAppUpgrade()
}
override fun apmEnvProvider(): IApmEnvProvider = apmEnvProvider
override fun queryObuUpgrade(obuVersionName: String) {
bindingCarManager.queryObuUpgrade(obuVersionName)
BindingCarManager.queryObuUpgrade(obuVersionName)
}
override fun upgradeProvider(): IMoGoUpgradeProvider? {

View File

@@ -1,7 +1,9 @@
package com.zhjt.mogo_core_function_devatools.binding
import android.annotation.*
import android.content.Context
import android.text.TextUtils
import android.util.*
import com.elegant.utils.UiThreadHandler
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.constants.SharedPrefsConstants
@@ -16,6 +18,7 @@ import com.mogo.eagle.core.function.call.obu.CallerObuApiManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isDriver
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isPassenger
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.zhjt.mogo_core_function_devatools.upgrade.IPCUpgradeManager.Companion.ipcUpgradeManager
@@ -26,21 +29,19 @@ import mogo.telematics.pad.MessagePad
/**
* 车辆绑定
*/
class BindingCarManager : IMoGoAutopilotCarConfigListener {
@SuppressLint("StaticFieldLeak")
object BindingCarManager : IMoGoAutopilotCarConfigListener {
companion object {
private const val TAG = "BindingCarManager"
val bindingCarManager by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
BindingCarManager()
}
}
private const val TAG = "BindingCarManager"
private var mContext: Context? = null
@Volatile
private var mAddress: String? = null
@Volatile
private var mObuVersion: String? = null
@Volatile
private var mWidevineIDWithMd5 //google 数字版权
: String? = null
@@ -60,11 +61,10 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
}
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
CallerLogger.d("${SceneConstant.M_BINDING}${TAG}", "onAutopilotCarConfig ----------> ")
if (carConfigResp != null && !TextUtils.isEmpty(carConfigResp.macAddress)) {
CallerLogger.d("${SceneConstant.M_BINDING}${TAG}",
"onAutopilotCarConfig carConfigResp.macAddress = ${carConfigResp.macAddress} "
)
Logger.d("${SceneConstant.M_BINDING}${TAG}", "onAutopilotCarConfig ----------> ")
if (!TextUtils.isEmpty(carConfigResp.macAddress)) {
Logger.d("${SceneConstant.M_BINDING}${TAG}",
"onAutopilotCarConfig carConfigResp.macAddress = ${carConfigResp.macAddress} ")
getBindingCarInfo(carConfigResp.macAddress, MoGoAiCloudClientConfig.getInstance().sn)
}
}
@@ -75,12 +75,27 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
* @param macAddress
*/
fun getBindingCarInfo(macAddress: String, widevineIDWithMd5: String) {
Log.d("UPGRADE", "-- getBindingCarInfo -- 1 -- : [mac: $macAddress, md5: $widevineIDWithMd5]")
var flag = false
if (!TextUtils.isEmpty(macAddress) && TextUtils.isEmpty(mAddress)) {
Log.d("UPGRADE", "-- getBindingCarInfo -- 2 -- : [mac: $macAddress, md5: $widevineIDWithMd5]")
flag = true
}
if (!TextUtils.isEmpty(macAddress) && !TextUtils.equals(macAddress, mAddress)) {
mAddress = macAddress
}
if (flag) {
Log.d("UPGRADE", "-- getBindingCarInfo -- 3 -- : [mac: $macAddress, md5: $widevineIDWithMd5]")
queryAppUpgrade()
val obuVersion = mObuVersion
if (obuVersion != null && !TextUtils.isEmpty(obuVersion)) {
queryObuUpgrade(obuVersion)
}
}
CallerLogger.d("${SceneConstant.M_BINDING}${TAG}",
"getBindingcarInfo macAddress = $macAddress--widevineIDWithMd5 = $widevineIDWithMd5 ---screenType = $screenType"
)
SharedPrefsMgr.getInstance(mContext!!).putString(SharedPrefsConstants.APP_MAC, macAddress)
mAddress = macAddress
mWidevineIDWithMd5 = widevineIDWithMd5
if (screenType == 1) { //司机屏
driverScreen(macAddress, widevineIDWithMd5)
@@ -167,13 +182,20 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
* 查询app是否需要升级
*/
fun queryAppUpgrade() {
CallerLogger.d("${SceneConstant.M_BINDING}${TAG}" + "queryAppUpgrade---role.toString() = ${role.toString()} ---mAddress = $mAddress ---spMac = ${SharedPrefsMgr.getInstance(mContext!!)
.getString(SharedPrefsConstants.APP_MAC)}")
(if (!mAddress.isNullOrEmpty()) mAddress else SharedPrefsMgr.getInstance(mContext!!)
.getString(SharedPrefsConstants.APP_MAC))?.let {
CallerLogger.d("${SceneConstant.M_BINDING}${TAG}", "queryAppUpgrade---mAddress = $mAddress")
Log.d("UPGRADE", "---- 1 ----")
var macAddress = mAddress
if (TextUtils.isEmpty(macAddress)) {
Log.d("UPGRADE", "---- 2 ----")
macAddress = SharedPrefsMgr.getInstance(mContext!!)
.getString(SharedPrefsConstants.APP_MAC)
}
if (macAddress != null && !TextUtils.isEmpty(macAddress)) {
if (!TextUtils.equals(macAddress, mAddress)) {
mAddress = macAddress
}
Log.d("UPGRADE", "---- 3 ----[mac: $macAddress]")
UpgradeAppNetWorkManager.instance
?.getAppUpgradeInfo(mContext, it, role.toString() + "")
?.getAppUpgradeInfo(mContext, macAddress, role.toString() + "")
}
}
@@ -182,12 +204,12 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
* obu的升级,只需要司机屏连接
*/
fun queryObuUpgrade(obuVersionName: String) {
mObuVersion = obuVersionName
CallerLogger.d("${SceneConstant.M_OBU}${MogoObuConst.TAG_UPGRADE_OBU}", "screenType = $screenType ----role = $role")
if (screenType == 1) {
CallerLogger.d("${SceneConstant.M_OBU}${MogoObuConst.TAG_UPGRADE_OBU}","queryObuUpgrade isConnected = ${CallerObuApiManager.isConnected()} --- mAddress = $mAddress")
ObuUpgradeAppNetWorkManager.instance?.getObuUpgradeInfo(mContext, if(!mAddress.isNullOrEmpty()) mAddress else SharedPrefsMgr.getInstance(mContext!!).getString(SharedPrefsConstants.APP_MAC), obuVersionName)
}
}
}

View File

@@ -1,13 +1,12 @@
package com.zhjt.mogo_core_function_devatools.tts
import android.content.Context
import com.elegant.utils.storage.SharedPrefsMgr
import android.util.Log
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.voice.AIAssist
import com.mogo.eagle.core.function.api.cloud.IMoGoCloudListener
import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.zhjt.mogo_core_function_devatools.trace.TraceManager
class TtsManager : IMoGoCloudListener {
@@ -21,16 +20,14 @@ class TtsManager : IMoGoCloudListener {
}
fun initTts(context: Context) {
val sn = SharedPrefsMgr.getInstance(context).getString("sn")
if (sn.isNullOrEmpty()) {
CallerCloudListenerManager.addListener(TraceManager.TAG, this)
}
CallerCloudListenerManager.addListener(TAG, this)
AIAssist.getInstance(context)
}
override fun tokenGot(token: String, sn: String) {
ThreadUtils.runOnUiThread {
Log.d(TAG, "网络获取到sn为:${sn}准备重新初始化Tts")
ThreadUtils.runOnUiThread({
AIAssist.getInstance(AbsMogoApplication.getApp()).initTtsAgain(sn)
}
}, ThreadUtils.MODE.QUEUE)
}
}

View File

@@ -2,11 +2,15 @@ package com.zhjt.mogo_core_function_devatools.upgrade
import android.content.*
import android.util.*
import android.widget.Toast
import com.mogo.cloud.passport.*
import com.mogo.commons.constants.*
import com.mogo.commons.utils.*
import com.mogo.eagle.core.data.config.*
import com.mogo.eagle.core.data.deva.bindingcar.*
import com.mogo.eagle.core.function.api.devatools.download.DownloadType.APK
import com.mogo.eagle.core.function.api.devatools.download.DownloadType.PATCH
import com.mogo.eagle.core.function.call.devatools.*
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager.upgradeProvider
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showUpgradeDialog
import com.mogo.eagle.core.function.call.patch.CallerPatchManager.addPatchInfo
@@ -14,7 +18,7 @@ import com.mogo.eagle.core.function.call.patch.CallerPatchManager.isPatchAccept
import com.mogo.eagle.core.network.*
import com.mogo.eagle.core.network.utils.*
import com.mogo.eagle.core.utilcode.download.Config
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.kotlin.*
import com.mogo.eagle.core.utilcode.mogo.logger.scene.*
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.util.*
@@ -22,6 +26,7 @@ import com.mogo.eagle.core.utilcode.util.FileUtils
import kotlinx.coroutines.*
import okhttp3.*
import java.util.TreeMap
import java.util.concurrent.TimeUnit
/**
* @author lixiaopeng
@@ -36,16 +41,23 @@ class UpgradeAppNetWorkManager private constructor() {
private val provider by lazy { upgradeProvider() }
@Volatile
private var upgradeJob: Job? = null
// 标识静默升级是否已触发下载如果为true, 直接返回,防止重复下载
@Volatile
private var mDownloadRequested = false
/**
* 获取app升级信息
*/
fun getAppUpgradeInfo(context: Context?, mac: String, screenType: String) { // String sn = "X20202203105S688HZ";
fun getAppUpgradeInfo(context: Context?, mac: String, screenType: String) {
upgradeJob?.safeCancel()
scope.launch {
val sn = MoGoAiCloudClientConfig.getInstance().sn //null
val macAddress = mac //"48:b0:2d:4d:31:7f"
val type = screenType //"10"
SharedPrefsMgr.getInstance(context!!).putString(SharedPrefsConstants.HOST_ADDRESS, HostConst.getHost())
try {
val records = provider?.getUpgradeRecords()?.also {
MogoAnalyticUtils.track("AppUpgradeRecord", TreeMap<String, Any>().also { itx ->
@@ -59,7 +71,7 @@ class UpgradeAppNetWorkManager private constructor() {
Log.d(TAG, "getAppUpgradeInfo: -> records:" + records?.entries?.joinToString(",") { itx -> "key:${itx.key} -> value:[${itx.value.joinToString(",") { "${it.first},${it.second}" } }]"})
val versionCode = AppUtils.getAppVersionCode()
val versionName = AppUtils.getAppVersionName()
d(SceneConstant.M_BINDING + TAG, "getAppUpgradeInfo mac = $macAddress---type = $type---sn = $sn---versionCode =$versionCode---versionName =$versionName")
Log.d(SceneConstant.M_BINDING + TAG, "getAppUpgradeInfo mac = $macAddress---type = $type---sn = $sn---versionCode =$versionCode---versionName =$versionName")
val request = UpgradeAppRequest(sn, macAddress, type, versionName, "1")
val requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request))
provider?.recordUpgradeRecord(sn ?: "", macAddress, type, FunctionBuildConfig.isSupportPatchUpgrade)
@@ -80,13 +92,20 @@ class UpgradeAppNetWorkManager private constructor() {
provider?.recordUpgradeRequestFailed(t.message ?: "更新接口请求失败")
deleteApkFile()
}
delay(TimeUnit.HOURS.toMillis(1))
if (mDownloadRequested) {
mDownloadRequested = false
}
getAppUpgradeInfo(context, mac, screenType)
}.also {
upgradeJob = it
}
}
private suspend fun doUpgrade(info: UpgradeAppInfo) {
if (info.result != null) {
val versionCode = AppUtils.getAppVersionCode()
d(SceneConstant.M_BINDING + TAG, "UpgradeAppInfo url = " + info.result.appUrl + "----code = " + info.result.versionCode + "--versionCode =" + versionCode + "--info.result = " + info.result)
Log.d(SceneConstant.M_BINDING + TAG, "UpgradeAppInfo url = " + info.result.appUrl + "----code = " + info.result.versionCode + "--versionCode =" + versionCode + "--info.result = " + info.result)
if (info.result.versionCode > versionCode) {
val patchInfo = info.result.patchInfo
var downloadUrl: String = info.result.appUrl
@@ -122,14 +141,38 @@ class UpgradeAppNetWorkManager private constructor() {
Log.d("ApkInstaller", "走全量升级 --- 1 ----")
provider?.recordUpgradeRecord(info.result.versionName, null, 0)
}
withContext(Dispatchers.Main) {
showUpgradeDialog(downloadUrl.substring(downloadUrl.lastIndexOf("/") + 1), downloadUrl, info.result.installTitle, info.result.installContent, info.result.installType)
if (ApkInstaller.isInstallAppStore(Utils.getApp())) {
if (mDownloadRequested) {
return
}
mDownloadRequested = true
try {
withContext(Dispatchers.Main) {
Toast.makeText(Utils.getApp(), "检测到新版本[${info.result.versionName}]并且当前设备支持静默升级,开始下载新版本...", Toast.LENGTH_SHORT).show()
}
} catch (t: Throwable) {
t.printStackTrace()
}
Log.d("ApkInstaller", "EB5设备直接走静默不弹窗...")
CallerDevaToolsManager.downLoadPackage(if (isGoFullUpgrade) APK else PATCH, downloadUrl.substring(downloadUrl.lastIndexOf("/") + 1), downloadUrl)
} else {
var activity = AppStateManager.currentActivity()
while (activity == null) {
delay(2000)
activity = AppStateManager.currentActivity()
if (activity != null) {
break
}
}
activity?.lifeCycleScope?.launchWhenResumed {
showUpgradeDialog(downloadUrl.substring(downloadUrl.lastIndexOf("/") + 1), downloadUrl, info.result.installTitle, info.result.installContent, info.result.installType)
}
}
} else {
deleteApkFile()
}
} else {
d(SceneConstant.M_BINDING + TAG, "UpgradeAppInfo onNext info == null")
Log.d(SceneConstant.M_BINDING + TAG, "UpgradeAppInfo onNext info == null")
deleteApkFile()
}
}

View File

@@ -36,6 +36,7 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
private val operation: Int = 1
private val operationReturn: Int = 10
private val operationStop: Int = 11
private val operationDoorSwitchFail: Int = 13 //车门开启、关闭失败
private val notice: Int = 2
private val v2x: Int = 3
private val report: Int = 4
@@ -67,6 +68,11 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
.inflate(R.layout.item_msg_bubble_operation_stop, parent, false)
return BubbleOperationStopHolder(view)
}
operationDoorSwitchFail ->{
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.item_msg_bubble_operation_door, parent, false)
return BubbleOperationDoorFailHolder(view)
}
report -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_report,parent,false)
return BubbleReportHolder(view)
@@ -114,6 +120,16 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
val operationStopMsg = it[position].msgBoxBean.bean as OperationMsg
holder.tvOperationStopTime.text =
TimeUtils.millis2String(operationStopMsg.timestamp, getHourMinFormat())
holder.tvOperationStopContent.text = operationStopMsg.content
}
}
//车门开启关闭失败
is BubbleOperationDoorFailHolder -> {
data?.let{
val operationDoorMsg = it[position].msgBoxBean.bean as OperationMsg
holder.tvOperationDoorTime.text =
TimeUtils.millis2String(operationDoorMsg.timestamp, getHourMinFormat())
holder.tvOperationDoorContent.text = operationDoorMsg.content
}
}
is BubbleReportHolder -> {
@@ -221,7 +237,10 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
}else if((data!![position].msgBoxBean.bean as OperationMsg).type == 1){
//运营平台靠边停车
operationStop
}else{
}else if((data!![position].msgBoxBean.bean as OperationMsg).type == 3){
//车门开启关闭失败
operationDoorSwitchFail
} else{
//普通运营平台
operation
}
@@ -260,8 +279,13 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
//运营平台靠边停车通知
class BubbleOperationStopHolder(itemView: View): RecyclerView.ViewHolder(itemView){
var tvOperationStopTime: TextView = itemView.findViewById(R.id.tvOperationStopTime)
var tvOperationStopContent: TextView = itemView.findViewById(R.id.tvOperationStopContent)
}
//车门开启关闭失败
class BubbleOperationDoorFailHolder(itemView: View): RecyclerView.ViewHolder(itemView){
var tvOperationDoorTime: TextView = itemView.findViewById(R.id.tvOperationDoorTime)
var tvOperationDoorContent: TextView = itemView.findViewById(R.id.tvOperationDoorContent)
}
//Notice
class BubbleNoticeHolder(itemView: View): RecyclerView.ViewHolder(itemView){
var ivNoticeImage: ImageView = itemView.findViewById(R.id.ivNoticeImage)

View File

@@ -37,6 +37,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
private val operation: Int = 1
private val operationReturn: Int = 10
private val operationStop: Int = 11
private val operationDoorSwitchFail: Int = 13
private val notice: Int = 2
private val v2x: Int = 3
private val report: Int = 5
@@ -84,6 +85,11 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
.inflate(R.layout.item_msg_box_operation_stop, parent, false)
return MsgBoxOperationStop(view)
}
operationDoorSwitchFail -> {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.item_msg_box_operation_door, parent, false)
return MsgBoxOperationDoor(view)
}
notice -> {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.item_msg_box_notice, parent, false)
@@ -315,6 +321,16 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
val operationStopMsg = it[position].bean as OperationMsg
holder.tvOperationStopTime.text =
TimeUtils.millis2String(operationStopMsg.timestamp, getHourMinFormat())
holder.tvOperationStopContent.text = operationStopMsg.content
}
}
//运营平台开关门失败
is MsgBoxOperationDoor -> {
data?.let{
val operationDoorMsg = it[position].bean as OperationMsg
holder.tvOperationDoorTime.text =
TimeUtils.millis2String(operationDoorMsg.timestamp, getHourMinFormat())
holder.tvOperationDoorContent.text = operationDoorMsg.content
}
}
is MsgBoxNotice -> {
@@ -394,7 +410,10 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
}else if((data!![position].bean as OperationMsg).type == 1){
//运营平台靠边停车
operationStop
}else{
}else if((data!![position].bean as OperationMsg).type == 3){
//开关门失败
operationDoorSwitchFail
} else{
//普通运营平台
operation
}
@@ -457,8 +476,13 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
//运营平台靠边停车通知
class MsgBoxOperationStop(itemView: View) : RecyclerView.ViewHolder(itemView){
var tvOperationStopTime: TextView = itemView.findViewById(R.id.tvOperationStopTime)
var tvOperationStopContent: TextView = itemView.findViewById(R.id.tvOperationStopContent)
}
//运营平台开关门失败
class MsgBoxOperationDoor(itemView: View) : RecyclerView.ViewHolder(itemView){
var tvOperationDoorTime: TextView = itemView.findViewById(R.id.tvOperationDoorTime)
var tvOperationDoorContent: TextView = itemView.findViewById(R.id.tvOperationDoorContent)
}
//Notice
class MsgBoxNotice(itemView: View) : RecyclerView.ViewHolder(itemView) {
var ivNoticeImage: ImageView = itemView.findViewById(R.id.ivNoticeImage)

View File

@@ -65,7 +65,9 @@ import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.logcatch.ILogViewListener
import com.mogo.eagle.core.function.hmi.ui.logcatch.LogInfoView
import com.mogo.eagle.core.function.hmi.ui.map.OfflineMapDialog
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
import com.mogo.eagle.core.function.hmi.ui.widget.SystemVersionView
import com.mogo.eagle.core.utilcode.kotlin.*
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
@@ -76,6 +78,7 @@ import com.mogo.eagle.core.utilcode.mogo.permissions.BackgrounderPermission
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
import com.mogo.eagle.core.utilcode.util.*
import com.mogo.map.hdcache.IHdCacheListener
import com.mogo.map.uicontroller.VisualAngleMode
import com.mogo.map.uicontroller.VisualAngleMode.*
import kotlinx.android.synthetic.main.view_debug_setting.view.*
@@ -180,6 +183,9 @@ internal class DebugSettingView @JvmOverloads constructor(
private var isStarted = false
// 高精地图是否已缓存
private var isHDCached = false
init {
LayoutInflater.from(context).inflate(R.layout.view_debug_setting, this, true)
initView()
@@ -571,6 +577,32 @@ internal class DebugSettingView @JvmOverloads constructor(
}
}
btn_cache_hd_map?.onClick {
if (isHDCached) {
ToastUtils.showShort(resources.getString(R.string.offline_had_downloaded))
} else {
if (CallerMapUIServiceManager.getCityCode().isNullOrEmpty()) {// 未拿到高德的cityCode
if (mGnssInfo == null || (mGnssInfo!!.longitude <= 0.0 && mGnssInfo!!.latitude <= 0.0)) {// 未拿到高精的经纬度
ToastUtils.showShort(resources.getString(R.string.location_try_again))
} else {// 拿到了高精的经纬度
cacheHDOfflineData(false)
}
} else {// 拿到高德的cityCode
cacheHDOfflineData(true)
}
}
}
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
ThreadUtils.getIoPool().execute {
val isCached = CallerMapUIServiceManager.isCityDataCached()
isHDCached = isCached
UiThreadHandler.post {
btn_cache_hd_map.text = "缓存高精离线地图(${if (isCached) "已是最新版" else "待更新"}!)"
}
}
btn_cache_hd_map.visibility = View.VISIBLE
}
/**
* 修改自车按钮(出租车、小巴车)
@@ -2123,6 +2155,52 @@ internal class DebugSettingView @JvmOverloads constructor(
Process.killProcess(Process.myPid())
}
private fun cacheHDOfflineData(isGaoDe: Boolean) {
var progss = 0
if (isGaoDe) {// 拿到了高德地图的cityCode
CallerMapUIServiceManager.cacheHDDataByCity(object : IHdCacheListener {
override fun onMapHdCacheProgress(cityId: Int, progress: Double) {
// 更新进度
progss = progress.toInt()
if (progss == 100) {
isHDCached = true
btn_cache_hd_map.text = "缓存高精离线地图(已是最新版!)"
} else {
btn_cache_hd_map.text = "缓存高精离线地图(进度:${progss}%)"
}
}
override fun onMapHdCacheResult(cityId: Int, state: Int) {
if (state == 0) {// 失败
btn_cache_hd_map.text = "缓存高精离线地图(下载失败!)"
ToastUtils.showShort("下载失败,请重试!")
}
}
})
} else {// 只拿到了高精的经纬度
mGnssInfo?.let { loc ->
CallerMapUIServiceManager.cacheHDDataByCityByLonLat(object : IHdCacheListener {
override fun onMapHdCacheProgress(cityId: Int, progress: Double) {
progss = progress.toInt()
if (progss == 100) {
isHDCached = true
btn_cache_hd_map.text = "缓存高精离线地图(已是最新版!)"
} else {
btn_cache_hd_map.text = "缓存高精离线地图(进度:${progss}%)"
}
}
override fun onMapHdCacheResult(cityId: Int, state: Int) {
if (state == 0) {// 失败
btn_cache_hd_map.text = "缓存高精离线地图(下载失败!)"
ToastUtils.showShort("下载失败,请重试!")
}
}
}, loc)
}
}
}
override fun fwThreadClose() {
refreshTraceInfo()
}

View File

@@ -55,7 +55,6 @@ class TakeOverView @JvmOverloads constructor(
*/
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
autopilotStatus = autoPilotStatusInfo.state
Log.i(TAG,"onAutopilotStatusResponse autoPilotStatusInfo state="+autoPilotStatusInfo.state)
if(autoPilotStatusInfo.state == 7){
isParallel = true
}else if(autoPilotStatusInfo.state == 0 || autoPilotStatusInfo.state == 1){
@@ -70,7 +69,6 @@ class TakeOverView @JvmOverloads constructor(
super.onAutopilotGuardian(guardianInfo)
ThreadUtils.runOnUiThread {
guardianInfo?.let {
Log.i(TAG,"onAutopilotGuardian guardianInfo ="+it.code)
if (FunctionBuildConfig.isDemoMode) {
return@let
}

View File

@@ -203,7 +203,7 @@ class DriverMonitorView :
override fun onPlaRequesting() {
Logger.e("${SceneConstant.M_HMI}$TAG", "onPlaRequesting……")
isLived = false
isLived = true
refreshView(isLived)
}
}

View File

@@ -0,0 +1,104 @@
package com.mogo.eagle.core.function.hmi.ui.widget
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.appcompat.content.res.AppCompatResources
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.commons.module.status.MogoStatusManager
import com.mogo.eagle.core.function.api.map.roma.IMoGoRomaListener
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager.romaTrigger
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.ToastUtils
import kotlinx.android.synthetic.main.view_roma_bus_bg.view.ivRomaView
import kotlinx.android.synthetic.main.view_roma_bus_bg.view.ll_roma_bg
class RomaBusView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoRomaListener {
companion object{
private const val TAG = "RomaView"
}
@Volatile
private var romaMode = false
@Volatile
private var click = true
private val normalRes: Int
private val openRes: Int
init{
LayoutInflater.from(context).inflate(R.layout.view_roma_bus_bg, this, true)
val a = context.obtainStyledAttributes(
attrs,
R.styleable.RomaView,
defStyleAttr,
0
)
normalRes = a.getResourceId(
R.styleable.RomaView_roma_close_bg,
R.drawable.romabg_normal_select
)
openRes = a.getResourceId(
R.styleable.RomaView_roma_open_bg,
R.drawable.romabg_press_select_bg
)
a.recycle()
if(normalRes!=0){
ll_roma_bg.background = AppCompatResources.getDrawable(context, normalRes)
}
setOnClickListener {
if(!click){
return@setOnClickListener
}
if(!MogoStatusManager.getInstance().isSocketOnLine){
ToastUtils.showShort("长链状态异常,请检查链接后开启漫游")
return@setOnClickListener
}
click = false
romaMode = !romaMode
//司机屏不控制乘客屏漫游,独自漫游
romaTrigger(romaMode)
}
}
override fun romaStatus(status: Boolean) {
click = true
if (status) {
romaMode = true
if(openRes!=0){
ll_roma_bg.setBackgroundResource(openRes)
}else{
ll_roma_bg.setBackgroundResource(R.drawable.romabg_press_select_bg)
}
ivRomaView.setBackgroundResource(R.drawable.roma_press_select_bg)
} else {
romaMode = false
if(normalRes!=0){
ll_roma_bg.setBackgroundResource(normalRes)
}else{
ll_roma_bg.setBackgroundResource(R.drawable.roma_bg_selector)
}
ivRomaView.setBackgroundResource(R.drawable.romafront_select_bg)
}
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerMapRomaListener.addListener(TAG, this)
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerMapRomaListener.removeListener(TAG)
}
}

View File

@@ -4,10 +4,12 @@ import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.commons.module.status.MogoStatusManager
import com.mogo.eagle.core.function.api.map.roma.IMoGoRomaListener
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager.romaTrigger
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.ToastUtils
class RomaPassengerView @JvmOverloads constructor(
context: Context,
@@ -39,6 +41,10 @@ class RomaPassengerView @JvmOverloads constructor(
if(!click){
return@setOnClickListener
}
if(!MogoStatusManager.getInstance().isSocketOnLine){
ToastUtils.showShort("长链状态异常,请检查链接后开启漫游")
return@setOnClickListener
}
click = false
romaMode = !romaMode
romaTrigger(romaMode)

View File

@@ -5,13 +5,16 @@ import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.appcompat.content.res.AppCompatResources
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.commons.module.status.MogoStatusManager
import com.mogo.eagle.core.function.api.map.roma.IMoGoRomaListener
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager.romaTrigger
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener
import com.mogo.eagle.core.function.hmi.R
import kotlinx.android.synthetic.main.view_roma_bg.view.*
import com.mogo.eagle.core.utilcode.util.ToastUtils
import kotlinx.android.synthetic.main.view_roma_taxi_bg.view.ivRomaView
import kotlinx.android.synthetic.main.view_roma_taxi_bg.view.ll_roma_bg
class RomaView @JvmOverloads constructor(
class RomaTaxiView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
@@ -31,7 +34,7 @@ class RomaView @JvmOverloads constructor(
private val openRes: Int
init {
LayoutInflater.from(context).inflate(R.layout.view_roma_bg, this, true)
LayoutInflater.from(context).inflate(R.layout.view_roma_taxi_bg, this, true)
val a = context.obtainStyledAttributes(
attrs,
R.styleable.RomaView,
@@ -55,6 +58,10 @@ class RomaView @JvmOverloads constructor(
if(!click){
return@setOnClickListener
}
if(!MogoStatusManager.getInstance().isSocketOnLine){
ToastUtils.showShort("长链状态异常,请检查链接后开启漫游")
return@setOnClickListener
}
click = false
romaMode = !romaMode
//司机屏不控制乘客屏漫游,独自漫游

View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="804dp"
android:layout_height="160dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#53000000"
app:roundLayoutRadius="24dp"
android:layout_gravity="center_horizontal"
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
android:layout_marginTop="7dp"
android:layout_marginBottom="7dp">
<ImageView
android:id="@+id/ivOperationDoorImage"
android:layout_width="110dp"
android:layout_height="110dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginTop="25dp"
android:layout_marginBottom="25dp"
android:layout_marginStart="25dp"
android:src="@drawable/v2x_icon_shigu_sanjiaopai"
/>
<TextView
android:id="@+id/tvOperationDoorTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/ivOperationDoorImage"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginEnd="25dp"
android:textColor="#80FFFFFF"
android:textSize="24dp"
/>
<TextView
android:id="@+id/tvOperationDoorContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintLeft_toRightOf="@id/ivOperationDoorImage"
app:layout_constraintRight_toRightOf="@id/tvOperationDoorTime"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginStart="25dp"
android:textColor="#FFFFFFFF"
android:textSize="32dp"
android:maxLines="1"
android:ellipsize="end"
/>
</com.mogo.eagle.core.widget.RoundConstraintLayout>

View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="804dp"
android:layout_height="160dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#53000000"
app:roundLayoutRadius="24dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="7dp"
android:layout_marginBottom="7dp">
<ImageView
android:id="@+id/ivOperationDoorImage"
android:layout_width="110dp"
android:layout_height="110dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginTop="25dp"
android:layout_marginBottom="25dp"
android:layout_marginStart="25dp"
android:src="@drawable/v2x_icon_shigu_sanjiaopai"
/>
<TextView
android:id="@+id/tvOperationDoorTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/ivOperationDoorImage"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginEnd="25dp"
android:textColor="#80FFFFFF"
android:textSize="24dp"
/>
<TextView
android:id="@+id/tvOperationDoorContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintLeft_toRightOf="@id/ivOperationDoorImage"
app:layout_constraintRight_toRightOf="@id/tvOperationDoorTime"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginStart="25dp"
android:textColor="#FFFFFFFF"
android:textSize="32dp"
android:maxLines="1"
android:ellipsize="end"
/>
</com.mogo.eagle.core.widget.RoundConstraintLayout>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="804dp"
android:layout_height="160dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
@@ -49,4 +49,4 @@
android:text="靠边停车"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.mogo.eagle.core.widget.RoundConstraintLayout>

View File

@@ -1560,6 +1560,21 @@
app:layout_constraintRight_toRightOf="@id/changesight_cross_btn"
app:layout_constraintTop_toBottomOf="@id/changesight_cross_btn" />
<Button
android:id="@+id/btn_cache_hd_map"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:gravity="center"
android:text="缓存高精离线地图"
android:padding="@dimen/dp_20"
android:textSize="@dimen/dp_24"
app:layout_constraintLeft_toRightOf="@id/reset_changesight"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/changesight_far_btn"
android:visibility="gone"
/>
<ToggleButton
android:id="@+id/tbChangeCurrentCarIcon"
android:layout_width="0dp"

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/cl_roma_bg"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/ll_roma_bg"
android:layout_width="@dimen/dp_102"
android:layout_height="@dimen/dp_102"
android:layout_margin="40dp"
android:background="@drawable/roma_bg_selector"
android:elevation="@dimen/dp_10"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toRightOf="parent"
>
</LinearLayout>
<ImageView
android:id="@+id/ivRomaView"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:src="@drawable/romafront_select_bg"
android:elevation="@dimen/dp_10"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -80,13 +80,14 @@ class MapPointCloudSubscriber private constructor()
fun isDrawCloudPointDockerVersion(): Boolean {
// 由于Docker命名规则不统一但核心版本是统一但采用"."分割,如下
// MAP-taxi_RoboTaxi_Default_2.2.0_badcasetest_20220215_dev
// MAP_RoboBus_B1_3.3.0_lxw_20230526_old_dev
val dockerVersionName = AppConfigInfo.dockerVersion
// "." 分割,取前两位
val dockerVersionNameArray = dockerVersionName?.split(".")
var dockerVersionCode = ""
dockerVersionNameArray?.let {
if (it.size > 3) {
if (it.size >= 3) {
for (index in 0 until 3) {
dockerVersionCode +=
when (index) {
@@ -110,10 +111,10 @@ class MapPointCloudSubscriber private constructor()
0
}
if (dockerVersion >= 260) {
return true
if (dockerVersion <= 260) {
return false
}
return false
return true
}

View File

@@ -3,10 +3,15 @@ package com.mogo.eagle.core.function.business.identify
import android.os.Handler
import android.os.Message
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo
import com.mogo.eagle.core.function.call.obu.CallerObuWarningListenerManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isTaxi
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler
import com.mogo.eagle.core.utilcode.util.ParseVersionUtils
import com.zhjt.service.chain.ChainLog
import mogo.telematics.pad.MessagePad
import mogo.telematics.pad.MessagePad.TrackedObject
import mogo.yycp.api.proto.SocketDownData
@@ -31,15 +36,40 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener {
private var aiCloudIdentify: Identify? = null
init {
identify = if (FunctionBuildConfig.isBeautyMode) {
UserIdentify.beautifyDataDrawer
} else {
DriverIdentify.originDataDrawer
val dockerVersion = getAutoPilotStatusInfo().dockVersion
if (dockerVersion != null && dockerVersion.isNotEmpty()) {
try {
val version = ParseVersionUtils.parseVersion(true, dockerVersion)
identify = if (version >= 30100 && isTaxi(FunctionBuildConfig.appIdentityMode)) {
FunctionBuildConfig.isBeautyMode = false
drawType("关闭感知优化模式")
DriverIdentify.originDataDrawer
} else {
FunctionBuildConfig.isBeautyMode = true
drawType("开启感知优化模式")
UserIdentify.beautifyDataDrawer
}
} catch (e: Exception) {
drawType("解析docker异常:$dockerVersion")
identify = UserIdentify.beautifyDataDrawer
}
}
aiCloudIdentify = AiIdentify.aiCloudDataDrawer
CallerObuWarningListenerManager.addListener(TAG, this)
}
@ChainLog(
linkChainLog = ChainConstant.CHAIN_LINK_LOG_CONNECT_STATUS,
linkCode = ChainConstant.CHAIN_LINK_INIT,
endpoint = 4,
nodeAliasCode = ChainConstant.CHAIN_ALIAS_CODE_ADAS_MESSAGE_RECT_DATA,
paramIndexes = [0],
clientPkFileName = "sn"
)
private fun drawType(type: String) {
}
private const val MSG_DATA_TRACK = 0
private const val MSG_DATA_AI_TRACK = 1
private const val MSG_DATA_WARNING = 2
@@ -57,12 +87,14 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener {
// 非感知美化优化模式,清除旧数据,使用 DriverIdentify originDataDrawer 原始数据绘制
if (identify is IdentifyBeautifyDataDrawer) {
identify!!.clearOldMarker()
drawType("isBeautyMode 模式改变,关闭感知优化模式")
identify = DriverIdentify.originDataDrawer
}
} else {
// 感知优化模式,清除旧数据,使用 UserIdentify beautifyDataDrawer 优化数据
if (identify is IdentifyOriginDataDrawer) {
identify!!.clearOldMarker()
drawType("isBeautyMode 模式改变,开启感知优化模式")
identify = UserIdentify.beautifyDataDrawer
}
}

View File

@@ -131,6 +131,7 @@ class IdentifyOriginDataDrawer : Identify {
.removeMarker(uuid)
}
trafficDataUuidList.clear()
mMarkersCaches.clear()
WarningHelper.clear()
}

View File

@@ -1,21 +1,13 @@
package com.mogo.eagle.core.function.business.identify;
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_ALIAS_CODE_ADAS_MESSAGE_RECT_DATA;
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_ADAS;
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_DATA_TRACKED;
import static com.mogo.eagle.core.function.business.identify.TrackManager.LIMIT_SPEED;
import android.annotation.SuppressLint;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.enums.TrafficTypeEnum;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.utilcode.geometry.S2CellId;
import com.mogo.eagle.core.utilcode.geometry.S2LatLng;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.util.CoordinateUtils;
import com.mogo.eagle.core.utilcode.util.ParseVersionUtils;
import com.zhjt.service.chain.ChainLog;
import java.util.Arrays;
import java.util.Comparator;
@@ -53,28 +45,9 @@ public class TrackObj {
private void correct() {
calAverageSpeedAndType();
String dockerVersion = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getDockVersion();
if (dockerVersion != null && !dockerVersion.isEmpty()) {
try {
int version = ParseVersionUtils.parseVersion(true, dockerVersion);
if (version >= 310 && AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
return;
}
} catch (Exception e) {
logErrorOfVersion(dockerVersion);
}
}
calLoc();
}
@ChainLog(linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_DATA_TRACKED,
linkCode = CHAIN_LINK_ADAS,
nodeAliasCode = CHAIN_ALIAS_CODE_ADAS_MESSAGE_RECT_DATA,
paramIndexes = {0})
private void logErrorOfVersion(String version) {
}
@SuppressLint("NewApi")
private void calAverageSpeedAndType() {
if (circleQueue.size() >= 3) {

View File

@@ -113,7 +113,11 @@ object MarkerDrawerManager {
baseDiffDis = diff
// 距离最近的时候判断是否走过
if (DrivingDirectionUtils.getDegreeOfCar2Poi2(realLon, realLat, latLng.longitude, latLng.latitude, heading) >= 90) {
currentIndex = i
currentIndex = if (i < lastArrivedIndex) {
lastArrivedIndex
} else {
i
}
}
}
}

View File

@@ -102,8 +102,8 @@ enum class EventTypeEnumNew(
ROAD_SLIPPERY("10021"),
//鬼探头类型
GHOST_PROBE("10024", "前方盲区人预警", "前方盲区人预警", R.drawable.icon_warning_v2x_pedestrian_crossing,
"前方盲区人通行,请注意", "前方盲区即将有人通过,请减速慢行"),
GHOST_PROBE("10024", "前方盲区人预警", "前方盲区人预警", R.drawable.icon_warning_v2x_pedestrian_crossing,
"前方盲区人通行,请注意", "前方盲区即将有人通过,请减速慢行"),
//接管
TAKE_OVER_EVENT(
@@ -238,8 +238,8 @@ enum class EventTypeEnumNew(
1003.toString(),
"碰撞预警",
poiTypeSrcVr = R.drawable.icon_warning_v2x_pedestrian_crossing,
content = "前方",
tts = "前方"
content = "前方",
tts = "前方"
),
TYPE_ERROR_WEAKNESS(
1006.toString(),
@@ -337,10 +337,10 @@ enum class EventTypeEnumNew(
),
TYPE_ID_PEDESTRIAN(
10.toString(),
"",
"",
poiTypeSrcVr = R.drawable.icon_warning_v2x_pedestrian_crossing,
content = "前方%s米",
tts = "蘑菇路侧提醒您,前方%s米"
content = "前方%s米",
tts = "蘑菇路侧提醒您,前方%s米"
),
TYPE_ID_SLIPPERY_ROAD(
17.toString(),
@@ -463,10 +463,10 @@ enum class EventTypeEnumNew(
),
TYPE_ATTENTION_CONFLUENCE(
44.toString(),
"注意合",
"前方车辆汇",
poiTypeSrcVr = R.drawable.icon_warning_v2x_attention_confluence,
content = "前方%s米注意",
tts = "蘑菇路侧提醒您,前方%s米注意"
content = "前方%s米注意车辆汇",
tts = "蘑菇路侧提醒您,前方%s米注意车辆汇"
),
TYPE_PEDESTRIAN_CROSSING(
114.toString(),
@@ -901,7 +901,7 @@ enum class EventTypeEnumNew(
TYPE_ID_BRIDGE.poiType ->{
TYPE_ID_BRIDGE.poiTypeStr
}
//
//
TYPE_ID_PEDESTRIAN.poiType ->{
TYPE_ID_PEDESTRIAN.poiTypeStr
}

View File

@@ -130,8 +130,8 @@ class EventTypeHelper {
fun getVRURI(data: ((appId: Int, tts: String, content: String) -> Unit)) {
data.invoke(
EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType.toInt(),
"人逆行预警",
"人逆行预警"
"人逆行预警",
"人逆行预警"
)
}

View File

@@ -25,7 +25,11 @@ object CallerAutopilotCarConfigListenerManager : CallerBase<IMoGoAutopilotCarCon
mCarConfigResp = carConfigResp
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotCarConfig(carConfigResp)
try {
listener.onAutopilotCarConfig(carConfigResp)
} catch (t: Throwable) {
t.printStackTrace()
}
}
}

View File

@@ -6,10 +6,25 @@ import com.mogo.eagle.core.function.call.base.CallerBase
object CallerCloudListenerManager : CallerBase<IMoGoCloudListener>() {
@Volatile
private var token: String? = null
@Volatile
private var sn: String? = null
override fun doSomeAfterAddListener(tag: String, listener: IMoGoCloudListener) {
super.doSomeAfterAddListener(tag, listener)
if (!token.isNullOrEmpty() && !sn.isNullOrEmpty()) {
listener.tokenGot(token!!, sn!!)
}
}
/**
* 分发获取到的设备sn
*/
fun invokeCloudTokenGot(token: String, sn: String) {
this.token = token
this.sn = sn
M_LISTENERS.forEach {
val listener = it.value
listener.tokenGot(token, sn)

View File

@@ -1,21 +1,32 @@
package com.mogo.eagle.core.function.call.telematic
import android.util.Log
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
import com.mogo.eagle.core.function.call.base.CallerBase
object CallerTelematicListenerManager: CallerBase<IReceivedMsgListener>() {
private const val TAG = "CallerTelematicListenerManager"
fun invokeReceivedMsg(type: Int, byteArray: ByteArray) {
M_LISTENERS.forEach {
val listener = it.value
listener.onReceivedMsg(type, byteArray)
try {
listener.onReceivedMsg(type, byteArray)
} catch (e: Exception) {
Log.e(TAG, "转发消息出现异常:${e.message}")
}
}
}
fun dispatchServerSn(sn: String?) {
M_LISTENERS.forEach {
val listener = it.value
listener.onReceivedServerSn(sn)
try {
listener.onReceivedServerSn(sn)
} catch (e: Exception) {
Log.e(TAG, "转发司机屏SN出现异常${e.message}")
}
}
}
}

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.mogo.eagle.core.utilcode.util">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
@@ -38,6 +39,14 @@
<receiver android:name=".NetworkUtils$NetworkChangedReceiver" />
<receiver android:name=".FoTaSilentUpgradeReceiver"
android:exported="true"
tools:ignore="ExportedReceiver">
<intent-filter>
<action android:name="com.mogo.launcher.f.receiver.install_result" />
</intent-filter>
</receiver>
<activity android:name=".InstallApkSessionApi"
android:exported="true"
android:theme="@style/ActivityTranslucent"

Some files were not shown because too many files have changed in this diff Show More