Merge branch 'refs/heads/dev_robotaxi-d_240912_6.7.0' into dev_robotaxi-d_240912_6.7.2_local
# Conflicts: # OCH/shuttle/passenger/src/main/java/jinlv/com/mogo/och/shuttle/passenger/model/BusPassengerModel.java # OCH/shuttle/passenger/src/main/java/m2/com/mogo/och/shuttle/passenger/model/PM2DrivingModel.kt
This commit is contained in:
@@ -2,7 +2,6 @@ package com.mogo.och.weaknet.ui.taskrunning
|
||||
|
||||
import android.animation.ArgbEvaluator
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.util.TypedValue
|
||||
import android.view.LayoutInflater
|
||||
@@ -93,13 +92,13 @@ class TaskRunningAdapter(
|
||||
holder.acivStationHeadBig.visibility = View.VISIBLE
|
||||
holder.acivStationHead.visibility = View.INVISIBLE
|
||||
holder.acivStationHeadBig.setImageResource(R.drawable.bus_runnint_task_start)
|
||||
holder.bgPassBg.visibility = View.GONE
|
||||
holder.bgPassBottomBg.visibility = View.VISIBLE
|
||||
holder.bgPassHeadBg.visibility = View.GONE
|
||||
holder.middleStationBg.visibility = View.GONE
|
||||
holder.startStationBg.visibility = View.VISIBLE
|
||||
holder.endStationBg.visibility = View.GONE
|
||||
if(startStationIndex==0){
|
||||
if(line.isLeaving){
|
||||
// 下端 灰色
|
||||
holder.bgPassBottomBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
|
||||
holder.startStationBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
|
||||
holder.itemView.background = null
|
||||
}else{
|
||||
// 下端 彩色
|
||||
@@ -110,11 +109,11 @@ class TaskRunningAdapter(
|
||||
startColor,
|
||||
endColor
|
||||
))
|
||||
holder.bgPassBottomBg.background = temp01
|
||||
holder.startStationBg.background = temp01
|
||||
}
|
||||
}else{
|
||||
// 下端 灰色
|
||||
holder.bgPassBottomBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
|
||||
holder.startStationBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
|
||||
holder.itemView.background = null
|
||||
}
|
||||
}
|
||||
@@ -122,16 +121,16 @@ class TaskRunningAdapter(
|
||||
holder.acivStationHeadBig.visibility = View.VISIBLE
|
||||
holder.acivStationHead.visibility = View.INVISIBLE
|
||||
holder.acivStationHeadBig.setImageResource(R.drawable.bus_runnint_task_end)
|
||||
holder.bgPassBg.visibility = View.GONE
|
||||
holder.bgPassBottomBg.visibility = View.GONE
|
||||
holder.bgPassHeadBg.visibility = View.VISIBLE
|
||||
holder.middleStationBg.visibility = View.GONE
|
||||
holder.startStationBg.visibility = View.GONE
|
||||
holder.endStationBg.visibility = View.VISIBLE
|
||||
if(startStationIndex==itemCount-1){
|
||||
if(line.isLeaving){
|
||||
holder.bgPassHeadBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
|
||||
holder.endStationBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
|
||||
holder.itemView.setBackgroundResource(R.drawable.bus_task_current_station_bg)
|
||||
}else{
|
||||
holder.itemView.setBackgroundResource(R.drawable.bus_task_current_station_bg)
|
||||
holder.bgPassHeadBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
|
||||
holder.endStationBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
|
||||
}
|
||||
}else{
|
||||
// 上端 彩色
|
||||
@@ -143,19 +142,19 @@ class TaskRunningAdapter(
|
||||
startColorTemp,
|
||||
endColorTemp
|
||||
))
|
||||
holder.bgPassHeadBg.background = temp01
|
||||
holder.endStationBg.background = temp01
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
holder.acivStationHeadBig.visibility = View.GONE
|
||||
holder.acivStationHead.visibility = View.VISIBLE
|
||||
holder.bgPassBg.visibility = View.VISIBLE
|
||||
holder.bgPassBottomBg.visibility = View.GONE
|
||||
holder.bgPassHeadBg.visibility = View.GONE
|
||||
holder.middleStationBg.visibility = View.VISIBLE
|
||||
holder.startStationBg.visibility = View.GONE
|
||||
holder.endStationBg.visibility = View.GONE
|
||||
if(currentPosition==startStationIndex){
|
||||
if(line.isLeaving){
|
||||
// 灰色
|
||||
holder.bgPassBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
|
||||
holder.middleStationBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
|
||||
holder.itemView.background = null
|
||||
}else{
|
||||
// 彩色
|
||||
@@ -167,11 +166,11 @@ class TaskRunningAdapter(
|
||||
startColorTemp,
|
||||
endColorTemp
|
||||
))
|
||||
holder.bgPassBg.background = temp01
|
||||
holder.middleStationBg.background = temp01
|
||||
}
|
||||
}else if(currentPosition<startStationIndex){
|
||||
// 灰色
|
||||
holder.bgPassBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
|
||||
holder.middleStationBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
|
||||
holder.itemView.background = null
|
||||
}else{
|
||||
var dex = 0f
|
||||
@@ -199,7 +198,7 @@ class TaskRunningAdapter(
|
||||
startColorTemp,
|
||||
endColorTemp
|
||||
))
|
||||
holder.bgPassBg.background = temp01
|
||||
holder.middleStationBg.background = temp01
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -220,12 +219,12 @@ class TaskRunningAdapter(
|
||||
|
||||
class TaskRunningViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
val actvStationName: AppCompatTextView = itemView.findViewById(R.id.actv_station_name)//站点名称
|
||||
val acivStationHead: AppCompatImageView = itemView.findViewById(R.id.aciv_station_head)//线路标识
|
||||
val acivStationHeadBig: AppCompatImageView = itemView.findViewById(R.id.aciv_station_head_big)//线路标识
|
||||
val acivStationHead: AppCompatImageView = itemView.findViewById(R.id.aciv_station_head)//普通站点标识 不是起始和终点坐标
|
||||
val acivStationHeadBig: AppCompatImageView = itemView.findViewById(R.id.aciv_station_head_big)//起始和终点坐标标识
|
||||
val actvWriteOffCount: WriteOffView = itemView.findViewById(R.id.actv_write_off_count) //此战核销的人数
|
||||
val bgPassBg: View = itemView.findViewById(R.id.bg_pass_bg) //贯通背景调
|
||||
val bgPassHeadBg: View = itemView.findViewById(R.id.bg_pass_head_bg) //贯通背景调
|
||||
val bgPassBottomBg: View = itemView.findViewById(R.id.bg_pass_bottom_bg) //贯通背景调
|
||||
val middleStationBg: View = itemView.findViewById(R.id.bg_pass_bg) //贯通背景调
|
||||
val endStationBg: View = itemView.findViewById(R.id.bg_pass_head_bg) //终点的背景
|
||||
val startStationBg: View = itemView.findViewById(R.id.bg_pass_bottom_bg) //起点坐标的背景
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
android:layout_marginBottom="@dimen/dp_11"
|
||||
app:layout_constraintStart_toStartOf="@+id/aciv_station_head_big"
|
||||
app:layout_constraintEnd_toEndOf="@+id/aciv_station_head_big"
|
||||
android:background="@color/light_prompt_red"
|
||||
tools:background="@color/light_prompt_red"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/aciv_station_head_big"
|
||||
android:layout_width="@dimen/dp_7"
|
||||
@@ -33,7 +33,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/aciv_station_head_big"
|
||||
android:layout_marginTop="@dimen/dp_11"
|
||||
android:background="@color/light_prompt_red"
|
||||
tools:background="@color/light_prompt_red"
|
||||
android:layout_width="@dimen/dp_7"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
android:layout_marginEnd="@dimen/dp_140"
|
||||
android:layout_marginTop="@dimen/dp_37"
|
||||
android:textColor="@color/white"
|
||||
android:text="@string/bus_switch_line_title"/>
|
||||
tools:text="@string/bus_switch_line_title"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_running_task_last_station"
|
||||
|
||||
@@ -3,10 +3,13 @@ package com.mogo.och.shuttle.weaknet.passenger.model
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
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.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
@@ -28,6 +31,7 @@ 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.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.common.module.utils.PinYinUtil
|
||||
import com.mogo.och.common.module.voice.VoiceNotice.showNotice
|
||||
import com.mogo.och.data.bean.BusRoutesResult
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
@@ -139,6 +143,7 @@ object BusPassengerModel {
|
||||
val startStation = mStations[i]
|
||||
val endStation = mStations[i + 1]
|
||||
setTrajectoryStation(startStation, endStation, result.lineId)
|
||||
updateAutopilotControlParameters(result,i)
|
||||
return
|
||||
} else if (station.drivingStatus == BusPassengerConst.STATION_STATUS_STOPPED && !station.isLeaving) {
|
||||
if (i == stations.size - 1) {
|
||||
@@ -148,6 +153,7 @@ object BusPassengerModel {
|
||||
isGoingToNextStation = false
|
||||
Logger.d(SceneConstant.M_BUS_P + TAG, "order = station= arrive")
|
||||
mRouteLineInfoCallback!!.updateStationsInfo(stations, i, true)
|
||||
clearAutopilotControlParameters()
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -322,4 +328,61 @@ object BusPassengerModel {
|
||||
TrajectoryAndDistanceManager.setStationPoint(null, null, -1L)
|
||||
}
|
||||
|
||||
private fun updateAutopilotControlParameters(
|
||||
busRoutesResult: BusRoutesResult,
|
||||
leaveIndex: Int
|
||||
) {
|
||||
val parameters = initAutopilotControlParameters(busRoutesResult, leaveIndex)
|
||||
if (null == parameters) {
|
||||
CallerLogger.e(SceneConstant.M_BUS_P + TAG, "AutopilotControlParameters is empty.")
|
||||
return
|
||||
}
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "AutopilotControlParameters is update.")
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(parameters)
|
||||
}
|
||||
|
||||
private fun initAutopilotControlParameters(
|
||||
busRoutesResult: BusRoutesResult,
|
||||
leaveIndex: Int
|
||||
): AutopilotControlParameters? {
|
||||
if (busRoutesResult.sites == null) {
|
||||
return null
|
||||
}
|
||||
val stations = busRoutesResult.sites
|
||||
if (leaveIndex + 1 > stations.size - 1) {
|
||||
CallerLogger.e(SceneConstant.M_BUS_P + TAG, "行程日志-mismatch condition1.")
|
||||
return null
|
||||
}
|
||||
val currentStation = stations[leaveIndex]
|
||||
val nextStation = stations[leaveIndex + 1]
|
||||
val parameters = AutopilotControlParameters()
|
||||
parameters.routeID = busRoutesResult.lineId
|
||||
parameters.routeName = busRoutesResult.name
|
||||
parameters.startName = PinYinUtil.getPinYinHeadChar(currentStation.name)
|
||||
parameters.endName = PinYinUtil.getPinYinHeadChar(nextStation.name)
|
||||
parameters.startLatLon =
|
||||
AutopilotControlParameters.AutoPilotLonLat(currentStation.lat, currentStation.lon)
|
||||
parameters.endLatLon =
|
||||
AutopilotControlParameters.AutoPilotLonLat(nextStation.lat, nextStation.lon)
|
||||
parameters.vehicleType = 10
|
||||
if (parameters.autoPilotLine == null) {
|
||||
parameters.autoPilotLine = AutopilotControlParameters.AutoPilotLine(
|
||||
busRoutesResult.lineId.toLong(), busRoutesResult.name,
|
||||
busRoutesResult.csvFileUrl, busRoutesResult.csvFileMd5,
|
||||
busRoutesResult.txtFileUrl, busRoutesResult.txtFileMd5,
|
||||
busRoutesResult.contrailSaveTime, busRoutesResult.carModel,
|
||||
busRoutesResult.csvFileUrlDPQP, busRoutesResult.csvFileMd5DPQP,
|
||||
busRoutesResult.txtFileUrlDPQP, busRoutesResult.txtFileMd5DPQP,
|
||||
busRoutesResult.contrailSaveTimeDPQP
|
||||
)
|
||||
}
|
||||
return parameters
|
||||
}
|
||||
|
||||
|
||||
private fun clearAutopilotControlParameters() {
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "AutopilotControlParameters is clear.")
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(null)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,11 +2,13 @@ package com.mogo.och.shuttle.weaknet.passenger.model
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
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.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
@@ -21,6 +23,7 @@ import com.mogo.och.common.module.manager.socket.lan.LanSocketManager
|
||||
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.common.module.utils.PinYinUtil
|
||||
import com.mogo.och.common.module.voice.VoiceNotice.showNotice
|
||||
import com.mogo.och.data.bean.BusRoutesResult
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
@@ -227,6 +230,7 @@ object PM2DrivingModel{
|
||||
val startStation = mStations[i]
|
||||
val endStation = mStations[i + 1]
|
||||
setTrajectoryStation(startStation, endStation, result.lineId)
|
||||
updateAutopilotControlParameters(result,i)
|
||||
return
|
||||
} else if (station.drivingStatus == BusPassengerConst.STATION_STATUS_STOPPED && !station.isLeaving) {
|
||||
d(SceneConstant.M_BUS_P+ TAG,"och-rotting--mNextStationIndex = $mNextStationIndex , i = $i")
|
||||
@@ -236,6 +240,7 @@ object PM2DrivingModel{
|
||||
}
|
||||
isGoingToNextStation = false
|
||||
mDrivingInfoCallback?.updateStationsInfo(stations as MutableList<BusStationBean>, i, true)
|
||||
clearAutopilotControlParameters()
|
||||
return
|
||||
}else{
|
||||
// d(SceneConstant.M_BUS_P+TAG,"och-rotting--BusStationBean = " + GsonUtils.toJson(station))
|
||||
@@ -263,4 +268,61 @@ object PM2DrivingModel{
|
||||
d(SceneConstant.M_BUS_P + TAG, "清理站点:$type")
|
||||
TrajectoryAndDistanceManager.setStationPoint(null, null, -1L)
|
||||
}
|
||||
|
||||
private fun updateAutopilotControlParameters(
|
||||
busRoutesResult: BusRoutesResult,
|
||||
leaveIndex: Int
|
||||
) {
|
||||
val parameters = initAutopilotControlParameters(busRoutesResult, leaveIndex)
|
||||
if (null == parameters) {
|
||||
CallerLogger.e(SceneConstant.M_BUS_P + TAG, "AutopilotControlParameters is empty.")
|
||||
return
|
||||
}
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "AutopilotControlParameters is update.")
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(parameters)
|
||||
}
|
||||
|
||||
private fun initAutopilotControlParameters(
|
||||
busRoutesResult: BusRoutesResult,
|
||||
leaveIndex: Int
|
||||
): AutopilotControlParameters? {
|
||||
if (busRoutesResult.sites == null) {
|
||||
return null
|
||||
}
|
||||
val stations = busRoutesResult.sites
|
||||
if (leaveIndex + 1 > stations.size - 1) {
|
||||
CallerLogger.e(SceneConstant.M_BUS_P + TAG, "行程日志-mismatch condition1.")
|
||||
return null
|
||||
}
|
||||
val currentStation = stations[leaveIndex]
|
||||
val nextStation = stations[leaveIndex + 1]
|
||||
val parameters = AutopilotControlParameters()
|
||||
parameters.routeID = busRoutesResult.lineId
|
||||
parameters.routeName = busRoutesResult.name
|
||||
parameters.startName = PinYinUtil.getPinYinHeadChar(currentStation.name)
|
||||
parameters.endName = PinYinUtil.getPinYinHeadChar(nextStation.name)
|
||||
parameters.startLatLon =
|
||||
AutopilotControlParameters.AutoPilotLonLat(currentStation.lat, currentStation.lon)
|
||||
parameters.endLatLon =
|
||||
AutopilotControlParameters.AutoPilotLonLat(nextStation.lat, nextStation.lon)
|
||||
parameters.vehicleType = 10
|
||||
if (parameters.autoPilotLine == null) {
|
||||
parameters.autoPilotLine = AutopilotControlParameters.AutoPilotLine(
|
||||
busRoutesResult.lineId.toLong(), busRoutesResult.name,
|
||||
busRoutesResult.csvFileUrl, busRoutesResult.csvFileMd5,
|
||||
busRoutesResult.txtFileUrl, busRoutesResult.txtFileMd5,
|
||||
busRoutesResult.contrailSaveTime, busRoutesResult.carModel,
|
||||
busRoutesResult.csvFileUrlDPQP, busRoutesResult.csvFileMd5DPQP,
|
||||
busRoutesResult.txtFileUrlDPQP, busRoutesResult.txtFileMd5DPQP,
|
||||
busRoutesResult.contrailSaveTimeDPQP
|
||||
)
|
||||
}
|
||||
return parameters
|
||||
}
|
||||
|
||||
|
||||
private fun clearAutopilotControlParameters() {
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "AutopilotControlParameters is clear.")
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(null)
|
||||
}
|
||||
}
|
||||
@@ -263,7 +263,7 @@ public class TaxiModel {
|
||||
//更新接单状态
|
||||
public void updateCarStatus() {
|
||||
if (!LoginStatusManager.isLogin()) {
|
||||
LoginStatusManager.queryLoginStatusByNet();
|
||||
LoginStatusManager.queryLoginStatusByNet(false);
|
||||
return;
|
||||
}
|
||||
boolean currentOrderStatus = LoginStatusManager.isOpenOrderType();
|
||||
@@ -280,7 +280,7 @@ public class TaxiModel {
|
||||
// 上个状态是暂停接单 暂停成功
|
||||
VoiceNotice.showNotice("开始接单啦!");
|
||||
}
|
||||
LoginStatusManager.queryLoginStatusByNet();
|
||||
LoginStatusManager.queryLoginStatusByNet(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1063,7 +1063,7 @@ public class TaxiModel {
|
||||
if (ConnectivityManager.CONNECTIVITY_ACTION.equals(intentStr)) {
|
||||
if (NetworkUtils.isConnected(mContext)) {
|
||||
startOrStopOrderLoop(LoginStatusManager.isLogin() && LoginStatusManager.isOpenOrderType());
|
||||
LoginStatusManager.queryLoginStatusByNet();
|
||||
LoginStatusManager.queryLoginStatusByNet(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -377,31 +377,29 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
|
||||
fun onReceiveBadCaseRecord(msgBoxBean: MsgBoxBean, activity: Activity, countdown: Boolean) {
|
||||
CallerLogger.d("$M_DEVA$TAG", "收到录包结果回调${record}")
|
||||
CallerLogger.d("$M_DEVA$TAG", "开始创建被动录包弹窗,window num=${BadCaseConfig.windowNum}")
|
||||
if(!ProjectUtils.isSaas()){
|
||||
ThreadUtils.runOnUiThread {
|
||||
val passiveBadCaseWindow = PassiveBadCaseWindow(activity)
|
||||
passiveBadCaseWindow.setRecord(msgBoxBean)
|
||||
passiveBadCaseWindow.setClickListener(object : PassiveBadCaseWindow.ClickListener {
|
||||
override fun closeWindow() {
|
||||
passiveBadCaseWindow.hideFloatWindow()
|
||||
}
|
||||
})
|
||||
passiveBadCaseWindow.showFloatWindow()
|
||||
if (countdown) {
|
||||
val countDownTimer = object : CountDownTimer(10000, 10000) {
|
||||
override fun onTick(p0: Long) {
|
||||
}
|
||||
|
||||
override fun onFinish() {
|
||||
//如果有页面操作,则不自动关闭窗口
|
||||
if(!passiveBadCaseWindow.isOperated()){
|
||||
passiveBadCaseWindow.hideFloatWindow()
|
||||
BadCaseConfig.windowNum--
|
||||
}
|
||||
}
|
||||
}
|
||||
countDownTimer.start()
|
||||
ThreadUtils.runOnUiThread {
|
||||
val passiveBadCaseWindow = PassiveBadCaseWindow(activity)
|
||||
passiveBadCaseWindow.setRecord(msgBoxBean)
|
||||
passiveBadCaseWindow.setClickListener(object : PassiveBadCaseWindow.ClickListener {
|
||||
override fun closeWindow() {
|
||||
passiveBadCaseWindow.hideFloatWindow()
|
||||
}
|
||||
})
|
||||
passiveBadCaseWindow.showFloatWindow()
|
||||
if (countdown) {
|
||||
val countDownTimer = object : CountDownTimer(10000, 10000) {
|
||||
override fun onTick(p0: Long) {
|
||||
}
|
||||
|
||||
override fun onFinish() {
|
||||
//如果有页面操作,则不自动关闭窗口
|
||||
if(!passiveBadCaseWindow.isOperated()){
|
||||
passiveBadCaseWindow.hideFloatWindow()
|
||||
BadCaseConfig.windowNum--
|
||||
}
|
||||
}
|
||||
}
|
||||
countDownTimer.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -469,6 +467,7 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
|
||||
if (!FunctionBuildConfig.isDemoMode && (recordPanel.stat == 100 || recordPanel.stat == 101) && recordPanel.type != 2) {
|
||||
//只在司机屏生效,乘客屏不生效
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.RECORD, RecordBagMsg(
|
||||
|
||||
@@ -2,12 +2,14 @@ package com.zhjt.mogo_core_function_devatools.coldstart
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.datacenter.IDataCenterBizListener
|
||||
import com.mogo.eagle.core.function.api.och.IOchFunctionCallNotify
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.datacenter.CallerDataCenterBizListener
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils.millis2String
|
||||
import com.zhjt.mogo.adas.data.AdasConstants
|
||||
@@ -44,23 +46,26 @@ object ColdStartManager: IMoGoAutopilotStatusListener, IDataCenterBizListener {
|
||||
status: AdasConstants.IpcConnectionStatus,
|
||||
reason: String?
|
||||
){
|
||||
//域控连接异常
|
||||
if(status != AdasConstants.IpcConnectionStatus.CONNECTED){
|
||||
//当前进入主页方式为立即用车,则在主页面不再展示冷启动页面
|
||||
if(isColdStartNow && !isColdStartSuccess){
|
||||
return
|
||||
}
|
||||
if(isColdStartNow && ColdStartConfig.getColdStartNowTime() > ColdStartConfig.getColdStartSuccessTime()){
|
||||
return
|
||||
}
|
||||
//已登录且距离上次冷启动成功超过1分钟,再次展示冷启动页面
|
||||
if(!ColdStartConfig.getShowWindowStatus() && loginStatus && System.currentTimeMillis().minus(ColdStartConfig.getColdStartSuccessTime())>60000){
|
||||
if(System.currentTimeMillis().minus(ipcConnectedTime) > 60000){
|
||||
CallerHmiManager.showColdStartWindow()
|
||||
//冷启动只上司机屏
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
//域控连接异常
|
||||
if(status != AdasConstants.IpcConnectionStatus.CONNECTED){
|
||||
//当前进入主页方式为立即用车,则在主页面不再展示冷启动页面
|
||||
if(isColdStartNow && !isColdStartSuccess){
|
||||
return
|
||||
}
|
||||
if(isColdStartNow && ColdStartConfig.getColdStartNowTime() > ColdStartConfig.getColdStartSuccessTime()){
|
||||
return
|
||||
}
|
||||
//已登录且距离上次冷启动成功超过1分钟,再次展示冷启动页面
|
||||
if(!ColdStartConfig.getShowWindowStatus() && loginStatus && System.currentTimeMillis().minus(ColdStartConfig.getColdStartSuccessTime())>60000){
|
||||
if(System.currentTimeMillis().minus(ipcConnectedTime) > 60000){
|
||||
CallerHmiManager.showColdStartWindow()
|
||||
}
|
||||
}
|
||||
}else{
|
||||
ipcConnectedTime = System.currentTimeMillis()
|
||||
}
|
||||
}else{
|
||||
ipcConnectedTime = System.currentTimeMillis()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.mogo.commons.env.ProjectUtils
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.report.ReportEntity
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
@@ -114,12 +115,15 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor(
|
||||
if (isShowData) {
|
||||
if (category == MsgCategory.RECORD_BAG) {
|
||||
if (!FunctionBuildConfig.isDemoMode && FunctionBuildConfig.isShowBagRecordWindow) {
|
||||
//弹出被动录包弹窗
|
||||
CallerDevaToolsManager.onReceiveBadCaseRecord(
|
||||
msgBoxBean,
|
||||
context as Activity,
|
||||
true
|
||||
)
|
||||
//660开始saas环境下原有的接管录包弹窗不弹了,其他环境下还弹
|
||||
if(!ProjectUtils.isSaas()){
|
||||
//弹出被动录包弹窗
|
||||
CallerDevaToolsManager.onReceiveBadCaseRecord(
|
||||
msgBoxBean,
|
||||
context as Activity,
|
||||
true
|
||||
)
|
||||
}
|
||||
CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true)
|
||||
}
|
||||
} else if (category == MsgCategory.SYS_INFO) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.mogo.commons.env.ProjectUtils
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.report.ReportEntity
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
@@ -102,12 +103,15 @@ class MsgBoxToastView @JvmOverloads constructor(
|
||||
if (isShowData) {
|
||||
if (category == MsgCategory.RECORD_BAG) {
|
||||
if (!FunctionBuildConfig.isDemoMode && FunctionBuildConfig.isShowBagRecordWindow) {
|
||||
//弹出被动录包弹窗
|
||||
CallerDevaToolsManager.onReceiveBadCaseRecord(
|
||||
msgBoxBean,
|
||||
context as Activity,
|
||||
true
|
||||
)
|
||||
//660开始saas环境下原有的接管录包弹窗不弹了,其他环境下还弹
|
||||
if(!ProjectUtils.isSaas()){
|
||||
//弹出被动录包弹窗
|
||||
CallerDevaToolsManager.onReceiveBadCaseRecord(
|
||||
msgBoxBean,
|
||||
context as Activity,
|
||||
true
|
||||
)
|
||||
}
|
||||
CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true)
|
||||
}
|
||||
} else if (category == MsgCategory.SYS_INFO) {
|
||||
|
||||
@@ -2,23 +2,18 @@ package com.mogo.eagle.core.function.hmi.ui.operate.preferences
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.text.Editable
|
||||
import android.util.AttributeSet
|
||||
import android.widget.EditText
|
||||
import android.widget.TextView
|
||||
import androidx.core.widget.doAfterTextChanged
|
||||
import androidx.core.widget.doBeforeTextChanged
|
||||
import androidx.core.widget.doOnTextChanged
|
||||
import androidx.preference.Preference
|
||||
import androidx.preference.PreferenceViewHolder
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClickWidthDuration
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import java.math.BigDecimal
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import kotlin.math.max
|
||||
|
||||
class PreferenceWithSpeedSetting : Preference {
|
||||
|
||||
@@ -74,7 +69,7 @@ class PreferenceWithSpeedSetting : Preference {
|
||||
if (cache.containsKey(key)) {
|
||||
cur = cache[key] ?: cur
|
||||
}
|
||||
cur = BigDecimal.valueOf(cur).setScale(1).toDouble()
|
||||
cur = cur.safeScale()
|
||||
if (speedLimit is EditText) {
|
||||
speedLimit.setText(cur.toString())
|
||||
speedLimit.doAfterTextChanged { text ->
|
||||
@@ -89,14 +84,13 @@ class PreferenceWithSpeedSetting : Preference {
|
||||
btnOk.isEnabled = false
|
||||
holder.itemView.isEnabled = false
|
||||
ll.isSelected = false
|
||||
ToastUtils.showShort("阈值最大为${BigDecimal.valueOf(max).setScale(1)}$unit")
|
||||
ToastUtils.showShort("阈值最大为${max.safeScale()}$unit")
|
||||
return@doAfterTextChanged
|
||||
}
|
||||
val temp = BigDecimal.valueOf(current).setScale(1).toDouble()
|
||||
val temp = current.safeScale()
|
||||
if (cur == temp) {
|
||||
return@doAfterTextChanged
|
||||
}
|
||||
Logger.d("RWJ", "--- cache ---- 2 ---: $cur, $temp")
|
||||
cur = temp
|
||||
btnOk.isEnabled = true
|
||||
ll.isSelected = true
|
||||
@@ -115,7 +109,7 @@ class PreferenceWithSpeedSetting : Preference {
|
||||
minus.onClickWidthDuration(100) {
|
||||
val minusAfter = cur - step
|
||||
if (minusAfter < min) {
|
||||
ToastUtils.showShort("阈值最小为${BigDecimal.valueOf(min).setScale(1)}$unit")
|
||||
ToastUtils.showShort("阈值最小为${min.safeScale()}$unit")
|
||||
return@onClickWidthDuration
|
||||
}
|
||||
cur = minusAfter
|
||||
@@ -135,7 +129,7 @@ class PreferenceWithSpeedSetting : Preference {
|
||||
add.onClickWidthDuration(100) {
|
||||
val addAfter = cur + step
|
||||
if (addAfter > max) {
|
||||
ToastUtils.showShort("阈值最大为${BigDecimal.valueOf(max).setScale(1)}$unit")
|
||||
ToastUtils.showShort("阈值最大为${max.safeScale()}$unit")
|
||||
return@onClickWidthDuration
|
||||
}
|
||||
holder.itemView.isEnabled = false
|
||||
@@ -159,4 +153,8 @@ class PreferenceWithSpeedSetting : Preference {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun Double.safeScale(s: Int = 1): Double {
|
||||
return runCatching { BigDecimal.valueOf(this).setScale(s).toDouble() }.getOrNull() ?: this
|
||||
}
|
||||
}
|
||||
@@ -39,21 +39,30 @@ class VisualAngleToggleView : FrameLayout, IMoGoVisualAngleChangeProvider.OnMoGo
|
||||
val defaultSlop = AutoSizeUtils.dp2px(context, 12.0f)
|
||||
val scrollSlop = max(context.let { ViewConfiguration.get(it).scaledTouchSlop }, defaultSlop)
|
||||
val gestureDetector = GestureDetector(context, object : GestureDetector.SimpleOnGestureListener() {
|
||||
|
||||
private var flag = false
|
||||
|
||||
override fun onDown(e: MotionEvent): Boolean {
|
||||
flag = false
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onScroll(e1: MotionEvent, e2: MotionEvent, distanceX: Float, distanceY: Float): Boolean {
|
||||
if (flag) {
|
||||
return super.onScroll(e1, e2, distanceX, distanceY)
|
||||
}
|
||||
val absX = abs(e2.x - e1.x)
|
||||
val absY = abs(e2.y - e1.y)
|
||||
if (absY <= absX) {
|
||||
return false
|
||||
}
|
||||
if (e2.y - e1.y >= scrollSlop) {
|
||||
flag = true
|
||||
moveToBottom()
|
||||
return true
|
||||
}
|
||||
if (e1.y - e2.y >= scrollSlop) {
|
||||
flag = true
|
||||
moveToTop()
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
|
||||
|
||||
private val prevScene by lazy { AtomicReference<Scene>() }
|
||||
|
||||
private var timerJob: Job? = null
|
||||
|
||||
private val listener = object : IMoGoMapRoadListener {
|
||||
private val roadId = AtomicReference<String>()
|
||||
@@ -207,23 +206,7 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
|
||||
DOWN -> CallerMapUIServiceManager.getMapUIController()?.setScreenToOriginDis(5.0f)
|
||||
}
|
||||
if (target !is Roma) {
|
||||
if (target is LongSight) {
|
||||
timerJob?.safeCancel()
|
||||
scope.launch {
|
||||
CallerMapUIServiceManager.getMapUIController()?.setAllGesturesEnabled(false)
|
||||
itx.changeMapVisualAngle(angle, null)
|
||||
delay(3000)
|
||||
CallerMapUIServiceManager.getMapUIController()?.setAllGesturesEnabled(true)
|
||||
}.also {
|
||||
it.invokeOnCompletion {
|
||||
CallerMapUIServiceManager.getMapUIController()?.setAllGesturesEnabled(true)
|
||||
}
|
||||
timerJob = it
|
||||
}
|
||||
} else {
|
||||
timerJob?.safeCancel()
|
||||
itx.changeMapVisualAngle(angle, null)
|
||||
}
|
||||
itx.changeMapVisualAngle(angle, null)
|
||||
}
|
||||
} finally {
|
||||
if (prev == null || prev.javaClass != target.javaClass) {
|
||||
|
||||
@@ -83,7 +83,7 @@ MOGO_TELEMATIC_VERSION=1.4.7.42
|
||||
MOGO_SKIN_VERSION=1.4.7.49.3-debug
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 自研地图
|
||||
MAP_SDK_VERSION=3.4.1.15
|
||||
MAP_SDK_VERSION=3.4.1.16
|
||||
MAP_SDK_DATA_VERSION=1.0.0.9
|
||||
MAP_SDK_OPERATION_VERSION=1.1.4.1
|
||||
# websocket
|
||||
|
||||
Reference in New Issue
Block a user