Merge remote-tracking branch 'origin/dev_robotaxi-d_240912_6.7.0' into dev_robotaxi-d_240912_6.7.0
This commit is contained in:
@@ -38,24 +38,31 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
* 线路信息
|
||||
*/
|
||||
@JvmStatic
|
||||
var lineInfos: LineInfo? = null
|
||||
private var _lineInfos: LineInfo? = null
|
||||
|
||||
val lineInfos:LineInfo?
|
||||
@JvmStatic
|
||||
get() = _lineInfos
|
||||
|
||||
/**
|
||||
* 启动自驾信息
|
||||
*/
|
||||
@JvmStatic
|
||||
var contraiInfo: ContraiInfo? = null
|
||||
private set
|
||||
private var _contraiInfo: ContraiInfo? = null
|
||||
val contraiInfo:ContraiInfo?
|
||||
@JvmStatic
|
||||
get() = _contraiInfo
|
||||
|
||||
|
||||
/**
|
||||
* 起始站点
|
||||
*/
|
||||
var startStation: BusStationBean? = null
|
||||
private var startStation: BusStationBean? = null
|
||||
|
||||
/**
|
||||
* 结束站点
|
||||
*/
|
||||
var endStation: BusStationBean? = null
|
||||
private var endStation: BusStationBean? = null
|
||||
|
||||
var isReStartAutopilot = true
|
||||
|
||||
@@ -77,7 +84,7 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
}
|
||||
|
||||
fun setContraiInfo(contraiInfo: ContraiInfo?){
|
||||
this.contraiInfo = contraiInfo
|
||||
this._contraiInfo = contraiInfo
|
||||
setAutopilotControlParameters()
|
||||
}
|
||||
|
||||
@@ -87,9 +94,9 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
clearGlobalTrajectory(true)
|
||||
CallerOrderListenerManager.invokeOrderLineUpdate("")
|
||||
}
|
||||
this.lineInfos = lineInfo
|
||||
this._lineInfos = lineInfo
|
||||
setAutopilotControlParameters()
|
||||
this.lineInfos?.let { line ->
|
||||
this._lineInfos?.let { line ->
|
||||
if (ProjectUtils.isSaas()) {
|
||||
val sb = StringBuilder()
|
||||
sb.append(line.lineName)
|
||||
@@ -101,6 +108,10 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
}
|
||||
}
|
||||
|
||||
fun getStations(): Pair<BusStationBean?, BusStationBean?> {
|
||||
return Pair(startStation, endStation)
|
||||
}
|
||||
|
||||
fun getStations(function: (start: BusStationBean, end: BusStationBean) -> Unit) {
|
||||
startStation?.let { start ->
|
||||
endStation?.let { end ->
|
||||
@@ -111,25 +122,10 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
OchChainLogManager.writeChainLog("异常情况","startStation:${startStation}__endStation:${endStation}")
|
||||
}
|
||||
|
||||
fun getStationsWithContrai(function: (start: BusStationBean, end: BusStationBean, contrai: ContraiInfo) -> Unit) {
|
||||
startStation?.let { start ->
|
||||
endStation?.let { end ->
|
||||
contraiInfo?.let { contrai ->
|
||||
function.invoke(start, end, contrai)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
OchChainLogManager.writeChainLog(
|
||||
"异常情况",
|
||||
"startStation:${startStation}__endStation:${endStation}__contraiInfo:${contraiInfo}"
|
||||
)
|
||||
}
|
||||
|
||||
fun getStationsWithLine(function: (start: BusStationBean, end: BusStationBean, lineInfo: LineInfo) -> Unit) {
|
||||
startStation?.let { start ->
|
||||
endStation?.let { end ->
|
||||
lineInfos?.let { line ->
|
||||
_lineInfos?.let { line ->
|
||||
function.invoke(start, end, line)
|
||||
return
|
||||
}
|
||||
@@ -137,15 +133,15 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
}
|
||||
OchChainLogManager.writeChainLog(
|
||||
"异常情况",
|
||||
"startStation:${startStation}__endStation:${endStation}__lineInfos:${lineInfos}"
|
||||
"startStation:${startStation}__endStation:${endStation}__lineInfos:${_lineInfos}"
|
||||
)
|
||||
}
|
||||
|
||||
fun getStationsWithLineAndContrai(function: (start: BusStationBean, end: BusStationBean, lineInfo: LineInfo, contrai: ContraiInfo) -> Unit) {
|
||||
startStation?.let { start ->
|
||||
endStation?.let { end ->
|
||||
lineInfos?.let { line ->
|
||||
contraiInfo?.let { contrai ->
|
||||
_lineInfos?.let { line ->
|
||||
_contraiInfo?.let { contrai ->
|
||||
function.invoke(start, end, line, contrai)
|
||||
return
|
||||
}
|
||||
@@ -154,17 +150,26 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
}
|
||||
OchChainLogManager.writeChainLog(
|
||||
"异常情况",
|
||||
"startStation:${startStation}__endStation:${endStation}__lineInfos:${lineInfos}__contraiInfo:${contraiInfo}"
|
||||
"startStation:${startStation}__endStation:${endStation}__lineInfos:${_lineInfos}__contraiInfo:${_contraiInfo}"
|
||||
)
|
||||
}
|
||||
|
||||
fun getStartStation(function: (start: BusStationBean) -> Unit) {
|
||||
startStation?.let { start ->
|
||||
function.invoke(start)
|
||||
return
|
||||
}
|
||||
OchChainLogManager.writeChainLog("异常情况", "startStation:${startStation}")
|
||||
}
|
||||
|
||||
fun getLineInfo(function: (lineInfo: LineInfo) -> Unit){
|
||||
_lineInfos?.let { line->
|
||||
function.invoke(line)
|
||||
return
|
||||
}
|
||||
OchChainLogManager.writeChainLog("异常情况", "lineInfos:${_lineInfos}")
|
||||
}
|
||||
|
||||
|
||||
override fun doSomeAfterAddListener(tag: String, listener: ILineCallback) {
|
||||
super.doSomeAfterAddListener(tag, listener)
|
||||
@@ -213,7 +218,7 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
}
|
||||
|
||||
fun drawGlobalTrajectory(): Pair<Boolean, String> {
|
||||
if (lineInfos == null) {
|
||||
if (_lineInfos == null) {
|
||||
return Pair(false, "请设置正确线路或订单")
|
||||
}
|
||||
return CallerMapGlobalTrajectoryDrawManager.drawGlobalTrajectory().apply {
|
||||
@@ -278,20 +283,19 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
OchAutopilotAnalytics.triggerClickStartAutopilotTime(System.currentTimeMillis())
|
||||
|
||||
//1、判断轨迹url是否可用
|
||||
if(contraiInfo==null){
|
||||
if(_contraiInfo==null){
|
||||
ToastUtils.showLong("无发布轨迹, 请发布后重试")
|
||||
return
|
||||
}else{
|
||||
|
||||
if (FunctionBuildConfig.isPassStartAutopilotCommand
|
||||
&& TextUtils.isEmpty(contraiInfo!!.csvFileUrl)
|
||||
&& TextUtils.isEmpty(contraiInfo!!.csvFileMd5)
|
||||
&& TextUtils.isEmpty(_contraiInfo!!.csvFileUrl)
|
||||
&& TextUtils.isEmpty(_contraiInfo!!.csvFileMd5)
|
||||
) {
|
||||
ToastUtils.showLong("无发布轨迹, 请发布后重试")
|
||||
e(
|
||||
TAG, "isPassStartAutopilotCommand = " +
|
||||
FunctionBuildConfig.isPassStartAutopilotCommand
|
||||
+ "busRoutesResult.csvFileUrl = " + LineManager.contraiInfo!!.csvFileUrl
|
||||
+ "busRoutesResult.csvFileUrl = " + LineManager._contraiInfo!!.csvFileUrl
|
||||
)
|
||||
return
|
||||
}
|
||||
@@ -303,7 +307,7 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
}
|
||||
|
||||
// 3、距离轨迹15m计算
|
||||
val resion = OchAutoPilotManager.canStartAutoPilotByDistance(contraiInfo!!.lineId)
|
||||
val resion = OchAutoPilotManager.canStartAutoPilotByDistance(_contraiInfo!!.lineId)
|
||||
if (!StringUtils.isEmpty(resion)) {
|
||||
ToastUtils.showShort(resion)
|
||||
VoiceNotice.showNotice(resion)
|
||||
@@ -348,13 +352,13 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
}
|
||||
|
||||
fun triggerStartServiceEvent(send: Boolean,source:Int) {
|
||||
getStations { start, end ->
|
||||
getStationsWithLine { start, end, lineInfo ->
|
||||
OchAutopilotAnalytics.triggerStartAutopilotEvent(
|
||||
isReStartAutopilot,
|
||||
send,
|
||||
start.name,
|
||||
end.name,
|
||||
lineInfos!!.lineId.toInt(),
|
||||
lineInfo.lineId.toInt(),
|
||||
"",
|
||||
System.currentTimeMillis(),
|
||||
source
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.mogo.och.weaknet.callback;
|
||||
|
||||
import com.mogo.och.data.bean.BusStationBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created on 2021/9/8
|
||||
* <p>
|
||||
* Model->Presenter回调:ADAS相关(自动驾驶状态回调,到达终点等等)
|
||||
*/
|
||||
public interface IBusADASStatusCallback {
|
||||
//自驾返回失败
|
||||
void onStartAdasFailure();
|
||||
|
||||
void startOpenAutopilot();
|
||||
|
||||
void updateBusTaskStatus(String lineName, String lintTime,
|
||||
List<BusStationBean> stationList,
|
||||
int arrivingOrArrivedIndex,
|
||||
boolean isArrived);
|
||||
|
||||
|
||||
/**
|
||||
* 结束清理一遍、选择任务后清理一遍
|
||||
*/
|
||||
void clearBusStationsMarkers();
|
||||
}
|
||||
@@ -417,14 +417,14 @@ object LineModel {
|
||||
}
|
||||
OchChainLogManager.writeChainLogDb("滑动出发", "task:${currentTask}__taskId:${currentTask?.taskId}")
|
||||
// 设置滑动出发任务
|
||||
LineManager.lineInfos?.lineName?.let { lineName->
|
||||
LineManager.getLineInfo { lineInfo ->
|
||||
EventRepository.saveEventTaskLeaveSite(
|
||||
task.taskId!!,
|
||||
task.lineId!!,
|
||||
it.siteId.toLong(),
|
||||
it.seq,
|
||||
task.taskStartTime,
|
||||
lineName
|
||||
lineInfo.lineName
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -439,8 +439,9 @@ object LineModel {
|
||||
)
|
||||
}
|
||||
}
|
||||
val (startStation, endStation) = LineManager.getStations()
|
||||
val changeInfo =
|
||||
"taskId:${currentTask?.taskId}--lineId:${currentTask?.lineId}--currentStationName:${LineManager.startStation?.name}--finalNextStationName:${LineManager.endStation?.name}"
|
||||
"taskId:${currentTask?.taskId}--lineId:${currentTask?.lineId}--currentStationName:${startStation?.name}--finalNextStationName:${endStation?.name}"
|
||||
OchChainLogManager.writeChainLog("滑动出发", changeInfo)
|
||||
}
|
||||
// 到站
|
||||
@@ -454,7 +455,7 @@ object LineModel {
|
||||
if (task.taskId!=null&&task.lineId!=null) {
|
||||
TaskSiteRepository.updateDrivingStatusAndLeave(task.taskId!!,start.siteId.toLong(),TaskSiteDataBean.drivingStatusPassed,false)
|
||||
// 设置到站任务
|
||||
LineManager.lineInfos?.let {lineInfo ->
|
||||
LineManager.getLineInfo { lineInfo ->
|
||||
EventRepository.saveEventTaskArriveSite(task.taskId!!,task.lineId!!,start.siteId.toLong(),start.seq,task.taskStartTime,lineInfo.lineName)
|
||||
}
|
||||
}
|
||||
@@ -481,7 +482,8 @@ object LineModel {
|
||||
mBusLinesCallbackMap.forEach {callback->
|
||||
callback.value.onArriveStationSuccess()
|
||||
}
|
||||
val startStation = LineManager.endStation
|
||||
|
||||
val startStation = LineManager.getStations().second
|
||||
if(startStationIndex+1< it.size){
|
||||
val endStation = it[startStationIndex+1]
|
||||
LineManager.setStartAndEndStation(startStation,endStation)
|
||||
@@ -509,8 +511,8 @@ object LineModel {
|
||||
currentTask?.let {task->
|
||||
if (task.taskId!=null&&task.lineId!=null) {
|
||||
TaskRepository.endTask(task.taskId!!)
|
||||
LineManager.lineInfos?.lineName?.let {lineName->
|
||||
EventRepository.saveEventTaskEnd(task.taskId!!,task.lineId!!,task.taskStartTime,lineName)
|
||||
LineManager.getLineInfo { lineInfo ->
|
||||
EventRepository.saveEventTaskEnd(task.taskId!!,task.lineId!!,task.taskStartTime,lineInfo.lineName)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -518,7 +520,7 @@ object LineModel {
|
||||
OchChainLogManager.writeChainLog("结束任务", changeInfo)
|
||||
|
||||
currentTask = null
|
||||
LineManager.lineInfos = null
|
||||
LineManager.setLineInfo(null)
|
||||
LineManager.setStartAndEndStation(null,null)
|
||||
stationList = mutableListOf()
|
||||
startStationIndex = 0
|
||||
@@ -537,17 +539,16 @@ object LineModel {
|
||||
fun setDemoMode() {
|
||||
// 美化是否开始
|
||||
if (FunctionBuildConfig.isDemoMode) { //行驶过程中设置美化
|
||||
if (LineManager.startStation!=null&&LineManager.startStation!!.isLeaving) {
|
||||
val (startStation, _) = LineManager.getStations()
|
||||
if (startStation!=null&&startStation.isLeaving) {
|
||||
OrderModel.startBeautificationMode()
|
||||
d(M_BUS + TAG, "美化模式-ignore:置为true(每次滑动出发)")
|
||||
} else if (startStationIndex > 0 && startStationIndex < stationList!!.size - 1) {
|
||||
//美化模式下 中间站点到站 引导线要一直绘制,所以此处不出强制绘制不传false
|
||||
CallerAutoPilotControlManager.setIPCDemoMode(false)
|
||||
d(M_BUS + TAG, "美化模式-ignore:false(到达中间站)")
|
||||
OrderModel.clearStartAutopilotTag()
|
||||
} else {
|
||||
OrderModel.closeBeautificationMode()
|
||||
OrderModel.clearStartAutopilotTag()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@ package com.mogo.och.weaknet.model
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.text.TextUtils
|
||||
import com.elegant.network.utils.GsonUtil
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
@@ -15,39 +13,22 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
|
||||
import com.mogo.eagle.core.utilcode.util.StringUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusManager
|
||||
import com.mogo.och.common.module.callback.OchAdasStartFailureCallback
|
||||
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.bean.ArrivedStation
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager.canStartAutoPilotByDistance
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager.canStartAutoPilotSSM
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager.startAutoPilot
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutopilotAnalytics
|
||||
import com.mogo.och.common.module.manager.autopilot.line.LineManager
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.manager.socket.cloud.AbnormalFactorsLoopManager
|
||||
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager
|
||||
import com.mogo.och.common.module.manager.socket.cloud.action.OperateAction
|
||||
import com.mogo.och.common.module.manager.socket.lan.ILanMessageListener
|
||||
import com.mogo.och.common.module.manager.socket.lan.LanSocketManager
|
||||
import com.mogo.och.common.module.manager.socket.lan.LedScreenManager
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.DPMsgType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.TaskDetailsMsg
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil
|
||||
import com.mogo.och.common.module.utils.OCHThreadPoolManager
|
||||
import com.mogo.och.common.module.utils.ResourcesUtils
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import com.mogo.och.common.module.voice.VoiceNotice.showNotice
|
||||
import com.mogo.och.shuttle.weaknet.R
|
||||
import com.mogo.och.weaknet.callback.IBusADASStatusCallback
|
||||
import com.mogo.och.weaknet.constant.BusConst
|
||||
import com.mogo.och.weaknet.util.BusTrajectoryManager
|
||||
import com.mogo.och.weaknet.util.ShuttleVoiceManager
|
||||
@@ -65,7 +46,6 @@ object OrderModel {
|
||||
|
||||
private var mContext: Context? = null
|
||||
|
||||
private var mADASStatusCallback: IBusADASStatusCallback? = null
|
||||
/**
|
||||
* 用来表示是否正在开往下一站
|
||||
*/
|
||||
@@ -75,40 +55,18 @@ object OrderModel {
|
||||
@Volatile
|
||||
private var isArrivedStation = false
|
||||
|
||||
//0: 代表没有启动过 1代表是启动第一次,当>=1 代表是重试 每次到站/路线结束清空置为0
|
||||
@Volatile
|
||||
private var firstStartAutopilot = 0
|
||||
|
||||
private const val VEHICLE_TYPE: Int = 10
|
||||
|
||||
@JvmStatic
|
||||
fun init() {
|
||||
mContext = AbsMogoApplication.getApp()
|
||||
|
||||
ThirdDeviceData.init()
|
||||
|
||||
// 加载核销模块
|
||||
TicketModel.load()
|
||||
|
||||
// 定位监听
|
||||
OchLocationManager.addGCJ02Listener(TAG, 5, mMapLocationListener)
|
||||
|
||||
//开启自驾后 异常信息返回
|
||||
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(mAdasStartFailureListener)
|
||||
|
||||
//监听运营消息
|
||||
OCHSocketMessageManager.registerSocketMessageListener(
|
||||
OCHSocketMessageManager.msgMonitorType,
|
||||
OperateAction(true)
|
||||
)
|
||||
|
||||
// 长链接监听
|
||||
AbnormalFactorsLoopManager.startLoopAbnormalFactors(AbsMogoApplication.getApp())
|
||||
|
||||
//监听乘客屏发来的消息
|
||||
LanSocketManager.registerSocketMessageListener(
|
||||
DPMsgType.TYPE_TASK_DETAILS.type,
|
||||
taskDetailsMsgListener
|
||||
)
|
||||
|
||||
RxUtils.errCatch()
|
||||
}
|
||||
|
||||
@@ -116,43 +74,14 @@ object OrderModel {
|
||||
fun release() {
|
||||
// 注销定位监听
|
||||
|
||||
ThirdDeviceData.release()
|
||||
|
||||
TicketModel.release()
|
||||
|
||||
OchLocationManager.removeGCJ02Listener(TAG)
|
||||
|
||||
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(null)
|
||||
|
||||
OCHSocketMessageManager.releaseSocketMessageListener(OCHSocketMessageManager.msgMonitorType)
|
||||
|
||||
AbnormalFactorsLoopManager.stopLoopAbnormalFactors()
|
||||
//监听乘客屏发来的消息
|
||||
LanSocketManager.unRegisterSocketMessageListener(
|
||||
DPMsgType.TYPE_TASK_DETAILS.type,
|
||||
taskDetailsMsgListener
|
||||
)
|
||||
}
|
||||
|
||||
// 乘客屏请求线路信息
|
||||
private val taskDetailsMsgListener = object : ILanMessageListener<TaskDetailsMsg> {
|
||||
override fun targetLan(): Class<TaskDetailsMsg> = TaskDetailsMsg::class.java
|
||||
override fun onLanMsgReceived(taskDetailsMsg: TaskDetailsMsg?) = ThirdDeviceData.sendTaskDetailsToClients()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun setAdasStatusCallback(callback: IBusADASStatusCallback?) {
|
||||
this.mADASStatusCallback = callback
|
||||
}
|
||||
|
||||
private val mAdasStartFailureListener: OchAdasStartFailureCallback =
|
||||
object : OchAdasStartFailureCallback {
|
||||
|
||||
override fun onStartAutopilotFailure(startFailedCode: String, startFailedMessage: String) {
|
||||
if (!FunctionBuildConfig.isDemoMode) {
|
||||
e(M_BUS + TAG, "mAdasStartFailureListener = $startFailedMessage")
|
||||
mADASStatusCallback?.onStartAdasFailure()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 自车定位
|
||||
private val mMapLocationListener = object : IMoGoChassisLocationGCJ02Listener {
|
||||
@@ -170,20 +99,15 @@ object OrderModel {
|
||||
|
||||
//根据围栏判断,是否到达站点
|
||||
private fun judgeArrivedStation(location: MogoLocation) {
|
||||
if (LineManager.endStation==null) {
|
||||
e(M_BUS + TAG, "未设置终点坐标")
|
||||
OchChainLogManager.writeChainLog("shuttle弱网","围栏距离判断 未设置终点坐标")
|
||||
return
|
||||
}
|
||||
LineManager.endStation?.let {
|
||||
val startLon = it.gcjLon
|
||||
val startLat = it.gcjLat
|
||||
LineManager.getStations { start, end ->
|
||||
val startLon = end.gcjLon
|
||||
val startLat = end.gcjLat
|
||||
val distance = CoordinateUtils.calculateLineDistance(
|
||||
startLon, startLat,
|
||||
location.longitude, location.latitude
|
||||
)
|
||||
if (distance <= BusConst.ARRIVE_AT_END_STATION_DISTANCE) {
|
||||
d(M_BUS + TAG, "行程日志-judgeArrivedStation() distance = $distance to ${it.name}")
|
||||
d(M_BUS + TAG, "行程日志-judgeArrivedStation() distance = $distance to ${end.name}")
|
||||
onArriveAt(null, "兜底:根据定位计算到站")
|
||||
}
|
||||
}
|
||||
@@ -202,7 +126,6 @@ object OrderModel {
|
||||
LineManager.setLineInfo(null)
|
||||
updateBusStatus()
|
||||
closeBeautificationMode()
|
||||
clearStartAutopilotTag()
|
||||
removeTipRunnables()
|
||||
}else{
|
||||
updateBusStatus()
|
||||
@@ -210,65 +133,11 @@ object OrderModel {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新正在运行的任务UI
|
||||
*/
|
||||
private fun updateBusTaskStatus() {
|
||||
var arrivingOrArrivedStationIndex = 0 //已经到站或者即将到站的索引呢
|
||||
if(LineModel.stationList.isNullOrEmpty()){
|
||||
OchChainLogManager.writeChainLog("更新UI出错","${LineModel.currentTask}")
|
||||
return
|
||||
}
|
||||
LineModel.stationList?.let {
|
||||
for (i in it.indices) {
|
||||
val station = it[i]
|
||||
|
||||
if (i == 0) { // 首发站 显示在最上面
|
||||
if (station.drivingStatus == BusConst.STATION_STATUS_STOPPED
|
||||
&& !station.isLeaving
|
||||
) { //到达第一站
|
||||
arrivingOrArrivedStationIndex = 0
|
||||
break
|
||||
}
|
||||
} else {
|
||||
val preStation = it[i - 1]
|
||||
if ((station.drivingStatus == BusConst.STATION_STATUS_STOPPED && !station.isLeaving)
|
||||
|| (station.drivingStatus == BusConst.STATION_STATUS_ARRIVING
|
||||
&& preStation.isLeaving)
|
||||
) {
|
||||
//到站未离开 | 即将到站 显示在最中间
|
||||
arrivingOrArrivedStationIndex = i
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
val arrivingOrArrivedStation = it[arrivingOrArrivedStationIndex]
|
||||
val lineTime = LineModel.getTaskTime()
|
||||
LineManager.lineInfos?.let {lineInfo->
|
||||
if (arrivingOrArrivedStationIndex == 0 || (
|
||||
arrivingOrArrivedStation.drivingStatus == BusConst.STATION_STATUS_STOPPED
|
||||
&& !arrivingOrArrivedStation.isLeaving)
|
||||
) {
|
||||
mADASStatusCallback?.updateBusTaskStatus(
|
||||
lineInfo.lineName, lineTime,
|
||||
it, arrivingOrArrivedStationIndex, true
|
||||
)
|
||||
} else {
|
||||
mADASStatusCallback?.updateBusTaskStatus(
|
||||
lineInfo.lineName, lineTime,
|
||||
it, arrivingOrArrivedStationIndex, false
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置路线站点状态--结束路线,当前路线恢复到始发站
|
||||
*/
|
||||
@JvmStatic
|
||||
fun abortTask() {
|
||||
fun completeTask() {
|
||||
OCHThreadPoolManager.getsInstance().execute {
|
||||
d(M_BUS + TAG, "结束当前路线abortTask")
|
||||
|
||||
@@ -277,7 +146,6 @@ object OrderModel {
|
||||
ThirdDeviceData.endTask()
|
||||
LineModel.endTask()
|
||||
ThirdDeviceData.sendTaskDetailsToClients()
|
||||
mADASStatusCallback?.clearBusStationsMarkers()
|
||||
removeTipRunnables()
|
||||
ShuttleVoiceManager.endOrderBus()
|
||||
// 取消自驾
|
||||
@@ -291,8 +159,6 @@ object OrderModel {
|
||||
if (CallerAutoPilotStatusListenerManager.getState() == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
|
||||
) {
|
||||
LineManager.startAutopilot()
|
||||
} else {
|
||||
firstStartAutopilot = 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,17 +184,13 @@ object OrderModel {
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启自动驾驶到下一站
|
||||
* 滑动出发
|
||||
*/
|
||||
@JvmStatic
|
||||
fun autoDriveToNextStation() {
|
||||
fun driveToNextStation() {
|
||||
if (LineModel.isLastStation()==true) {
|
||||
// 当前站是最后一站,结束当前行程
|
||||
abortTask()
|
||||
return
|
||||
}
|
||||
if (LineManager.endStation==null) {
|
||||
OchChainLogManager.writeChainLog("滑动出发", "未设置终点坐标")
|
||||
completeTask()
|
||||
return
|
||||
}
|
||||
isArrivedStation = false
|
||||
@@ -370,9 +232,6 @@ object OrderModel {
|
||||
|
||||
ThirdDeviceData.sendTaskDetailsToClients()
|
||||
|
||||
//更新bus路线面板
|
||||
updateBusTaskStatus()
|
||||
|
||||
//需放在currentStationIndex赋值之后
|
||||
BusTrajectoryManager.getInstance().syncTrajectoryInfo()
|
||||
}
|
||||
@@ -430,14 +289,6 @@ object OrderModel {
|
||||
UiThreadHandler.removeCallbacks(tip1Runnable)
|
||||
}
|
||||
|
||||
fun clearStartAutopilotTag() {
|
||||
firstStartAutopilot = 0
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
val isRestartAutopilot: Boolean
|
||||
get() = firstStartAutopilot > 1
|
||||
|
||||
/**
|
||||
* 到站
|
||||
*
|
||||
@@ -445,7 +296,7 @@ object OrderModel {
|
||||
*/
|
||||
@JvmStatic
|
||||
fun onArriveAt(data: ArrivedStation?, type: String) {
|
||||
if (LineManager.endStation==null) {
|
||||
if (LineManager.getStations().second==null) {
|
||||
e(M_BUS + TAG, "行程日志-到站异常,取消后续操作结束")
|
||||
OchChainLogManager.writeChainLog("shuttle弱网","$type 行程日志-到站异常,取消后续操作结束")
|
||||
return
|
||||
@@ -453,29 +304,32 @@ object OrderModel {
|
||||
|
||||
//MAP 280 每隔100ms左右返回一次到站, 导致在到达中间站后再次滑动出发后会有时间差,收到一次到站,出现问题
|
||||
//此处比对 自驾告诉的到站站点坐标和本地应到站站点坐标, 一致时才能到站
|
||||
if (data != null && data.endLocation != null) {
|
||||
val latitude = NumberFormatUtil.cutOutNumber(data.endLocation.latitude, 5) //wgs
|
||||
val longitude = NumberFormatUtil.cutOutNumber(data.endLocation.longitude, 5)
|
||||
LineManager.getStations { start, end ->
|
||||
if (data != null && data.endLocation != null) {
|
||||
val latitude = NumberFormatUtil.cutOutNumber(data.endLocation.latitude, 5) //wgs
|
||||
val longitude = NumberFormatUtil.cutOutNumber(data.endLocation.longitude, 5)
|
||||
|
||||
val arriveLat = NumberFormatUtil.cutOutNumber(LineManager.endStation!!.lat, 5)
|
||||
val arriveLon = NumberFormatUtil.cutOutNumber(LineManager.endStation!!.lon, 5)
|
||||
val arriveLat = NumberFormatUtil.cutOutNumber(end.lat, 5)
|
||||
val arriveLon = NumberFormatUtil.cutOutNumber(end.lon, 5)
|
||||
|
||||
if (latitude != arriveLat || longitude != arriveLon) {
|
||||
e(M_BUS + TAG, "行程日志-到站拦截,到站坐标不一致")
|
||||
OchChainLogManager.writeChainLog("shuttle弱网","$type 行程日志-到站拦截,到站坐标不一致")
|
||||
return
|
||||
if (latitude != arriveLat || longitude != arriveLon) {
|
||||
e(M_BUS + TAG, "行程日志-到站拦截,到站坐标不一致")
|
||||
OchChainLogManager.writeChainLog("shuttle弱网","$type 行程日志-到站拦截,到站坐标不一致")
|
||||
return@getStations
|
||||
}
|
||||
}
|
||||
|
||||
if (isArrivedStation) return@getStations
|
||||
|
||||
OchChainLogManager.writeChainLog("触发进站", type)
|
||||
isArrivedStation = true
|
||||
isGoingToNextStation = false
|
||||
|
||||
ThirdDeviceData.arriveStation()
|
||||
LineModel.arrivedStation()
|
||||
updateBusStatus()
|
||||
}
|
||||
|
||||
if (isArrivedStation) return
|
||||
|
||||
OchChainLogManager.writeChainLog("触发进站", type)
|
||||
isArrivedStation = true
|
||||
isGoingToNextStation = false
|
||||
|
||||
ThirdDeviceData.arriveStation()
|
||||
LineModel.arrivedStation()
|
||||
updateBusStatus()
|
||||
}
|
||||
|
||||
// 登出
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
package com.mogo.och.weaknet.model
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusManager
|
||||
import com.mogo.och.common.module.manager.autopilot.line.LineManager
|
||||
import com.mogo.och.common.module.manager.socket.cloud.AbnormalFactorsLoopManager
|
||||
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager
|
||||
import com.mogo.och.common.module.manager.socket.cloud.action.OperateAction
|
||||
import com.mogo.och.common.module.manager.socket.lan.ILanMessageListener
|
||||
import com.mogo.och.common.module.manager.socket.lan.LanSocketManager
|
||||
import com.mogo.och.common.module.manager.socket.lan.LedScreenManager
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.BusinessType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.DPMsgType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.TaskDetailsMsg
|
||||
import com.mogo.och.data.bean.BusRoutesResult
|
||||
import com.mogo.och.data.bean.BusTransferData
|
||||
@@ -22,41 +28,79 @@ object ThirdDeviceData {
|
||||
@JvmStatic
|
||||
val busRoutesResult: BusRoutesResult = BusRoutesResult()
|
||||
|
||||
fun leaveStation(){
|
||||
LineManager.getStations { start, end ->
|
||||
fun init() {
|
||||
//监听运营消息
|
||||
OCHSocketMessageManager.registerSocketMessageListener(
|
||||
OCHSocketMessageManager.msgMonitorType,
|
||||
OperateAction(true)
|
||||
)
|
||||
// 长链接监听
|
||||
AbnormalFactorsLoopManager.startLoopAbnormalFactors(AbsMogoApplication.getApp())
|
||||
|
||||
//监听乘客屏发来的消息
|
||||
LanSocketManager.registerSocketMessageListener(
|
||||
DPMsgType.TYPE_TASK_DETAILS.type,
|
||||
taskDetailsMsgListener
|
||||
)
|
||||
}
|
||||
|
||||
fun release() {
|
||||
|
||||
OCHSocketMessageManager.releaseSocketMessageListener(OCHSocketMessageManager.msgMonitorType)
|
||||
|
||||
AbnormalFactorsLoopManager.stopLoopAbnormalFactors()
|
||||
|
||||
//监听乘客屏发来的消息
|
||||
LanSocketManager.unRegisterSocketMessageListener(
|
||||
DPMsgType.TYPE_TASK_DETAILS.type,
|
||||
taskDetailsMsgListener
|
||||
)
|
||||
}
|
||||
|
||||
// 乘客屏请求线路信息
|
||||
private val taskDetailsMsgListener = object : ILanMessageListener<TaskDetailsMsg> {
|
||||
override fun targetLan(): Class<TaskDetailsMsg> = TaskDetailsMsg::class.java
|
||||
override fun onLanMsgReceived(taskDetailsMsg: TaskDetailsMsg?) = sendTaskDetailsToClients()
|
||||
}
|
||||
|
||||
// 离站
|
||||
fun leaveStation() {
|
||||
LineManager.getStationsWithLine { start, end, lineInfo ->
|
||||
UiThreadHandler.postDelayed({ //延迟10s播报
|
||||
ShuttleVoiceManager.leaveStationBus(end.name, end.nameKr)
|
||||
}, BusConst.DELAY_10S)
|
||||
//给bus外屏发送
|
||||
LedScreenManager.sendTripInfo2Led(
|
||||
LedScreenManager.LEAVE_STATION,
|
||||
LineManager.lineInfos!!.lineName,
|
||||
lineInfo.lineName,
|
||||
start.name,
|
||||
end.name,
|
||||
LineModel.isLastStation()==true
|
||||
LineModel.isLastStation() == true
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun arriveStation(){
|
||||
LineManager.getStations { start, end ->
|
||||
//到站
|
||||
fun arriveStation() {
|
||||
LineManager.getStationsWithLine { start, end, lineInfo ->
|
||||
ShuttleVoiceManager.arrivedStationBus(end.name, end.nameKr)
|
||||
//给bus外屏发送
|
||||
LedScreenManager.sendTripInfo2Led(
|
||||
LedScreenManager.ARRIVE_STATION,
|
||||
LineManager.lineInfos!!.lineName,
|
||||
lineInfo.lineName,
|
||||
start.name,
|
||||
end.name,
|
||||
LineModel.isLastStation()==true
|
||||
LineModel.isLastStation() == true
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun endTask(){
|
||||
LineManager.lineInfos?.let {
|
||||
//结束任务
|
||||
fun endTask() {
|
||||
LineManager.getLineInfo {lineInfo ->
|
||||
LedScreenManager.sendTripInfo2Led(
|
||||
LedScreenManager.END_TRIP,
|
||||
it.lineName,
|
||||
lineInfo.lineName,
|
||||
"",
|
||||
"",
|
||||
false
|
||||
@@ -65,21 +109,23 @@ object ThirdDeviceData {
|
||||
}
|
||||
|
||||
fun sendTaskDetailsToClients() {
|
||||
if (LineManager.lineInfos==null|| LineModel.currentTask ==null|| LineModel.stationList.isNullOrEmpty()) {
|
||||
if (LineManager.lineInfos == null || LineModel.currentTask == null || LineModel.stationList.isNullOrEmpty()) {
|
||||
val data = BusTransferData(if (LoginStatusManager.isLogin()) 1 else 0, null)
|
||||
val msg = TaskDetailsMsg(GsonUtils.toJson(data), BusinessType.shuttle)
|
||||
d(M_BUS + TAG, "sendTaskDetailsToClients = " + GsonUtils.toJson(msg))
|
||||
LanSocketManager.sendMsgToClient(msg)
|
||||
}else{
|
||||
busRoutesResult.setSite(LineModel.stationList)
|
||||
busRoutesResult.lineId = LineManager.lineInfos!!.lineId.toInt()
|
||||
busRoutesResult.name = LineManager.lineInfos!!.lineName
|
||||
busRoutesResult.taskId = LineModel.currentTask!!.taskId!!.toInt()
|
||||
busRoutesResult.taskTime = LineModel.currentTask!!.taskStartTime!!
|
||||
val data = BusTransferData(if (LoginStatusManager.isLogin()) 1 else 0, busRoutesResult)
|
||||
val msg = TaskDetailsMsg(GsonUtils.toJson(data), BusinessType.shuttle)
|
||||
d(M_BUS + TAG, "sendTaskDetailsToClients = " + GsonUtils.toJson(msg))
|
||||
LanSocketManager.sendMsgToClient(msg)
|
||||
} else {
|
||||
LineManager.getLineInfo {lineInfo ->
|
||||
busRoutesResult.setSite(LineModel.stationList)
|
||||
busRoutesResult.lineId = lineInfo.lineId.toInt()
|
||||
busRoutesResult.name = lineInfo.lineName
|
||||
busRoutesResult.taskId = LineModel.currentTask!!.taskId!!.toInt()
|
||||
busRoutesResult.taskTime = LineModel.currentTask!!.taskStartTime!!
|
||||
val data = BusTransferData(if (LoginStatusManager.isLogin()) 1 else 0, busRoutesResult)
|
||||
val msg = TaskDetailsMsg(GsonUtils.toJson(data), BusinessType.shuttle)
|
||||
d(M_BUS + TAG, "sendTaskDetailsToClients = " + GsonUtils.toJson(msg))
|
||||
LanSocketManager.sendMsgToClient(msg)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ object TicketModel : IOchOnMessageListener<WriteOffPassenger>{
|
||||
}
|
||||
|
||||
private fun selectWriteOffCount(){
|
||||
LineManager.endStation?.let { endStation->
|
||||
LineManager.getStations().second?.let { endStation->
|
||||
LineModel.currentTask?.let { currentTask->
|
||||
OrderServiceManager.queryBusTaskByLineId(AbsMogoApplication.getApp(),
|
||||
"${currentTask.taskId}",
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.och.weaknet.callback.IBusLinesCallback
|
||||
import com.mogo.och.weaknet.model.LineModel
|
||||
import com.mogo.och.weaknet.model.OrderModel
|
||||
import com.mogo.och.weaknet.repository.db.bean.LineDataBean
|
||||
|
||||
/**
|
||||
@@ -28,7 +29,7 @@ class SwtichBizeModel : ViewModel(), IBusLinesCallback {
|
||||
LineModel.setBusLinesCallback(TAG, this)
|
||||
this.viewCallback?.showLoadingView()
|
||||
ThreadUtils.getIoPool().execute {
|
||||
LineModel.loadStartedTaskAndDefaultInfo()
|
||||
OrderModel.queryBusRoutes()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +78,7 @@ class SwtichBizeModel : ViewModel(), IBusLinesCallback {
|
||||
override fun onCompleteTask() {
|
||||
super.onCompleteTask()
|
||||
ThreadUtils.getIoPool().execute {
|
||||
LineModel.loadStartedTaskAndDefaultInfo()
|
||||
OrderModel.queryBusRoutes()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,14 +3,9 @@ package com.mogo.och.weaknet.ui.fragment
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.isCanStartAutopilot
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getState
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.biz.login.ILoginCallback
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusEnum
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusManager
|
||||
@@ -19,9 +14,6 @@ import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.bean.ArrivedStation
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
import com.mogo.och.weaknet.callback.IBusADASStatusCallback
|
||||
import com.mogo.och.weaknet.model.LineModel
|
||||
import com.mogo.och.weaknet.model.OrderModel
|
||||
import com.mogo.och.weaknet.util.BusTrajectoryManager
|
||||
import mogo_msg.MogoReportMsg.MogoReportMessage
|
||||
@@ -32,8 +24,7 @@ import mogo_msg.MogoReportMsg.MogoReportMessage
|
||||
* @author tongchenfei
|
||||
*/
|
||||
class BusPresenter(view: ShuttleFragment?) : Presenter<ShuttleFragment?>(view),
|
||||
IOchAutopilotStatusListener, ILoginCallback, IBusADASStatusCallback {
|
||||
private var mCurrentStation = 0
|
||||
IOchAutopilotStatusListener, ILoginCallback {
|
||||
|
||||
init {
|
||||
//2021.11.1 鹰眼架构整合,由IMoGoAutopilotStatusListener逐步替代IMogoAdasOCHCallback接口
|
||||
@@ -53,13 +44,11 @@ class BusPresenter(view: ShuttleFragment?) : Presenter<ShuttleFragment?>(view),
|
||||
}
|
||||
|
||||
fun initModelListener() {
|
||||
OrderModel.setAdasStatusCallback(this)
|
||||
OchAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
LoginStatusManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
fun releaseListener() {
|
||||
OrderModel.setAdasStatusCallback(null)
|
||||
OCHAdasAbilityManager.getInstance().release()
|
||||
OchAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
LoginStatusManager.removeListener(TAG)
|
||||
@@ -70,92 +59,11 @@ class BusPresenter(view: ShuttleFragment?) : Presenter<ShuttleFragment?>(view),
|
||||
OrderModel.logout()
|
||||
}
|
||||
|
||||
override fun updateBusTaskStatus(
|
||||
lineName: String, lineTime: String,
|
||||
stationList: List<BusStationBean>,
|
||||
arrivingOrArrivedIndex: Int,
|
||||
isArrived: Boolean
|
||||
) {
|
||||
mCurrentStation = if (arrivingOrArrivedIndex == 0 || isArrived) {
|
||||
arrivingOrArrivedIndex
|
||||
} else {
|
||||
arrivingOrArrivedIndex - 1
|
||||
}
|
||||
d(SceneConstant.M_BUS + "BusOrderModel =", " mCurrentStation =$mCurrentStation")
|
||||
}
|
||||
|
||||
|
||||
override fun clearBusStationsMarkers() {
|
||||
// TODO: 清理或展示地图
|
||||
UiThreadHandler.post({
|
||||
if (mView != null) {
|
||||
mView!!.clearBusStationsMarkers()
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
override fun onAutopilotArriveAtStation(arrivedStation: ArrivedStation?) {
|
||||
e(SceneConstant.M_BUS + TAG, "行程日志-onAutopilotArriveAtStation arrive")
|
||||
OrderModel.onArriveAt(arrivedStation, "底盘触发进站")
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusResponse(state: Int) {
|
||||
when (state) {
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE, IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING, IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {
|
||||
if (FunctionBuildConfig.isDemoMode
|
||||
&& ((mCurrentStation >= 0 && mCurrentStation <= LineModel.stationList!!.size - 1) && OrderModel.isGoingToNextStation)
|
||||
) {
|
||||
d(SceneConstant.M_BUS + "BusOrderModel=", "有美化功能")
|
||||
return
|
||||
}
|
||||
// 改变UI自动驾驶状态
|
||||
UiThreadHandler.post({
|
||||
if (mView != null) {
|
||||
mView!!.onAutopilotStatusChanged(state, isCanStartAutopilot(false, 0))
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
|
||||
// 改变UI自动驾驶状态
|
||||
UiThreadHandler.post({
|
||||
if (mView != null) {
|
||||
mView!!.onAutopilotStatusChanged(state, isCanStartAutopilot(false, 0))
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
else -> UiThreadHandler.post({
|
||||
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
}
|
||||
|
||||
override fun startOpenAutopilot() {
|
||||
//非美化模式下启动动画
|
||||
UiThreadHandler.post({
|
||||
if (mView != null) {
|
||||
mView!!.startAutopilotAnimation()
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
|
||||
//中间站点再次开启自驾时, 自动驾驶状态是2未改变, 此次鹰眼底层不再返给业务,需优化按钮动画显示
|
||||
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
|
||||
== getState() && mView != null
|
||||
) {
|
||||
mView!!.onAutopilotStatusChanged(
|
||||
getState(),
|
||||
isCanStartAutopilot(false, 0)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试使用
|
||||
*/
|
||||
fun debugAutoPilotStatus(status: Int) {
|
||||
onAutopilotStatusResponse(status)
|
||||
}
|
||||
|
||||
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMessage, lineId: Long) {
|
||||
@@ -168,27 +76,10 @@ class BusPresenter(view: ShuttleFragment?) : Presenter<ShuttleFragment?>(view),
|
||||
//OrderModel.queryBusRoutes()
|
||||
} else {
|
||||
BusTrajectoryManager.getInstance().stopTrajReqLoop()
|
||||
clearBusStationsMarkers()
|
||||
OrderModel.closeBeautificationMode()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStartAdasFailure() {
|
||||
UiThreadHandler.post({
|
||||
if (mView != null) {
|
||||
mView!!.stopAnimAndUpdateBtnStatus()
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
override fun canStartAutopilot(canStart: Boolean) {
|
||||
UiThreadHandler.post({
|
||||
if (mView != null) {
|
||||
mView!!.onAutopilotStatusChanged(getState(), canStart)
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "BusPresenter"
|
||||
}
|
||||
|
||||
@@ -1,55 +1,25 @@
|
||||
package com.mogo.och.weaknet.ui.fragment
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.graphics.BitmapFactory
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.animation.LinearInterpolator
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import android.widget.RelativeLayout
|
||||
import android.widget.TextView
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig
|
||||
import com.mogo.eagle.core.data.temp.EventLogout
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.isCanStartAutopilot
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getState
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager.attachAutopilotBeforeLaunchView
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getOverlayManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isB1
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isB2
|
||||
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.mogo.view.OnPreventFastClickListener
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.map.MogoMap
|
||||
import com.mogo.map.overlay.core.Level
|
||||
import com.mogo.map.overlay.point.Point
|
||||
import com.mogo.och.common.module.utils.OCHThreadPoolManager
|
||||
import com.mogo.och.common.module.utils.ResourcesUtils
|
||||
import com.mogo.och.common.module.utils.ResourcesUtils.getColor
|
||||
import com.mogo.och.common.module.utils.createQRCodeWithPicture
|
||||
import com.mogo.och.common.module.wigets.BindQRCodeDialog
|
||||
import com.mogo.och.shuttle.weaknet.R
|
||||
import com.mogo.och.weaknet.constant.BusConst
|
||||
import com.mogo.och.weaknet.ui.bizswitch.SwitchBizView
|
||||
import com.mogo.och.weaknet.ui.taskrunned.RunningTaskManager
|
||||
import com.mogo.och.weaknet.view.BizMapView
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_base_fragment.boneContainerView
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_base_fragment.bus_autopilot_btn_iv
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_base_fragment.bus_autopolot_btn_tv
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_base_fragment.mapBizView
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_base_fragment.module_mogo_och_autopilot_status
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_base_fragment.module_mogo_och_station_panel_container
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
@@ -63,18 +33,14 @@ import org.greenrobot.eventbus.ThreadMode
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
class ShuttleFragment : MvpFragment<ShuttleFragment?, BusPresenter?>(), View.OnClickListener {
|
||||
|
||||
private var autopilotLoadingAnimator: ObjectAnimator? = null
|
||||
|
||||
var isAnimateRunning: Boolean = false
|
||||
class ShuttleFragment : MvpFragment<ShuttleFragment?, BusPresenter?>() {
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.shuttle_weak_base_fragment
|
||||
}
|
||||
|
||||
override fun getTagName(): String {
|
||||
return "BusFragment"
|
||||
return "ShuttleFragment"
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
@@ -84,15 +50,6 @@ class ShuttleFragment : MvpFragment<ShuttleFragment?, BusPresenter?>(), View.OnC
|
||||
}
|
||||
|
||||
initListener()
|
||||
setAutopilotBtnStatus(
|
||||
getState(),
|
||||
isCanStartAutopilot(false, 0)
|
||||
)
|
||||
module_mogo_och_autopilot_status!!.setOnClickListener(object : OnPreventFastClickListener() {
|
||||
override fun onClickImpl(v: View) {
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -146,152 +103,6 @@ class ShuttleFragment : MvpFragment<ShuttleFragment?, BusPresenter?>(), View.OnC
|
||||
private fun initListener() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 改变自动驾驶状态
|
||||
*
|
||||
* @param autopilotStatus 0:不可用 1:可用状态 2:自动驾驶中
|
||||
*/
|
||||
fun onAutopilotStatusChanged(autopilotStatus: Int, canStartAuto: Boolean) {
|
||||
UiThreadHandler.post({
|
||||
changeAutopilotBtnView(
|
||||
autopilotStatus,
|
||||
isAnimateRunning,
|
||||
canStartAuto
|
||||
)
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
fun setAutopilotBtnStatus(autopilotStatus: Int, canStartAuto: Boolean) {
|
||||
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE == autopilotStatus) { //0不可用
|
||||
bus_autopolot_btn_tv!!.setTextColor(getColor(R.color.bus_autopilot_text_color_disable))
|
||||
bus_autopolot_btn_tv!!.text =
|
||||
ResourcesUtils.getString(R.string.bus_loading_autopilot_runnig_tv)
|
||||
bus_autopilot_btn_iv!!.setImageResource(R.drawable.bus_disable_autopilot_icon)
|
||||
module_mogo_och_autopilot_status!!.isClickable = true
|
||||
module_mogo_och_autopilot_status!!.setBackgroundResource(R.drawable.common_autopilot_start_fail)
|
||||
} else {
|
||||
bus_autopolot_btn_tv!!.setTextColor(
|
||||
AbsMogoApplication.getApp().getColor(R.color.bus_autopilot_text_color_normal)
|
||||
)
|
||||
bus_autopilot_btn_iv!!.setImageResource(R.drawable.bus_ic_autopilot)
|
||||
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == autopilotStatus) { //1可用
|
||||
bus_autopolot_btn_tv!!.text =
|
||||
ResourcesUtils.getString(R.string.bus_loading_autopilot_runnig_tv)
|
||||
if (canStartAuto) {
|
||||
module_mogo_och_autopilot_status!!.isClickable = true
|
||||
module_mogo_och_autopilot_status!!.setBackgroundResource(R.drawable.common_autopilot_press)
|
||||
} else {
|
||||
bus_autopolot_btn_tv!!.setTextColor(getColor(R.color.bus_autopilot_text_color_disable))
|
||||
bus_autopilot_btn_iv!!.setImageResource(R.drawable.bus_disable_autopilot_icon)
|
||||
module_mogo_och_autopilot_status!!.isClickable = true
|
||||
module_mogo_och_autopilot_status!!.setBackgroundResource(R.drawable.common_autopilot_start_fail)
|
||||
}
|
||||
} else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == autopilotStatus) {
|
||||
bus_autopolot_btn_tv!!.setText(R.string.bus_loading_autopilot_runnig_tv)
|
||||
module_mogo_och_autopilot_status!!.isClickable = true
|
||||
module_mogo_och_autopilot_status!!.setBackgroundResource(R.drawable.common_autopilot_in_autopilot)
|
||||
} else if (IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING
|
||||
== autopilotStatus
|
||||
) {
|
||||
bus_autopolot_btn_tv!!.setText(R.string.bus_pingxing_driver)
|
||||
module_mogo_och_autopilot_status!!.isClickable = false
|
||||
module_mogo_och_autopilot_status!!.setBackgroundResource(R.drawable.common_autopilot_pxjs)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun updateAutopilotStatus(autopilotStatus: Int) {
|
||||
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
|
||||
== autopilotStatus
|
||||
) { //2 running
|
||||
bus_autopilot_btn_iv!!.setImageResource(R.drawable.bus_right_autopilot_icon)
|
||||
bus_autopolot_btn_tv!!.setTextColor(getColor(R.color.bus_autopilot_text_color_normal))
|
||||
bus_autopolot_btn_tv!!.text =
|
||||
ResourcesUtils.getString(R.string.bus_loading_autopilot_success_tv)
|
||||
// module_mogo_och_autopilot_status.setSelected(false);
|
||||
module_mogo_och_autopilot_status!!.isClickable = false
|
||||
} else {
|
||||
bus_autopilot_btn_iv!!.setImageResource(R.drawable.bus_wrong_autopilot_icon)
|
||||
bus_autopolot_btn_tv!!.setTextColor(getColor(R.color.bus_autopilot_text_color_normal))
|
||||
bus_autopolot_btn_tv!!.text =
|
||||
ResourcesUtils.getString(R.string.bus_loading_autopilot_failure_tv)
|
||||
module_mogo_och_autopilot_status!!.isClickable = false
|
||||
// module_mogo_och_autopilot_status.setSelected(false);
|
||||
}
|
||||
UiThreadHandler.postDelayed({
|
||||
setAutopilotBtnStatus(
|
||||
autopilotStatus,
|
||||
isCanStartAutopilot(false, 0)
|
||||
)
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
private fun changeAutopilotBtnView(
|
||||
autopilotStatus: Int,
|
||||
isAnimateRunning: Boolean,
|
||||
canStartAuto: Boolean
|
||||
) {
|
||||
if (isAnimateRunning && (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
|
||||
!= autopilotStatus)
|
||||
) {
|
||||
// 主动开启自动驾驶中,不为2(为0、1)则继续loading
|
||||
return
|
||||
}
|
||||
if (isAnimateRunning) {
|
||||
stopAnimAndUpdateBtnStatus()
|
||||
} else {
|
||||
setAutopilotBtnStatus(autopilotStatus, canStartAuto)
|
||||
}
|
||||
}
|
||||
|
||||
fun stopAnimAndUpdateBtnStatus() {
|
||||
stopAutopilotAnimation()
|
||||
updateAutopilotStatus(getState())
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启自动驾驶中间动画
|
||||
*/
|
||||
fun startAutopilotAnimation() {
|
||||
isAnimateRunning = true
|
||||
bus_autopolot_btn_tv!!.text =
|
||||
ResourcesUtils.getString(R.string.bus_loading_autopilot_tv)
|
||||
bus_autopolot_btn_tv!!.setTextColor(getColor(R.color.bus_autopilot_text_color_normal))
|
||||
module_mogo_och_autopilot_status!!.isClickable = true
|
||||
bus_autopilot_btn_iv!!.setImageResource(R.drawable.bus_loading_autopilot_icon)
|
||||
if (autopilotLoadingAnimator == null) {
|
||||
autopilotLoadingAnimator = ObjectAnimator.ofFloat(bus_autopilot_btn_iv!!, "rotation", 0f, 360f)
|
||||
autopilotLoadingAnimator?.interpolator = LinearInterpolator()
|
||||
autopilotLoadingAnimator?.repeatCount = -1 //无限循环
|
||||
autopilotLoadingAnimator?.setDuration(1000) //设置持续时间
|
||||
}
|
||||
autopilotLoadingAnimator!!.start() //动画开始
|
||||
|
||||
startingAutoApilotCountDown()
|
||||
}
|
||||
|
||||
private fun startingAutoApilotCountDown() {
|
||||
//10s 若自动驾驶没有开启,则结束动画
|
||||
UiThreadHandler.postDelayed({
|
||||
//未启动成功做处理
|
||||
if (isAnimateRunning) { // 只判断动画是否在进行,根据自动驾驶当前状态去设置自动驾驶状态
|
||||
stopAutopilotAnimation()
|
||||
updateAutopilotStatus(getState())
|
||||
}
|
||||
}, BusConst.TIMER_START_AUTOPILOT_INTERVAL)
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止自动驾驶中间动画
|
||||
*/
|
||||
protected fun stopAutopilotAnimation() {
|
||||
if (autopilotLoadingAnimator != null) {
|
||||
autopilotLoadingAnimator!!.end()
|
||||
bus_autopilot_btn_iv!!.clearAnimation()
|
||||
autopilotLoadingAnimator = null
|
||||
isAnimateRunning = false
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
@@ -337,80 +148,6 @@ class ShuttleFragment : MvpFragment<ShuttleFragment?, BusPresenter?>(), View.OnC
|
||||
}
|
||||
}
|
||||
|
||||
fun clearBusStationsMarkers() {
|
||||
// d(SceneConstant.M_BUS + TAG, "clearBusStationsMarkers()")
|
||||
// if (null != startStation) {
|
||||
// setOrRemoveMapMaker(
|
||||
// false, BusConst.BUS_START_MAP_MAKER, startStation!!.lat,
|
||||
// startStation!!.lon, R.raw.star_marker
|
||||
// )
|
||||
// }
|
||||
// if (null != endStation) {
|
||||
// setOrRemoveMapMaker(
|
||||
// false, BusConst.BUS_END_MAP_MAKER, endStation!!.lat,
|
||||
// endStation!!.lon, R.raw.end_marker
|
||||
// )
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制地图起点终点
|
||||
*
|
||||
* @param isAdd
|
||||
* @param uuid
|
||||
*/
|
||||
private fun setOrRemoveMapMaker(
|
||||
isAdd: Boolean,
|
||||
uuid: String,
|
||||
lat: Double,
|
||||
longi: Double,
|
||||
resourceId: Int
|
||||
) {
|
||||
if (isAdd) {
|
||||
val setMapMarkerRunnable = Runnable {
|
||||
d(
|
||||
SceneConstant.M_BUS + "setMapMaker= " + Thread.currentThread().name,
|
||||
"$uuid=latitude=$lat,longitude=$longi"
|
||||
)
|
||||
val builder =
|
||||
Point.Options.Builder(BusConst.TYPE_MARKER_BUS_ORDER, Level.MAP_MARKER)
|
||||
.setId(uuid)
|
||||
.anchor(0.5f, 0.5f)
|
||||
.set3DMode(true)
|
||||
.isUseGps(true)
|
||||
.controlAngle(false)
|
||||
.icon3DRes(resourceId)
|
||||
.latitude(lat)
|
||||
.longitude(longi)
|
||||
val overlayManager = getOverlayManager()
|
||||
overlayManager?.showOrUpdatePoint(builder.build(), MogoMap.DEFAULT)
|
||||
}
|
||||
|
||||
OCHThreadPoolManager.getsInstance().execute(setMapMarkerRunnable)
|
||||
} else {
|
||||
val removeMapMarkerRunnable = Runnable {
|
||||
d(
|
||||
SceneConstant.M_BUS + "RemoveMapMaker=" + Thread.currentThread().name,
|
||||
"$uuid=latitude=$lat,longitude=$longi"
|
||||
)
|
||||
getOverlayManager()?.removePoint(uuid)
|
||||
}
|
||||
OCHThreadPoolManager.getsInstance().execute(removeMapMarkerRunnable)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
if (v.id == R.id.switch_line_btn) { //切换路线条件: 自动驾驶过程中,点击则toast提示:自动驾驶中,不可切换路线
|
||||
//本次行程未结束,不支持切换路线。点击则toast提示:当前行程未完成,不可切换路线
|
||||
if (getState()
|
||||
== IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
|
||||
) {
|
||||
ToastUtils.showLong(ResourcesUtils.getString(R.string.bus_switch_line_btn_warning1))
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* END
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,7 @@ class TaskRunningModel : ViewModel(), IBusLinesCallback {
|
||||
}
|
||||
|
||||
fun leaveStation() {
|
||||
OrderModel.autoDriveToNextStation()
|
||||
OrderModel.driveToNextStation()
|
||||
}
|
||||
|
||||
interface SwtichLineViewCallback{
|
||||
@@ -65,7 +65,7 @@ class TaskRunningModel : ViewModel(), IBusLinesCallback {
|
||||
}
|
||||
|
||||
fun completeTask() {
|
||||
OrderModel.abortTask()
|
||||
OrderModel.completeTask()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -108,7 +108,9 @@ class TaskRunningView: ConstraintLayout, TaskRunningModel.SwtichLineViewCallback
|
||||
}
|
||||
|
||||
override fun showRunningTaskInfo() {
|
||||
bus_task_running_line_name.text = LineManager.lineInfos?.lineName?:""
|
||||
LineManager.getLineInfo {lineInfo ->
|
||||
bus_task_running_line_name.text = "班次:${lineInfo.lineName}"
|
||||
}
|
||||
actv_running_task_time.text = LineModel.getTaskTime()
|
||||
LineModel.stationList?.takeIf { it.size>2 }?.let {
|
||||
actv_running_task_last_station.text = "往${it.last().name ?: ""}"
|
||||
|
||||
@@ -125,51 +125,6 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_mogo_och_autopilot_status"
|
||||
android:layout_width="@dimen/dp_616"
|
||||
android:layout_height="@dimen/dp_185"
|
||||
android:layout_marginStart="@dimen/dp_9"
|
||||
android:layout_marginTop="-31dp"
|
||||
android:paddingTop="@dimen/dp_27"
|
||||
android:paddingBottom="@dimen/dp_32"
|
||||
android:background="@drawable/bus_autopilot_0_1_status_bg"
|
||||
android:gravity="center"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="parent"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_autopilot_btn_iv"
|
||||
android:layout_width="73dp"
|
||||
android:layout_height="73dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@drawable/bus_ic_autopilot" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_autopolot_btn_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="28dp"
|
||||
android:layout_toRightOf="@+id/bus_autopilot_btn_iv"
|
||||
android:text="自动驾驶"
|
||||
android:textColor="@color/bus_autopilot_text_color_normal"
|
||||
android:textSize="@dimen/module_mogo_och_autopilot_status_text_size"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/module_mogo_och_station_panel_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_marginTop="-27dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_autopilot_status"
|
||||
app:layout_goneMarginTop="@dimen/module_mogo_och_station_panel_container_margin_top_no_call" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.map.switchvisual.VisualViewDirver
|
||||
app:layout_constraintStart_toEndOf="@+id/module_mogo_och_station_panel_container"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_mogo_och_station_panel_container"
|
||||
@@ -190,11 +145,4 @@
|
||||
android:visibility="visible"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.autopilot.AutopilotState
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="@dimen/dp_282"
|
||||
android:layout_height="@dimen/dp_282"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,129 +0,0 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/module_och_bus_order_status_stationInfo"
|
||||
android:layout_width="@dimen/dp_616"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/dp_28"
|
||||
android:background="@drawable/bus_line_panel_bg"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<!-- 线路名称 -->
|
||||
<com.mogo.och.common.module.wigets.MarqueeTextView
|
||||
android:id="@+id/module_och_bus_line_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_68"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_64"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:text="--"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="38dp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/bus_task_time_tv"/>
|
||||
<!-- 班次名称 -->
|
||||
<TextView
|
||||
android:id="@+id/bus_task_time_tv"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginRight="@dimen/dp_68"
|
||||
android:textColor="#FFF"
|
||||
android:text="--: --"
|
||||
android:textSize="28dp"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/bus_task_time_bg"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/module_och_bus_line_name"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_och_bus_line_name">
|
||||
|
||||
</TextView>
|
||||
<View
|
||||
android:id="@+id/line1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_4"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:layout_marginLeft="@dimen/dp_30"
|
||||
android:layout_marginRight="@dimen/dp_30"
|
||||
android:background="@drawable/bus_line_dividing_line1_selector"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_och_bus_line_name" />
|
||||
|
||||
<View
|
||||
android:id="@+id/line2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_4"
|
||||
android:layout_marginLeft="@dimen/dp_30"
|
||||
android:layout_marginRight="@dimen/dp_30"
|
||||
android:background="@drawable/bus_line_dividing_line2_selector"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/line1"
|
||||
app:layout_constraintRight_toRightOf="@+id/line1"
|
||||
app:layout_constraintTop_toBottomOf="@+id/line1" />
|
||||
|
||||
<com.mogo.och.weaknet.ui.BusStationCommonItem
|
||||
android:id="@+id/bus_panel_first_station"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:layout_marginLeft="@dimen/dp_68"
|
||||
app:layout_constraintRight_toRightOf="@+id/bus_task_time_tv"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/line2"/>
|
||||
<com.mogo.och.weaknet.ui.BusStationCommonItem
|
||||
android:id="@+id/bus_panel_second_station"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
android:layout_marginLeft="@dimen/dp_68"
|
||||
app:layout_constraintRight_toRightOf="@+id/bus_task_time_tv"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_panel_first_station"/>
|
||||
<com.mogo.och.weaknet.ui.BusStationCommonItem
|
||||
android:id="@+id/bus_panel_third_station"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
android:layout_marginLeft="@dimen/dp_68"
|
||||
app:layout_constraintRight_toRightOf="@+id/bus_task_time_tv"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_panel_second_station"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/switch_line_btn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bus_switch_line_btn_height_1"
|
||||
android:layout_marginStart="@dimen/dp_29"
|
||||
android:layout_marginEnd ="@dimen/dp_27"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
app:layout_goneMarginTop="@dimen/dp_550"
|
||||
android:background="@drawable/bus_switch_line_btn"
|
||||
android:gravity="center"
|
||||
android:text="@string/bus_switch_line_btn"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_mogo_och_bus_station_notice_text_size"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_panel_third_station"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<include layout="@layout/shuttle_weak_no_line_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_160"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/group_stations_panel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="module_och_bus_line_name,bus_task_time_tv,
|
||||
line1,line2,bus_panel_first_station,bus_panel_second_station,bus_panel_third_station"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -10,6 +10,7 @@ import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import kotlinx.android.synthetic.main.view_bone_tab.view.carInfoTabView
|
||||
import kotlinx.android.synthetic.main.view_bone_tab.view.msgBoxTabView
|
||||
import kotlinx.android.synthetic.main.view_bone_tab.view.tabSwitchCarInfo
|
||||
import kotlinx.android.synthetic.main.view_bone_tab.view.tabSwitchMore
|
||||
import kotlinx.android.synthetic.main.view_bone_tab.view.tabSwitchMsgBox
|
||||
@@ -114,8 +115,9 @@ class BoneTabLayout @JvmOverloads constructor(
|
||||
tabSwitchMsgBox.switchTab(check)
|
||||
if (check) {
|
||||
tabSwitchMsgBox.updateNotice(false)
|
||||
msgBoxTabView.visibility = VISIBLE
|
||||
} else {
|
||||
|
||||
msgBoxTabView.visibility = GONE
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.greenrobot.eventbus.ThreadMode
|
||||
* @description 司机端消息盒子打开列表视图
|
||||
* @since: 2022/11/25
|
||||
*/
|
||||
class MsgBoxListTabView @JvmOverloads constructor(
|
||||
class MsgBoxTabView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
@@ -40,10 +40,10 @@ class MsgBoxListTabView @JvmOverloads constructor(
|
||||
IOrderListener {
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.layout_driver_msg_box_list, this, true)
|
||||
LayoutInflater.from(context).inflate(R.layout.layout_msg_box_tab, this, true)
|
||||
initView()
|
||||
}
|
||||
private val TAG = "DriverMsgBoxListView"
|
||||
private val TAG = "MsgBoxTabView"
|
||||
private var noticeList: ArrayList<MsgBoxBean> ?= null //通知消息列表
|
||||
private var fmList: ArrayList<MsgBoxBean> ?= ArrayList() //FM信息消息列表
|
||||
private var ipcReportList: ArrayList<MsgBoxBean> ?= null //车辆系统信息消息列表
|
||||
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="@dimen/dp_880"
|
||||
android:layout_height="@dimen/dp_997"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/bg_msg_box"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMsgNotice"
|
||||
android:layout_width="@dimen/dp_154"
|
||||
android:layout_height="@dimen/dp_113"
|
||||
android:text="@string/msg_box_title_notice"
|
||||
android:textColor="@color/msg_box_title_color"
|
||||
android:textSize="@dimen/sp_40"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_26"
|
||||
android:paddingTop="@dimen/dp_38"
|
||||
android:gravity="center_horizontal"
|
||||
/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMsgFm"
|
||||
android:layout_width="@dimen/dp_154"
|
||||
android:layout_height="@dimen/dp_113"
|
||||
android:text="@string/msg_box_title_fm"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/sp_40"
|
||||
android:gravity="center_horizontal"
|
||||
android:paddingTop="@dimen/dp_38"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvMsgNotice"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvMsgIpcReport"
|
||||
/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMsgIpcReport"
|
||||
android:layout_width="@dimen/dp_154"
|
||||
android:layout_height="@dimen/dp_113"
|
||||
android:text="@string/msg_box_title_report"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/sp_38"
|
||||
android:gravity="center_horizontal"
|
||||
android:paddingTop="@dimen/dp_38"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvMsgFm"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvMsgBadCase"
|
||||
/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMsgBadCase"
|
||||
android:layout_width="@dimen/dp_154"
|
||||
android:layout_height="@dimen/dp_113"
|
||||
android:text="@string/msg_box_title_bad_case"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/sp_40"
|
||||
android:gravity="center_horizontal"
|
||||
android:paddingTop="@dimen/dp_38"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="@dimen/dp_26"
|
||||
/>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvMsgBoxList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_0"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvMsgIpcReport"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -22,6 +22,17 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.bone.tab.MsgBoxTabView
|
||||
android:id="@+id/msgBoxTabView"
|
||||
android:layout_width="@dimen/dp_960"
|
||||
android:layout_height="@dimen/dp_1137"
|
||||
android:layout_marginStart="@dimen/dp_40"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.bone.tab.ToolKitTabView
|
||||
android:id="@+id/toolKitTabView"
|
||||
android:layout_width="@dimen/dp_960"
|
||||
|
||||
Reference in New Issue
Block a user