Merge branch 'merge646_2_master' into 'master'
Merge646 2 master See merge request SCA/L4HA/AndroidApp/MoGoEagleEye!868
This commit is contained in:
@@ -48,6 +48,7 @@ import com.mogo.och.bus.util.BusSendTripInfoManager;
|
||||
import com.mogo.och.bus.util.BusTrajectoryManager;
|
||||
import com.mogo.och.bus.util.BusVoiceManager;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager;
|
||||
import com.mogo.och.common.module.manager.autopilot.line.LineManager;
|
||||
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.bean.AppConnectMsg;
|
||||
@@ -197,6 +198,8 @@ public class OrderModel {
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化调用
|
||||
// 登录状态发生变化调用
|
||||
public void queryBusCacheRoutes(){
|
||||
|
||||
String loginStr = CacheDataManager.Companion.getInstance().getCacheData(
|
||||
@@ -500,7 +503,7 @@ public class OrderModel {
|
||||
closeBeautificationMode();
|
||||
clearStartAutopilotTag();
|
||||
removeTipRunnables();
|
||||
|
||||
updateBusStatus(null);
|
||||
CacheDataManager.Companion.getInstance().clearCacheData(mContext, BusCacheKey.BUS_LINE_CACHE);
|
||||
return;
|
||||
}
|
||||
@@ -720,7 +723,7 @@ public class OrderModel {
|
||||
FunctionBuildConfig.isPassStartAutopilotCommand);
|
||||
|
||||
//3、距离轨迹15m计算
|
||||
String resion = TrajectoryAndDistanceManager.INSTANCE.canStartAutopilot((long)busRoutesResult.getLineId());
|
||||
String resion = OchAutoPilotManager.canStartAutoPilot(busRoutesResult.getLineId());
|
||||
if(TrajectoryAndDistanceManager.errorTypeNoneLineId.equals(resion)){
|
||||
MogoLocation nextStationPoint = new MogoLocation();
|
||||
if (backgroundCurrentStationIndex < stationList.size() - 1) {
|
||||
@@ -733,7 +736,7 @@ public class OrderModel {
|
||||
currentStationPoint.setLongitude(busStationBean.getGcjLon());
|
||||
currentStationPoint.setLatitude(busStationBean.getGcjLat());
|
||||
setTrajectoryStation(currentStationPoint,nextStationPoint, (long)busRoutesResult.getLineId());
|
||||
resion = TrajectoryAndDistanceManager.INSTANCE.canStartAutopilot((long)busRoutesResult.getLineId());
|
||||
resion = OchAutoPilotManager.canStartAutoPilot(busRoutesResult.getLineId());
|
||||
}
|
||||
if(!StringUtils.isEmpty(resion)){
|
||||
ToastUtils.showShort(resion);
|
||||
@@ -742,9 +745,7 @@ public class OrderModel {
|
||||
}
|
||||
|
||||
//4、ssm 给出数据
|
||||
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()) {
|
||||
ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() +
|
||||
", 请稍候重试");
|
||||
if (!OchAutoPilotManager.canStartAutoPilotSSM()) {
|
||||
triggerUnableStartAPReasonEvent();
|
||||
return;
|
||||
}
|
||||
@@ -962,11 +963,15 @@ public class OrderModel {
|
||||
* @param result
|
||||
*/
|
||||
private void updateBusStatus(BusRoutesResult result) {
|
||||
if (result == null) return;
|
||||
if (result == null) {
|
||||
LineManager.setLineId(-1);
|
||||
return;
|
||||
}
|
||||
busRoutesResult = result;
|
||||
List<BusStationBean> site = result.getSites();
|
||||
currentTaskId = result.getTaskId();
|
||||
currentLineId = result.getLineId();
|
||||
LineManager.setLineId(currentLineId);
|
||||
stationList.clear();
|
||||
stationList.addAll(site);
|
||||
|
||||
|
||||
@@ -258,6 +258,7 @@
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.RomaTaxiView
|
||||
android:id="@+id/rtv_switch"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -267,6 +268,14 @@
|
||||
app:roma_close_bg="@drawable/common_driverroma_normal"
|
||||
app:roma_open_bg="@drawable/common_driver_roma_press" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.map.drawline.LineView
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/rtv_switch"
|
||||
android:layout_marginStart="-11dp"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.RomaDistanceView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -310,7 +319,7 @@
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.ConnectionProcessView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_18"
|
||||
android:layout_marginBottom="@dimen/dp_26"
|
||||
app:layout_constraintBottom_toTopOf="@id/viewVersionName"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -110,9 +110,9 @@ class PM2HPMapFragment :
|
||||
it?.let{
|
||||
builder.rotate(it.angle.toFloat())
|
||||
}
|
||||
val overlayManager = getOverlayManager()
|
||||
overlayManager?.showOrUpdatePoint(builder.build())
|
||||
}
|
||||
val overlayManager = getOverlayManager()
|
||||
overlayManager?.showOrUpdatePoint(builder.build())
|
||||
}
|
||||
OCHThreadPoolManager.getsInstance().execute(setMapMarkerRunnable)
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ import com.mogo.och.common.module.manager.CharterSendTripInfoManager.END_TRIP
|
||||
import com.mogo.och.common.module.manager.CharterSendTripInfoManager.START_TRIP
|
||||
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager
|
||||
import com.mogo.och.common.module.manager.autopilot.line.LineManager
|
||||
import com.mogo.och.common.module.manager.device.LightAirconditionDoorManager
|
||||
import com.mogo.och.common.module.manager.device.LightAirconditionDoorStatusManager
|
||||
import com.mogo.och.common.module.manager.socket.cloud.AbnormalFactorsLoopManager.startLoopAbnormalFactors
|
||||
@@ -502,14 +503,10 @@ class DriverM1Model {
|
||||
if (!CallerAutoPilotControlManager.isCanStartAutopilot(true)) {
|
||||
return
|
||||
}
|
||||
// ssm 给出数据
|
||||
if (!OCHAdasAbilityManager.getInstance().autopilotAbilityStatus) {
|
||||
ToastUtils.showLong(
|
||||
OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason +
|
||||
", 请稍候重试"
|
||||
)
|
||||
triggerUnableStartAPReasonEvent()
|
||||
return
|
||||
//4、ssm 给出数据
|
||||
if (!OchAutoPilotManager.canStartAutoPilotSSM()) {
|
||||
triggerUnableStartAPReasonEvent();
|
||||
return;
|
||||
}
|
||||
|
||||
triggerStartServiceEvent(false, false)
|
||||
@@ -697,6 +694,7 @@ class DriverM1Model {
|
||||
if (TextUtils.isEmpty(data.data.orderNo)){//还未换车,显示还车状态
|
||||
mOrderCallback?.updateReturnCarStatus(false)
|
||||
mCurrentOrder = null
|
||||
LineManager.setLineId(-1)
|
||||
currentChangeDestMsg = null
|
||||
sendCharterEndTripInfo()
|
||||
startOrStopCheckCountDown(false)
|
||||
@@ -710,6 +708,7 @@ class DriverM1Model {
|
||||
mOrderCallback?.updateReturnCarStatus(true)
|
||||
clearAutopilotControlParameters()
|
||||
mCurrentOrder = null
|
||||
LineManager.setLineId(-1)
|
||||
currentChangeDestMsg = null
|
||||
isArrivedStation = false
|
||||
startOrStopCheckCountDown(false)
|
||||
@@ -736,6 +735,7 @@ class DriverM1Model {
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "data.data is null")
|
||||
isArrivedStation = false
|
||||
mCurrentOrder = null
|
||||
LineManager.setLineId(-1)
|
||||
queryCurrentServiceStatus()
|
||||
return
|
||||
}
|
||||
@@ -749,6 +749,14 @@ class DriverM1Model {
|
||||
|
||||
mCurrentOrder = data.data
|
||||
|
||||
mCurrentOrder?.lineId.let {
|
||||
if (it == null || it < 0) {
|
||||
LineManager.setLineId(-1)
|
||||
} else {
|
||||
LineManager.setLineId(it)
|
||||
}
|
||||
}
|
||||
|
||||
updateToClientData()
|
||||
|
||||
mOrderCallback?.updateOrderUI(data.data)
|
||||
|
||||
@@ -243,6 +243,14 @@
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
|
||||
<com.mogo.och.common.module.wigets.map.drawline.LineView
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/reportworkorderview"
|
||||
android:layout_marginStart="-11dp"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAutopilotDisable"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -349,7 +357,7 @@
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.ConnectionProcessView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_18"
|
||||
android:layout_marginBottom="@dimen/dp_26"
|
||||
app:layout_constraintBottom_toTopOf="@id/viewVersionName"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -1146,13 +1146,9 @@ object CharterPassengerModel {
|
||||
if (!CallerAutoPilotControlManager.isCanStartAutopilot(true)) {
|
||||
return
|
||||
}
|
||||
// 4、ssm 给出数据
|
||||
if (!OCHAdasAbilityManager.getInstance().autopilotAbilityStatus) {
|
||||
ToastCharterUtils.showToastLong(
|
||||
OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason +
|
||||
", 请稍候重试"
|
||||
)
|
||||
return
|
||||
//4、ssm 给出数据
|
||||
if (!OchAutoPilotManager.canStartAutoPilotSSM()) {
|
||||
return;
|
||||
}
|
||||
val parameters = initAutopilotControlParameters()
|
||||
if (null == parameters) {
|
||||
|
||||
@@ -59,9 +59,18 @@ public class OCHAdasAbilityManager implements IMoGoAutopilotActionsListener, IMo
|
||||
return isAutopilotAbility;
|
||||
}
|
||||
|
||||
public String getAbilityVersion() {
|
||||
return launchConditionData == null ? "" : launchConditionData.abilityVersion;
|
||||
}
|
||||
|
||||
public String getOriginalData() {
|
||||
return launchConditionData == null ? "" : launchConditionData.getJson();
|
||||
}
|
||||
|
||||
public ArrayList<UnableLaunchReason> getUnableAutopilotReasons() {
|
||||
return unableAutopilotReasons;
|
||||
}
|
||||
|
||||
public String getAutopilotUnAbilityReason(){
|
||||
try {
|
||||
if(unableAutopilotReasons==null||unableAutopilotReasons.isEmpty()){
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
package com.mogo.och.common.module.manager.autopilot.autopilot
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.msgbox.AutopilotMsg
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoReceiveReceivedAckListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerReceiveReceivedAckListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager
|
||||
import com.mogo.och.common.module.manager.autopilot.line.LineManager
|
||||
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager
|
||||
import com.zhjt.mogo.adas.common.MessageType
|
||||
import com.zhjt.mogo.adas.data.bean.ReceivedAck
|
||||
import com.zhjt.mogo.adas.data.bean.ReceivedAck.Status
|
||||
@@ -15,6 +24,42 @@ object OchAutoPilotManager : IMoGoReceiveReceivedAckListener {
|
||||
CallerReceiveReceivedAckListenerManager.addListener(TAG,this)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun canStartAutoPilot(lineId: Number?): String {
|
||||
return TrajectoryAndDistanceManager.canStartAutopilot(lineId).apply {
|
||||
if (!isNullOrBlank()) {
|
||||
// 去启动绘制高精地图上的轨迹
|
||||
val drawGlobalTrajectory = LineManager.drawGlobalTrajectory()
|
||||
if (!drawGlobalTrajectory.first) {
|
||||
ToastUtils.showLong(drawGlobalTrajectory.second)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun canStartAutoPilotSSM(): Boolean {
|
||||
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().autopilotAbilityStatus) {
|
||||
val reasons = OCHAdasAbilityManager.getInstance().unableAutopilotReasons
|
||||
if ("AutopilotAbility440" == OCHAdasAbilityManager.getInstance().abilityVersion && !reasons.isNullOrEmpty()) {
|
||||
val msg = reasons[0].unableLaunchReason + " 来源:" + reasons[0].source
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.AUTOPILOT,
|
||||
AutopilotMsg(0, "自动驾驶启动失败", msg, System.currentTimeMillis())
|
||||
)
|
||||
)
|
||||
} else {
|
||||
ToastUtils.showLong(
|
||||
OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason +
|
||||
", 请稍候重试"
|
||||
);
|
||||
}
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun startAutoPilot(controlParameters: AutopilotControlParameters?) {
|
||||
OchAutopilotAnalytics.triggerStartAutopilotParameters(controlParameters)
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.mogo.och.common.module.manager.autopilot.line;
|
||||
|
||||
|
||||
public interface ILineCallback {
|
||||
default void clearLineSuccess(){}
|
||||
default void drawLineSuccess(){}
|
||||
|
||||
default void drawLineFail(){}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.mogo.och.common.module.manager.autopilot.line
|
||||
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapGlobalTrajectoryDrawManager
|
||||
import com.mogo.och.common.module.utils.CallerBase
|
||||
|
||||
/**
|
||||
* 订单中
|
||||
*/
|
||||
object LineManager : CallerBase<ILineCallback>() {
|
||||
private var lineId: Int = -1
|
||||
@JvmStatic
|
||||
fun setLineId(value: Int) {
|
||||
lineId = if (value < 0) {
|
||||
clearGlobalTrajectory(true)
|
||||
-1
|
||||
} else {
|
||||
value
|
||||
}
|
||||
}
|
||||
@JvmStatic
|
||||
fun setLineId(value: Long) {
|
||||
lineId = if (value < 0) {
|
||||
clearGlobalTrajectory(true)
|
||||
-1
|
||||
} else {
|
||||
value.toInt()
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getLineId():Int{
|
||||
return lineId
|
||||
}
|
||||
|
||||
override fun doSomeAfterAddListener(tag: String, listener: ILineCallback) {
|
||||
super.doSomeAfterAddListener(tag, listener)
|
||||
if (hasDrawnGlobalTrajectory()) {
|
||||
listener.drawLineSuccess()
|
||||
}else{
|
||||
listener.drawLineFail()
|
||||
}
|
||||
}
|
||||
|
||||
fun hasDrawnGlobalTrajectory(): Boolean {
|
||||
return CallerMapGlobalTrajectoryDrawManager.hasDrawnGlobalTrajectory()
|
||||
}
|
||||
|
||||
fun clearGlobalTrajectory(isClearData: Boolean) {
|
||||
CallerMapGlobalTrajectoryDrawManager.clearGlobalTrajectory(isClearData)
|
||||
if (!hasDrawnGlobalTrajectory()){
|
||||
M_LISTENERS.forEach {
|
||||
it.value.clearLineSuccess()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun drawGlobalTrajectory(): Pair<Boolean, String> {
|
||||
if(lineId<0){
|
||||
return Pair(false,"请设置正确线路或订单")
|
||||
}
|
||||
return CallerMapGlobalTrajectoryDrawManager.drawGlobalTrajectory().apply {
|
||||
if(first){
|
||||
M_LISTENERS.forEach {
|
||||
it.value.drawLineSuccess()
|
||||
}
|
||||
}else{
|
||||
M_LISTENERS.forEach {
|
||||
it.value.drawLineFail()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -660,13 +660,13 @@ object TrajectoryAndDistanceManager : IMoGoPlanningRottingListener {
|
||||
* 返回空为可启动自驾
|
||||
* 返回其他不可启动自驾 返回为原因
|
||||
*/
|
||||
fun canStartAutopilot(lineId: Long?): String {
|
||||
fun canStartAutopilot(lineId: Number?): String {
|
||||
if (lineId == null) {
|
||||
OchAutopilotAnalytics.triggerDistance2LineorStation("未传轨迹ID")
|
||||
return "请确认线路ID"
|
||||
}
|
||||
|
||||
OchAutopilotAnalytics.triggerDistance2LineorStation("条件记录:lineId:${lineId}----this.lineId:${this.lineId}")
|
||||
OchAutopilotAnalytics.triggerDistance2LineorStation("条件记录:lineId:${lineId}----this.lineId:${this.lineId}、mRoutePoints情况:${mRoutePoints?.size}")
|
||||
|
||||
try {
|
||||
if (mRoutePoints.isNullOrEmpty()) {
|
||||
@@ -688,7 +688,7 @@ object TrajectoryAndDistanceManager : IMoGoPlanningRottingListener {
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
distanceWithTrajectory(mRoutePoints!!,currentPoint)
|
||||
} else {
|
||||
if (lineId != this.lineId) {
|
||||
if (lineId.toLong() != this.lineId) {
|
||||
// 判断距离起始站的距离
|
||||
distanceWithStartStation()
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.mogo.och.common.module.wigets.map.drawline
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.findViewTreeViewModelStoreOwner
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.R
|
||||
import com.mogo.och.common.module.manager.autopilot.line.LineManager
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class LineView : AppCompatImageView, LineViewModel.ILineViewCallback {
|
||||
|
||||
private val TAG = "LineView"
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attributeSet,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
private fun initView() {
|
||||
setImageResource(R.drawable.common_map_line_close)
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
|
||||
onClick {
|
||||
if (LineManager.hasDrawnGlobalTrajectory()) {
|
||||
LineManager.clearGlobalTrajectory(false)
|
||||
} else {
|
||||
val drawGlobalTrajectory = LineManager.drawGlobalTrajectory()
|
||||
if (!drawGlobalTrajectory.first) {
|
||||
ToastUtils.showLong(drawGlobalTrajectory.second)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val viewModel = findViewTreeViewModelStoreOwner()?.let {
|
||||
ViewModelProvider(it).get(LineViewModel::class.java)
|
||||
}
|
||||
viewModel?.setDistanceCallback(this)
|
||||
|
||||
}
|
||||
|
||||
|
||||
init {
|
||||
try {
|
||||
initView()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
override fun setImageViewResource(name: Int) {
|
||||
setImageResource(name)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.mogo.och.common.module.wigets.map.drawline
|
||||
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.mogo.och.common.module.R
|
||||
import com.mogo.och.common.module.manager.autopilot.line.ILineCallback
|
||||
import com.mogo.och.common.module.manager.autopilot.line.LineManager
|
||||
|
||||
class LineViewModel : ViewModel(), ILineCallback {
|
||||
|
||||
private val TAG = LineViewModel::class.java.simpleName
|
||||
|
||||
private var viewCallback: ILineViewCallback? = null
|
||||
|
||||
init {
|
||||
|
||||
}
|
||||
|
||||
override fun onCleared() {
|
||||
super.onCleared()
|
||||
LineManager.removeListener(TAG)
|
||||
this.viewCallback = null
|
||||
}
|
||||
|
||||
fun setDistanceCallback(viewCallback: ILineViewCallback) {
|
||||
LineManager.addListener(TAG,this)
|
||||
this.viewCallback = viewCallback
|
||||
}
|
||||
|
||||
override fun clearLineSuccess() {
|
||||
this.viewCallback?.setImageViewResource(R.drawable.common_map_line_close)
|
||||
}
|
||||
|
||||
override fun drawLineSuccess() {
|
||||
this.viewCallback?.setImageViewResource(R.drawable.common_map_line_open)
|
||||
}
|
||||
|
||||
override fun drawLineFail() {
|
||||
this.viewCallback?.setImageViewResource(R.drawable.common_map_line_close)
|
||||
}
|
||||
|
||||
interface ILineViewCallback {
|
||||
fun setImageViewResource(@DrawableRes name: Int)
|
||||
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,7 @@ class OrderStatusView : AppCompatImageView, OrderStatusViewModel.IVisualCallback
|
||||
)
|
||||
|
||||
private fun initView() {
|
||||
setImageResource(R.drawable.common_visual_medium)
|
||||
setImageResource(R.drawable.common_status_unorder)
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
@@ -24,6 +24,7 @@ import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.StringUtils;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager;
|
||||
import com.mogo.och.common.module.manager.autopilot.line.LineManager;
|
||||
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager;
|
||||
import com.mogo.och.common.module.manager.socket.lan.LanSocketManager;
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.BusinessType;
|
||||
@@ -398,6 +399,7 @@ public class OrderModel {
|
||||
if (refreshBusStationsCallback != null) {
|
||||
refreshBusStationsCallback.updateEmptyUi();
|
||||
}
|
||||
updateBusStatus(null);
|
||||
clearAutopilotControlParameters();
|
||||
closeBeautificationMode();
|
||||
clearStartAutopilotTag();
|
||||
@@ -651,7 +653,7 @@ public class OrderModel {
|
||||
}
|
||||
// 3、距离轨迹15m计算
|
||||
//3、距离轨迹15m计算
|
||||
String resion = TrajectoryAndDistanceManager.INSTANCE.canStartAutopilot((long)busRoutesResult.getLineId());
|
||||
String resion = OchAutoPilotManager.canStartAutoPilot(busRoutesResult.getLineId());
|
||||
if(TrajectoryAndDistanceManager.errorTypeNoneLineId.equals(resion)){
|
||||
MogoLocation nextStationPoint = new MogoLocation();
|
||||
if (backgroundCurrentStationIndex < stationList.size() - 1) {
|
||||
@@ -664,7 +666,7 @@ public class OrderModel {
|
||||
currentStationPoint.setLongitude(busStationBean.getGcjLon());
|
||||
currentStationPoint.setLatitude(busStationBean.getGcjLat());
|
||||
setTrajectoryStation(currentStationPoint,nextStationPoint, (long) busRoutesResult.getLineId());
|
||||
resion = TrajectoryAndDistanceManager.INSTANCE.canStartAutopilot((long)busRoutesResult.getLineId());
|
||||
resion = OchAutoPilotManager.canStartAutoPilot(busRoutesResult.getLineId());
|
||||
}
|
||||
if(!StringUtils.isEmpty(resion)){
|
||||
ToastUtils.showShort(resion);
|
||||
@@ -672,9 +674,7 @@ public class OrderModel {
|
||||
return;
|
||||
}
|
||||
//4、ssm 给出数据
|
||||
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()) {
|
||||
ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() +
|
||||
", 请稍候重试");
|
||||
if (!OchAutoPilotManager.canStartAutoPilotSSM()) {
|
||||
triggerUnableStartAPReasonEvent();
|
||||
return;
|
||||
}
|
||||
@@ -923,8 +923,12 @@ public class OrderModel {
|
||||
* @param result
|
||||
*/
|
||||
private void updateBusStatus(BusRoutesResult result) {
|
||||
if (result == null) return;
|
||||
if (result == null) {
|
||||
LineManager.setLineId(-1);
|
||||
return;
|
||||
}
|
||||
busRoutesResult = result;
|
||||
LineManager.setLineId(busRoutesResult.getLineId());
|
||||
stationList.clear();
|
||||
stationList.addAll(result.getSites());
|
||||
for (int i = 0; i < stationList.size(); i++) {
|
||||
|
||||
@@ -261,6 +261,14 @@
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
|
||||
<com.mogo.och.common.module.wigets.map.drawline.LineView
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/reportworkorderview"
|
||||
android:layout_marginStart="-11dp"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
|
||||
<com.mogo.och.shuttle.view.SlidePanelView
|
||||
android:id="@+id/module_mogo_och_slide_panel"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -355,7 +363,7 @@
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.ConnectionProcessView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_18"
|
||||
android:layout_marginBottom="@dimen/dp_26"
|
||||
app:layout_constraintBottom_toTopOf="@id/viewVersionName"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -109,9 +109,10 @@ class PM2HPMapFragment :
|
||||
it?.let{
|
||||
builder.rotate(it.angle.toFloat())
|
||||
}
|
||||
val overlayManager = CallerMapUIServiceManager.getOverlayManager()
|
||||
overlayManager?.showOrUpdatePoint(builder.build())
|
||||
}
|
||||
val overlayManager = CallerMapUIServiceManager.getOverlayManager()
|
||||
overlayManager?.showOrUpdatePoint(builder.build())
|
||||
|
||||
}
|
||||
OCHThreadPoolManager.getsInstance().execute(setMapMarkerRunnable)
|
||||
}
|
||||
|
||||
@@ -792,4 +792,9 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
public void onAutopilotTrajectoryDownloadReq(@NonNull AutopilotControlParameters.AutoPilotLine autoPilotLine, int downloadType) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFsmReceiveTimeout(boolean isTimeout) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -469,4 +469,9 @@ public class SweeperOperatePresenter extends Presenter<SweeperOperateFragment>
|
||||
@Override
|
||||
public void onAutopilotTrajectoryDownloadReq(@NonNull AutopilotControlParameters.AutoPilotLine autoPilotLine, int downloadType) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFsmReceiveTimeout(boolean isTimeout) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ import com.mogo.och.common.module.manager.autopilot.autopilot.ArrivedStation;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager;
|
||||
import com.mogo.och.common.module.manager.autopilot.line.LineManager;
|
||||
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager;
|
||||
import com.mogo.och.common.module.manager.socket.cloud.data.OCHOperationalMessage;
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusManager;
|
||||
@@ -449,6 +450,7 @@ public class TaxiModel {
|
||||
if (mOrderStatusCallback != null) {
|
||||
mOrderStatusCallback.onCurrentOrderCancelDone();
|
||||
}
|
||||
LineManager.setLineId(-1);
|
||||
clearCurrentOCHOrder();
|
||||
cancelAutopilot();
|
||||
}
|
||||
@@ -944,10 +946,10 @@ public class TaxiModel {
|
||||
}
|
||||
|
||||
//3、距离轨迹15m计算
|
||||
String resion = TrajectoryAndDistanceManager.INSTANCE.canStartAutopilot(mCurrentOCHOrder.lineId);
|
||||
String resion = OchAutoPilotManager.canStartAutoPilot(mCurrentOCHOrder.lineId);
|
||||
if(TrajectoryAndDistanceManager.errorTypeNoneLineId.equals(resion)){
|
||||
setStation();
|
||||
resion = TrajectoryAndDistanceManager.INSTANCE.canStartAutopilot(mCurrentOCHOrder.lineId);
|
||||
resion = OchAutoPilotManager.canStartAutoPilot(mCurrentOCHOrder.lineId);
|
||||
}
|
||||
if(!StringUtils.isEmpty(resion)){
|
||||
ToastUtils.showShort(resion);
|
||||
@@ -958,9 +960,7 @@ public class TaxiModel {
|
||||
CallerLogger.e(M_TAXI + TAG, "isPassStartAutopilotCommand = " +
|
||||
FunctionBuildConfig.isPassStartAutopilotCommand);
|
||||
//4、ssm 给出数据
|
||||
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()) {
|
||||
ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() +
|
||||
", 请稍候重试");
|
||||
if (!OchAutoPilotManager.canStartAutoPilotSSM()) {
|
||||
TaxiAnalyticsManager.INSTANCE.triggerUnableStartAPReasonEvent(
|
||||
mCurrentOCHOrder.startSiteAddr, mCurrentOCHOrder.endSiteAddr,
|
||||
String.valueOf(mCurrentOCHOrder.lineId),mCurrentOCHOrder.orderNo,
|
||||
|
||||
@@ -20,8 +20,8 @@ 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;
|
||||
import com.mogo.och.common.module.biz.login.OpenOrderStatusEnum;
|
||||
import com.mogo.och.common.module.biz.login.RoleEnum;
|
||||
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager;
|
||||
import com.mogo.och.common.module.manager.autopilot.line.LineManager;
|
||||
import com.mogo.och.common.module.voice.VoiceNotice;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRespBean;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRouteInfoRespBean;
|
||||
@@ -285,6 +285,7 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
|
||||
@Override
|
||||
public void onCurrentOrderStatusChanged(OrderQueryRespBean.Result order) {
|
||||
CallerLogger.d(M_TAXI + TAG, "order = " + order.toString());
|
||||
LineManager.setLineId(order.lineId);
|
||||
if (TaxiOrderStatusEnum.UserArriveAtStart.getCode() == order.orderStatus) {
|
||||
TaxiModel.getInstance().queryAutopilotStatus(true);
|
||||
TaxiModel.getInstance().setStation();
|
||||
@@ -311,6 +312,7 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
|
||||
TaxiModel.getInstance().startOrStopCalculateRouteInfo(false);
|
||||
TaxiModel.getInstance().cleanLineMarker();
|
||||
TaxiModel.getInstance().cleanStation();
|
||||
LineManager.setLineId(-1);
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
@@ -251,6 +251,7 @@
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.RomaTaxiView
|
||||
android:id="@+id/rtv_switch"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -260,6 +261,14 @@
|
||||
app:roma_close_bg="@drawable/common_driverroma_normal"
|
||||
app:roma_open_bg="@drawable/common_driver_roma_press" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.map.drawline.LineView
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/rtv_switch"
|
||||
android:layout_marginStart="-11dp"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.RomaDistanceView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -354,7 +363,7 @@
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.ConnectionProcessView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_18"
|
||||
android:layout_marginBottom="@dimen/dp_26"
|
||||
app:layout_constraintBottom_toTopOf="@id/viewVersionName"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -77,10 +77,10 @@ object AutopilotManager : IOchAutopilotStatusListener {
|
||||
return "启动自动驾驶不满足条件"
|
||||
}
|
||||
//3、距离轨迹15m计算
|
||||
var resion = TrajectoryAndDistanceManager.canStartAutopilot(TaxiPassengerModel.currentOCHOrder!!.lineId)
|
||||
var resion = OchAutoPilotManager.canStartAutoPilot(TaxiPassengerModel.currentOCHOrder!!.lineId)
|
||||
if(TrajectoryAndDistanceManager.errorTypeNoneLineId.equals(resion)){
|
||||
TaxiPassengerModel.setStation();
|
||||
resion = TrajectoryAndDistanceManager.canStartAutopilot(TaxiPassengerModel.currentOCHOrder!!.lineId);
|
||||
resion = OchAutoPilotManager.canStartAutoPilot(TaxiPassengerModel.currentOCHOrder!!.lineId);
|
||||
}
|
||||
if (!StringUtils.isEmpty(resion)) {
|
||||
ToastUtils.showShort(resion)
|
||||
@@ -88,11 +88,7 @@ object AutopilotManager : IOchAutopilotStatusListener {
|
||||
return resion
|
||||
}
|
||||
// 4、ssm 给出数据
|
||||
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().autopilotAbilityStatus) {
|
||||
ToastUtils.showLong(
|
||||
OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason +
|
||||
", 请稍候重试"
|
||||
)
|
||||
if (!OchAutoPilotManager.canStartAutoPilotSSM()) {
|
||||
TaxiPassengerAnalyticsManager.triggerUnableStartAPReasonEvent(
|
||||
TaxiPassengerModel.currentOCHOrder!!.startSiteAddr,
|
||||
TaxiPassengerModel.currentOCHOrder!!.endSiteAddr,
|
||||
|
||||
@@ -2,6 +2,9 @@ package com.mogo.och.unmanned.taxi.bean
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
|
||||
/**
|
||||
* 灰度路线信息
|
||||
*/
|
||||
data class GrayLineBean(
|
||||
var lineId: Long?, //线路id
|
||||
var lineName: String?, //线路名称
|
||||
@@ -11,18 +14,30 @@ data class GrayLineBean(
|
||||
var lineFailCount: Int?, //线路累计反馈不可用次数
|
||||
var isChoosed: Boolean = false, //当前是否选中
|
||||
var startSite: RoutingSite?,
|
||||
var endSite: RoutingSite?
|
||||
var endSite: RoutingSite?,
|
||||
var hdMapDBVersionCode: String?,// Routing 运营平台通过算路引擎算这条路时候使用的对应高精地图版本号
|
||||
var hdMapDBVersionName: String?,// Routing 运营平台通过算路引擎算这条路时候使用的对应高精地图版本名
|
||||
var routingEnginVersionCode: String?,// Routing 运营平台当前的算路引擎版本号码
|
||||
var routingEnginVersionName: String?,// Routing 运营平台当前的算路引擎版本名称
|
||||
var wayPoints: MutableList<RoutingSite>?,// Routing 给算路引擎使用的经停点列表,不是真正的要停车
|
||||
var blackPoints: MutableList<RoutingSite>?// Routing 给算路引擎使用的黑名单点,目的是不参与算路
|
||||
)
|
||||
|
||||
/**
|
||||
* 站点信息
|
||||
*/
|
||||
data class RoutingSite(
|
||||
var siteId: Long,
|
||||
var siteName: String,
|
||||
var gcjLat: Double,
|
||||
var gcjLon: Double,
|
||||
var wgs84Lon: Double,
|
||||
var wgs84Lat: Double
|
||||
var siteId: Long,// 站点ID
|
||||
var siteName: String,// 站点名称
|
||||
var gcjLat: Double,// 高德坐标
|
||||
var gcjLon: Double,// 高德坐标
|
||||
var wgs84Lon: Double,//高精坐标
|
||||
var wgs84Lat: Double//高精坐标
|
||||
)
|
||||
|
||||
/**
|
||||
* 轨迹信息
|
||||
*/
|
||||
data class ContrailBean(
|
||||
var lineId: Long = -1L,
|
||||
var lineName: String = "",
|
||||
@@ -37,32 +52,74 @@ data class ContrailBean(
|
||||
var txtFileUrlDPQP: String = "",
|
||||
var txtFileMd5DPQP: String = "",
|
||||
var contrailSaveTimeDPQP: Long = -1L,
|
||||
var version: Long = -1L
|
||||
var version: Long = -1L,
|
||||
var passPoints: MutableList<RoutingSite>?, // 用于算路的经停点
|
||||
)
|
||||
|
||||
/**
|
||||
* 查询灰度线路列表
|
||||
*/
|
||||
data class QueryGrayContrailListRsp(var data: MutableList<GrayLineBean>?) : BaseData()
|
||||
|
||||
/**
|
||||
* 通过id查询轨迹详情
|
||||
*/
|
||||
data class StartGrayContrailTaskReq(var sn: String, var contrailId: Long)
|
||||
|
||||
/**
|
||||
* 开始一个路线的灰度任务,对服务端的路线标记
|
||||
*/
|
||||
data class StartGrayContrailTaskRsp(var data: Long?) : BaseData()
|
||||
|
||||
/**
|
||||
* 根据id查询灰度轨迹详情
|
||||
*/
|
||||
data class QueryRoutingContrailByIdRsp(var data: ContrailBean?) : BaseData()
|
||||
|
||||
/**
|
||||
* 上报路线打点
|
||||
*/
|
||||
data class SubmitGrayLineIssueLocationReq(var grayId: Long, var gcjLon: Double, var gcjLat: Double)
|
||||
data class EndGrayContrailTaskReq(var grayId: Long, var feedback: Int,var occurrenceTime:Long) //feedback 1:成功 2:失败
|
||||
|
||||
/**
|
||||
* 结束一个路线的灰度任务
|
||||
*/
|
||||
data class EndGrayContrailTaskReq(
|
||||
var grayId: Long,
|
||||
var feedback: Int,
|
||||
var occurrenceTime: Long
|
||||
) //feedback 1:成功 2:失败
|
||||
|
||||
|
||||
/**
|
||||
* 灰度任务&查询轨迹详情
|
||||
*/
|
||||
data class StartGrayAndQueryContrailRsp(
|
||||
var taskId: Long?,
|
||||
var contrail: ContrailBean?,
|
||||
var grayLineBean: GrayLineBean
|
||||
) : BaseData()
|
||||
data class PointError(var code:String,var name:String,var isCheck:Boolean = false)
|
||||
|
||||
data class PointError(var code: String, var name: String, var isCheck: Boolean = false)
|
||||
|
||||
/**
|
||||
* 获取打点问题字典
|
||||
*/
|
||||
data class QueryPointErrorReasonsRsp(var data: MutableList<PointError>?) : BaseData()
|
||||
|
||||
/**
|
||||
* 结束一个路线的灰度任务,并上报灰度路线测试情况
|
||||
*/
|
||||
data class SaveGrayContrailErrorReasons(
|
||||
var grayId: Long,
|
||||
var gcjLon: Double,
|
||||
var gcjLat: Double,
|
||||
var wgs84Lon: Double,
|
||||
var wgs84Lat: Double,
|
||||
var occurrenceTime:Long,
|
||||
var occurrenceTime: Long,
|
||||
var noteCodes: MutableList<String>,
|
||||
) //feedback 1:成功 2:失败
|
||||
|
||||
enum class EndGrayTaskFeedbackType(var type: Int) {
|
||||
USABLE_YES(1),
|
||||
USABLE_NO(2)
|
||||
|
||||
@@ -4,14 +4,59 @@ import com.mogo.och.unmanned.taxi.bean.GrayLineBean
|
||||
import com.mogo.och.unmanned.taxi.bean.StartGrayAndQueryContrailRsp
|
||||
|
||||
interface ITaxiRoutingCallback {
|
||||
/**
|
||||
* 查询灰度路线列表--成功✅
|
||||
*/
|
||||
fun onQueryRoutingGrayLineListSuccess(data: MutableList<GrayLineBean>)
|
||||
|
||||
/**
|
||||
* 查询灰度路线列表--失败❌
|
||||
* @param errorStr 错误信息
|
||||
*/
|
||||
fun onQueryRoutingGrayLineListFailed(errorStr: String)
|
||||
|
||||
/**
|
||||
* 灰度任务&查询轨迹详情--成功✅
|
||||
*/
|
||||
fun onStartGrayTaskAndQueryContrailSuccess(data: StartGrayAndQueryContrailRsp)
|
||||
|
||||
/**
|
||||
* 灰度任务&查询轨迹详情--失败❌
|
||||
* @param errorStr 错误信息
|
||||
*/
|
||||
fun onStartGrayTaskAndQueryContrailFailed(errorStr: String)
|
||||
|
||||
/**
|
||||
* 灰度任务过程中,上报问题打点--成功✅
|
||||
*/
|
||||
fun onSubmitGrayLineIssueLocationSuccess()
|
||||
|
||||
/**
|
||||
* 灰度任务过程中,上报问题打点--失败❌
|
||||
* @param errorStr 错误信息
|
||||
*/
|
||||
fun onSubmitGrayLineIssueLocationFailed(errorStr: String)
|
||||
|
||||
/**
|
||||
* 结束灰度任务--成功✅
|
||||
*/
|
||||
fun onSubmitEndTaskSuccess()
|
||||
|
||||
/**
|
||||
* 结束灰度任务--成功❌
|
||||
* @param errorStr 错误信息
|
||||
*/
|
||||
fun onSubmitEndTaskFailed(errorStr: String)
|
||||
|
||||
/**
|
||||
* MAP到站通知
|
||||
* @param grayId 灰度路线ID
|
||||
*/
|
||||
fun onAutoPilotArriveAtEndStation(grayId: Long?)
|
||||
|
||||
/**
|
||||
* 自车定位围栏
|
||||
* @param grayId 灰度路线ID
|
||||
*/
|
||||
fun onGDMapArriveAtEndStation(grayId: Long?)
|
||||
}
|
||||
|
||||
@@ -105,6 +105,9 @@ object TaxiRoutingServiceManager {
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "dot/list"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 标记灰度任务被启动验证
|
||||
*/
|
||||
fun startGrayTaskAndQueryRoutingContrail(
|
||||
context: Context,
|
||||
sn: String,
|
||||
|
||||
@@ -332,13 +332,16 @@ abstract class BaseTaxiTabFragment<V : IView, P : Presenter<V>> : MvpFragment<V,
|
||||
isStarting = false
|
||||
if (autopilotLoadingAnimator != null) {
|
||||
autopilotLoadingAnimator!!.end()
|
||||
module_och_autopilot_iv.clearAnimation()
|
||||
module_och_autopilot_iv?.clearAnimation()
|
||||
autopilotLoadingAnimator = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun startAutopilotDone(success: Boolean) {
|
||||
if(module_och_autopilot_iv==null){
|
||||
return
|
||||
}
|
||||
if (autopilotLoadingAnimator != null) {
|
||||
autopilotLoadingAnimator!!.end()
|
||||
module_och_autopilot_iv.clearAnimation()
|
||||
|
||||
@@ -76,9 +76,12 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
|
||||
* 开启自动驾驶 自驾模式
|
||||
*/
|
||||
public void startAutoPilot() {
|
||||
// 这里区分是订单还是灰度测试
|
||||
if (MogoStatusManager.getInstance().isTaxiUnmanedDriverLineRoutingVerifyMode()) {
|
||||
// 灰度测试
|
||||
TaxiRoutingModel.INSTANCE.startAutoPilotByClick();
|
||||
} else {
|
||||
// 订单
|
||||
TaxiTaskModel.INSTANCE.startAutopilotByClick();
|
||||
}
|
||||
}
|
||||
@@ -182,7 +185,7 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
|
||||
@Override
|
||||
public void run() {
|
||||
if(mView!=null) {
|
||||
onNaviToEnd(isAmap, isShow);
|
||||
mView.onNaviToEnd(isAmap, isShow);
|
||||
}
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE);
|
||||
|
||||
@@ -90,6 +90,8 @@ class TaxiRoutingChooseLineActivity : AppCompatActivity() {
|
||||
btnClose.setOnClickListener {
|
||||
finish()
|
||||
}
|
||||
|
||||
// 选择路线后,「确认」按钮
|
||||
btnChooseLineSubmit.setOnClickListener {
|
||||
if (mCurrentChosenPosition == -1) {
|
||||
ToastUtils.showLong("请先选择任务")
|
||||
@@ -99,11 +101,15 @@ class TaxiRoutingChooseLineActivity : AppCompatActivity() {
|
||||
mLoadingDialog.showLoading()
|
||||
val chosenItem = mRoutingLineList[mCurrentChosenPosition]
|
||||
mViewModel.sendUiIntent(
|
||||
// 调用查询接口获取路线详情
|
||||
TaxiRoutingUiIntent.StartTaskAndQueryContrail(chosenItem)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化UI观察者
|
||||
*/
|
||||
private fun initViewModelObserver() {
|
||||
lifecycleScope.launchWhenStarted {
|
||||
mViewModel.uiStateFlow.map { it.routingUiState }.collect { routingUiState ->
|
||||
@@ -111,6 +117,7 @@ class TaxiRoutingChooseLineActivity : AppCompatActivity() {
|
||||
TAG,
|
||||
"uiStateFlow-initViewModelObserver: $routingUiState"
|
||||
)
|
||||
// 分发处理具体UI更新
|
||||
when (routingUiState) {
|
||||
is RoutingUIState.Init -> {
|
||||
showEmptyView()
|
||||
@@ -128,6 +135,7 @@ class TaxiRoutingChooseLineActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
// 将结果同步更新到UI
|
||||
is RoutingUIState.PostRoutingTaskResult -> {
|
||||
FlowBus.with<RoutingUIState.RoutingTask>(TaxiDriverEventConst.RoutingActivityEvent.EVENT_TYPE_GET_CHOSEN_LINE_TASK)
|
||||
.post(this, RoutingUIState.RoutingTask(
|
||||
|
||||
@@ -32,6 +32,7 @@ class TaxiRoutingChooseLineAdapter(
|
||||
override fun onBindViewHolder(holder: SwitchLineViewHolder, position: Int) {
|
||||
val currentPosition = holder.bindingAdapterPosition
|
||||
val data = mData[currentPosition]
|
||||
|
||||
holder.lineNameTextView.text = data.lineName
|
||||
holder.todayVerifyNumTextView.text = "本车今日已验证:${data.carVerificationCount}次"
|
||||
holder.historyVerifyNumTextView.text =
|
||||
|
||||
@@ -56,6 +56,9 @@ class TaxiRoutingChooseLineViewModel : BaseViewModel<TaxiRoutingUiState, TaxiRou
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询轨迹详情成功的回调
|
||||
*/
|
||||
override fun onStartGrayTaskAndQueryContrailSuccess(data: StartGrayAndQueryContrailRsp) {
|
||||
if (data.taskId == -1L) {
|
||||
onStartGrayTaskAndQueryContrailFailed("开始任务失败, 请稍后重试")
|
||||
|
||||
@@ -121,6 +121,9 @@ class TaxiRoutingFragment : BaseFragment(), ICommonNaviChangedCallback {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示选择任务视图
|
||||
*/
|
||||
private fun showChooseTaskView() {
|
||||
noDataContainer.visibility = View.VISIBLE
|
||||
mCurrentTaskLayout.visibility = View.GONE
|
||||
@@ -133,6 +136,9 @@ class TaxiRoutingFragment : BaseFragment(), ICommonNaviChangedCallback {
|
||||
removeAllMapMarker()
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示当前路线任务信息
|
||||
*/
|
||||
private fun showCurrentLineTaskContentView(data: RoutingUIState.RoutingTask) {
|
||||
noDataContainer.visibility = View.GONE
|
||||
mCurrentTaskLayout.visibility = View.VISIBLE
|
||||
@@ -142,6 +148,7 @@ class TaxiRoutingFragment : BaseFragment(), ICommonNaviChangedCallback {
|
||||
|
||||
btnChooseTask.visibility = View.GONE
|
||||
btnStartTask.visibility = View.VISIBLE
|
||||
// 开始任务,按钮
|
||||
btnStartTask.setOnClickListener {
|
||||
mViewModel.sendUiIntent(TaxiRoutingUiIntent.StartTaskAction(data))
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02Lis
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.ActivityUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.manager.autopilot.line.LineManager
|
||||
import com.mogo.och.common.module.map.AmapNaviToDestinationModel
|
||||
import com.mogo.och.unmanned.taxi.base.BaseViewModel
|
||||
import com.mogo.och.unmanned.taxi.base.IUiIntent
|
||||
@@ -54,11 +55,15 @@ class TaxiRoutingFragmentViewModel : BaseViewModel<TaxiRoutingUiState, TaxiRouti
|
||||
)
|
||||
)
|
||||
}
|
||||
task.contrailBean?.lineId?.also {
|
||||
LineManager.setLineId(it)
|
||||
}
|
||||
// 设置灰度路线任务执行状态,切换模式时判断使用
|
||||
MogoStatusManager.getInstance()
|
||||
.setTaxiUnmanedDriverLineRoutingPerformTask(TAG, true)
|
||||
}
|
||||
|
||||
// 启动自动驾驶
|
||||
is TaxiRoutingUiIntent.StartTaskAction -> {
|
||||
DebugView.printInfoMsg("[开始任务] 准备开始任务")
|
||||
val grayLineBean = intent.routingTask.grayLineBean
|
||||
@@ -147,6 +152,7 @@ class TaxiRoutingFragmentViewModel : BaseViewModel<TaxiRoutingUiState, TaxiRouti
|
||||
TaxiRoutingModel.updateCurrentGrayLineAndContrail(null, null, -1L)
|
||||
// 设置灰度路线任务执行状态,切换模式时判断使用
|
||||
MogoStatusManager.getInstance().setTaxiUnmanedDriverLineRoutingPerformTask(TAG, false)
|
||||
LineManager.setLineId(-1)
|
||||
TaxiRoutingModel.startNaviToEndStationByAMap(false)
|
||||
// 移除到站监听
|
||||
TaxiRoutingModel.removeAutoPilotStatusListener()
|
||||
|
||||
@@ -19,12 +19,14 @@ import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.ArrivedStation
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager.writeChainLog
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.utils.OCHThreadPoolManager
|
||||
import com.mogo.och.unmanned.taxi.bean.ContrailBean
|
||||
import com.mogo.och.unmanned.taxi.bean.EndGrayContrailTaskReq
|
||||
@@ -88,7 +90,9 @@ object TaxiRoutingModel {
|
||||
OchAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
//MAP到站监听
|
||||
/**
|
||||
* MAP到站监听
|
||||
*/
|
||||
private val mMogoAutopilotStatusListener: IOchAutopilotStatusListener =
|
||||
object : IOchAutopilotStatusListener {
|
||||
|
||||
@@ -128,7 +132,9 @@ object TaxiRoutingModel {
|
||||
}
|
||||
}
|
||||
|
||||
// 自车定位监听
|
||||
/**
|
||||
* 自车定位监听
|
||||
*/
|
||||
private val mMapLocationListener: IMoGoChassisLocationGCJ02Listener =
|
||||
object : IMoGoChassisLocationGCJ02Listener {
|
||||
override fun onChassisLocationGCJ02(currentLocation: MogoLocation?) {
|
||||
@@ -199,6 +205,9 @@ object TaxiRoutingModel {
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询灰度路线
|
||||
*/
|
||||
fun queryRoutingGrayLineList() {
|
||||
DebugView.printInfoMsg("[查询灰度路线] 准备发送请求,sn=${SharedPrefsMgr.getInstance().sn}")
|
||||
TaxiRoutingServiceManager.queryRoutingGrayLineList(mContext,
|
||||
@@ -255,6 +264,9 @@ object TaxiRoutingModel {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始灰度任务&查询轨迹详情
|
||||
*/
|
||||
fun startGrayTaskAndQueryRoutingContrail(contrailId: Long, grayLineBean: GrayLineBean) {
|
||||
DebugView.printInfoMsg("[开始灰度任务&查询轨迹详情] 准备发送请求,contrailId=${contrailId}, lineId=${grayLineBean.lineId}")
|
||||
TaxiRoutingServiceManager.startGrayTaskAndQueryRoutingContrail(
|
||||
@@ -276,6 +288,9 @@ object TaxiRoutingModel {
|
||||
mTaxiRoutingCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onStartGrayTaskAndQueryContrailSuccess(data)
|
||||
|
||||
// Routing 从这里解析出经停信息,轨迹信息,并调用下载轨迹接口
|
||||
sendTrajectoryReq(data)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -315,6 +330,9 @@ object TaxiRoutingModel {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 灰度任务过程中,上报问题打点
|
||||
*/
|
||||
fun submitGrayLineIssueLocation(grayId: Long, gcjLon: Double, gcjLat: Double) {
|
||||
DebugView.printInfoMsg("[上报打点] 准备发送请求,grayId=$grayId, gcjLon=$gcjLon, gcjLat=$gcjLat")
|
||||
val submit = SubmitGrayLineIssueLocationReq(grayId, gcjLon, gcjLat)
|
||||
@@ -374,9 +392,12 @@ object TaxiRoutingModel {
|
||||
)
|
||||
}
|
||||
|
||||
fun endGrayTask(grayId: Long, type: EndGrayTaskFeedbackType, occurrenceTime:Long,) {
|
||||
/**
|
||||
* 结束灰度任务
|
||||
*/
|
||||
fun endGrayTask(grayId: Long, type: EndGrayTaskFeedbackType, occurrenceTime: Long) {
|
||||
DebugView.printInfoMsg("[结束灰度任务] 准备发送请求,grayId=$grayId, type=${type.type}, typeName=${type.name}")
|
||||
val submit = EndGrayContrailTaskReq(grayId, type.type,occurrenceTime)
|
||||
val submit = EndGrayContrailTaskReq(grayId, type.type, occurrenceTime)
|
||||
TaxiRoutingServiceManager.endGrayTask(
|
||||
mContext,
|
||||
submit,
|
||||
@@ -432,6 +453,42 @@ object TaxiRoutingModel {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载路线请求
|
||||
*/
|
||||
fun sendTrajectoryReq(startGrayAndQueryContrailRsp: StartGrayAndQueryContrailRsp) {
|
||||
startGrayAndQueryContrailRsp.contrail?.let { contrail ->
|
||||
// 初始化自动驾驶需要的参数
|
||||
val parameters = initAutopilotControlParameters(
|
||||
startGrayAndQueryContrailRsp.grayLineBean,
|
||||
contrail
|
||||
)
|
||||
|
||||
if (parameters!!.autoPilotLine == null) {
|
||||
CallerLogger.e(
|
||||
SceneConstant.M_BUS + TAG,
|
||||
"sendTrajectoryReq(): mAutoPilotLine is null!!!"
|
||||
)
|
||||
return
|
||||
}
|
||||
writeChainLog(
|
||||
"轨迹监控",
|
||||
"sendTrajectoryReq() 下发轨迹 轨迹id" + parameters.autoPilotLine!!.lineId,
|
||||
true,
|
||||
OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY
|
||||
)
|
||||
CallerAutoPilotControlManager.sendTrajectoryDownloadReq(parameters)
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_BUS + TAG,
|
||||
"sendTrajectoryReq(): "
|
||||
+ GsonUtils.toJson(parameters)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新灰度路线信息
|
||||
*/
|
||||
fun updateCurrentGrayLineAndContrail(
|
||||
grayLineBean: GrayLineBean?,
|
||||
contrailBean: ContrailBean?,
|
||||
@@ -442,6 +499,9 @@ object TaxiRoutingModel {
|
||||
currentGrayId = grayId
|
||||
}
|
||||
|
||||
/**
|
||||
* 灰度测试路线,启动自动驾驶
|
||||
*/
|
||||
fun startAutoPilotByClick() {
|
||||
if (currentGrayLineBean == null || currentContrailBean == null) {
|
||||
CallerLogger.e(
|
||||
@@ -454,6 +514,9 @@ object TaxiRoutingModel {
|
||||
startAutoPilot(currentGrayLineBean!!, currentContrailBean!!)
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动自动驾驶
|
||||
*/
|
||||
fun startAutoPilot(grayLineBean: GrayLineBean, contrailBean: ContrailBean) {
|
||||
if (grayLineBean.startSite == null || grayLineBean.endSite == null) {
|
||||
CallerLogger.e(TAG, "start site or end site is null")
|
||||
@@ -478,22 +541,21 @@ object TaxiRoutingModel {
|
||||
if (!CallerAutoPilotControlManager.isCanStartAutopilot(true)) {
|
||||
return
|
||||
}
|
||||
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().autopilotAbilityStatus) {
|
||||
//4、ssm 给出数据
|
||||
if (!OchAutoPilotManager.canStartAutoPilotSSM()) {
|
||||
DebugView.printErrorMsg("[启自驾] ${OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason}")
|
||||
ToastUtils.showLong(
|
||||
OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason +
|
||||
", 请稍候重试"
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
// 初始化自动驾驶需要的参数
|
||||
val parameters = initAutopilotControlParameters(grayLineBean, contrailBean)
|
||||
if (null == parameters) {
|
||||
CallerLogger.e(TAG, "AutopilotControlParameters is empty.")
|
||||
return
|
||||
}
|
||||
|
||||
OchAutoPilotManager.startAutoPilot(parameters);
|
||||
// 开启自动驾驶
|
||||
OchAutoPilotManager.startAutoPilot(parameters)
|
||||
|
||||
DebugView.printInfoMsg("[启自驾] 调用成功")
|
||||
CallerLogger.d(
|
||||
@@ -503,6 +565,9 @@ object TaxiRoutingModel {
|
||||
mControllerStatusCallback?.startOpenAutopilot()
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化自动驾驶控制参数
|
||||
*/
|
||||
private fun initAutopilotControlParameters(
|
||||
grayLineBean: GrayLineBean,
|
||||
contrailBean: ContrailBean
|
||||
@@ -520,6 +585,36 @@ object TaxiRoutingModel {
|
||||
parameters.startLatLon =
|
||||
AutopilotControlParameters.AutoPilotLonLat(startWgsLat, startWgsLon)
|
||||
parameters.endLatLon = AutopilotControlParameters.AutoPilotLonLat(endWgsLat, endWgsLon)
|
||||
|
||||
// Routing 给算路引擎使用的:经停点列表、黑名单
|
||||
val wayLatLons: MutableList<AutopilotControlParameters.AutoPilotLonLat> = ArrayList()
|
||||
val blackLatLons: MutableList<AutopilotControlParameters.AutoPilotLonLat> = ArrayList()
|
||||
|
||||
if (!contrailBean.passPoints.isNullOrEmpty()) {
|
||||
for (mogoLatLng in contrailBean.passPoints!!) {
|
||||
wayLatLons.add(
|
||||
AutopilotControlParameters.AutoPilotLonLat(
|
||||
mogoLatLng.wgs84Lat,
|
||||
mogoLatLng.wgs84Lon
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (!grayLineBean.blackPoints.isNullOrEmpty()) {
|
||||
for (mogoLatLng in grayLineBean.blackPoints!!) {
|
||||
wayLatLons.add(
|
||||
AutopilotControlParameters.AutoPilotLonLat(
|
||||
mogoLatLng.wgs84Lat,
|
||||
mogoLatLng.wgs84Lon
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
parameters.wayLatLons = wayLatLons
|
||||
parameters.blackLatLons = blackLatLons
|
||||
|
||||
if (parameters.autoPilotLine == null) {
|
||||
parameters.autoPilotLine = AutopilotControlParameters.AutoPilotLine(
|
||||
contrailBean.lineId,
|
||||
@@ -530,11 +625,11 @@ object TaxiRoutingModel {
|
||||
contrailBean.txtFileMd5,
|
||||
contrailBean.contrailSaveTime,
|
||||
TaxiUnmannedConst.BUSINESSTYPE.toString(),
|
||||
contrailBean.csvFileUrlDPQP,
|
||||
contrailBean.csvFileMd5DPQP,
|
||||
contrailBean.txtFileUrlDPQP,
|
||||
contrailBean.txtFileMd5DPQP,
|
||||
contrailBean.contrailSaveTimeDPQP
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
-1L
|
||||
)
|
||||
}
|
||||
return parameters
|
||||
|
||||
@@ -6,6 +6,9 @@ import com.mogo.och.unmanned.taxi.bean.GrayLineBean
|
||||
|
||||
data class TaxiRoutingUiState(val routingUiState: RoutingUIState) : IUiState
|
||||
|
||||
/**
|
||||
* 算路UI状态
|
||||
*/
|
||||
sealed class RoutingUIState {
|
||||
object Init : RoutingUIState()
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.manager.autopilot.line.LineManager
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager
|
||||
import com.mogo.och.common.module.utils.ToastUtilsOch
|
||||
@@ -242,6 +243,7 @@ class TaxiCurrentTaskViewModel : BaseViewModel<UnmannedState, TaskUiIntent>(),
|
||||
// 设置task执行相关状态,切换模式时判断使用
|
||||
if (result == null || result.taskType == TaskTypeEnum.None.code) {
|
||||
MogoStatusManager.getInstance().setTaxiUnmanedDriverPerformTask(TAG, false)
|
||||
LineManager.setLineId(-1)
|
||||
} else {
|
||||
MogoStatusManager.getInstance().setTaxiUnmanedDriverPerformTask(TAG, true)
|
||||
}
|
||||
@@ -269,6 +271,7 @@ class TaxiCurrentTaskViewModel : BaseViewModel<UnmannedState, TaskUiIntent>(),
|
||||
val endStation = MogoLocation()
|
||||
endStation.longitude = curTaskAndOrder.endSite!!.gcjLon
|
||||
endStation.latitude = curTaskAndOrder.endSite!!.gcjLat
|
||||
LineManager.setLineId(result.lineId)
|
||||
TrajectoryAndDistanceManager.setStationPoint(
|
||||
startStation,
|
||||
endStation,
|
||||
@@ -336,6 +339,7 @@ class TaxiCurrentTaskViewModel : BaseViewModel<UnmannedState, TaskUiIntent>(),
|
||||
TaxiTaskModel.cancelAutopilot()
|
||||
// 设置task执行相关状态,切换模式时判断使用
|
||||
MogoStatusManager.getInstance().setTaxiUnmanedDriverPerformTask(TAG, false)
|
||||
LineManager.setLineId(-1)
|
||||
}
|
||||
|
||||
override fun onOrderArriveAtEnd(orderNo: String) {
|
||||
@@ -359,6 +363,7 @@ class TaxiCurrentTaskViewModel : BaseViewModel<UnmannedState, TaskUiIntent>(),
|
||||
}
|
||||
// 设置task执行相关状态,切换模式时判断使用
|
||||
MogoStatusManager.getInstance().setTaxiUnmanedDriverPerformTask(TAG, false)
|
||||
LineManager.setLineId(-1)
|
||||
}
|
||||
|
||||
override fun onStartAutopilot(postDelayTime: Long) {
|
||||
|
||||
@@ -51,10 +51,10 @@ import com.mogo.och.common.module.manager.autopilot.autopilot.ArrivedStation
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.manager.autopilot.line.LineManager
|
||||
import com.mogo.och.common.module.manager.distance.IDistanceListener
|
||||
import com.mogo.och.common.module.manager.distance.ITrajectoryListener
|
||||
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager
|
||||
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager.setStationPoint
|
||||
import com.mogo.och.common.module.map.AmapNaviToDestinationModel
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil.coordinateConverterWgsToGcjLocations
|
||||
import com.mogo.och.common.module.utils.OCHThreadPoolManager
|
||||
@@ -644,6 +644,7 @@ object TaxiTaskModel {
|
||||
DebugView.printInfoMsg("[上报ArriveSite] success siteId=$siteId, isArriveAtEndSite=$isArriveAtEndSite")
|
||||
d(TAG, "submitArriveSite-onSuccess data=" + GsonUtil.jsonFromObject(data))
|
||||
mDriveToNearestStationTask = null
|
||||
LineManager.setLineId(-1)
|
||||
if (isArrivedNearestStation) {// 播报提醒
|
||||
VoiceNotice.showNotice("已到达出车点")
|
||||
}
|
||||
@@ -824,7 +825,8 @@ object TaxiTaskModel {
|
||||
d(TAG, "queryCurrentTaskOnce ArriveAtEnd")
|
||||
|
||||
//订单到站结束轨迹剩余里程就算和高德计算, 防止到站查询订单全程的显示被覆盖
|
||||
setStationPoint(null, null, -1L)
|
||||
LineManager.setLineId(-1)
|
||||
TrajectoryAndDistanceManager.setStationPoint(null, null, -1L)
|
||||
destroyAmapNavi()
|
||||
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
@@ -898,7 +900,8 @@ object TaxiTaskModel {
|
||||
if (mDriveToNearestStationTask == null){
|
||||
destroyAmapNavi()
|
||||
}
|
||||
setStationPoint(null, null, -1L)
|
||||
LineManager.setLineId(-1)
|
||||
TrajectoryAndDistanceManager.setStationPoint(null, null, -1L)
|
||||
}
|
||||
|
||||
fun queryOrderByOrderNo(orderNo: String) {
|
||||
@@ -1250,7 +1253,7 @@ object TaxiTaskModel {
|
||||
}
|
||||
// 3、距离轨迹15m计算
|
||||
mCurrentTaskWithOrder?.let {
|
||||
val resion = TrajectoryAndDistanceManager.canStartAutopilot(it.lineId)
|
||||
val resion = OchAutoPilotManager.canStartAutoPilot(it.lineId)
|
||||
if(!StringUtils.isEmpty(resion)){
|
||||
ToastUtils.showShort(resion);
|
||||
VoiceNotice.showNotice(resion);
|
||||
@@ -1258,11 +1261,7 @@ object TaxiTaskModel {
|
||||
}
|
||||
}
|
||||
// 4、ssm 给出数据
|
||||
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().autopilotAbilityStatus) {
|
||||
ToastUtils.showLong(
|
||||
OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason +
|
||||
", 请稍候重试"
|
||||
)
|
||||
if (!OchAutoPilotManager.canStartAutoPilotSSM()) {
|
||||
DebugView.printErrorMsg("[启自驾] ${OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason}")
|
||||
val orderNo = mCurrentTaskWithOrder?.order?.orderNo
|
||||
TaxiAnalyticsManager.getInstance().triggerUnableStartAPReasonEvent(
|
||||
@@ -1480,6 +1479,7 @@ object TaxiTaskModel {
|
||||
mCurrentTaskWithOrder = null
|
||||
mDriveToNearestStationTask = null
|
||||
DebugView.printInfoMsg("[登出] 退出登陆")
|
||||
LineManager.setLineId(-1)
|
||||
MogoStatusManager.getInstance().setTaxiUnmanedDriverPerformTask(TAG, false)
|
||||
MogoStatusManager.getInstance().setTaxiUnmanedDriverTakingOrders(TAG, false)
|
||||
MogoStatusManager.getInstance().setTaxiUnmanedDriverLineRoutingPerformTask(TAG, false)
|
||||
|
||||
@@ -255,6 +255,7 @@
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.RomaTaxiView
|
||||
android:id="@+id/rtv_switch"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -264,6 +265,14 @@
|
||||
app:roma_close_bg="@drawable/common_driverroma_normal"
|
||||
app:roma_open_bg="@drawable/common_driver_roma_press" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.map.drawline.LineView
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/rtv_switch"
|
||||
android:layout_marginStart="-11dp"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.RomaDistanceView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -356,7 +365,7 @@
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.ConnectionProcessView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_18"
|
||||
android:layout_marginBottom="@dimen/dp_26"
|
||||
app:layout_constraintBottom_toTopOf="@id/viewVersionName"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -80,11 +80,8 @@ object AutopilotManager : IOchAutopilotStatusListener {
|
||||
if (!CallerAutoPilotControlManager.isCanStartAutopilot(false)) {
|
||||
return "启动自动驾驶不满足条件"
|
||||
}
|
||||
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().autopilotAbilityStatus) {
|
||||
ToastUtils.showLong(
|
||||
OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason +
|
||||
", 请稍候重试"
|
||||
)
|
||||
// 4、ssm 给出数据
|
||||
if (!OchAutoPilotManager.canStartAutoPilotSSM()) {
|
||||
TaxiPassengerAnalyticsManager.triggerUnableStartAPReasonEvent(
|
||||
TaxiPassengerModel.currentOCHOrder!!.orderStartSite.siteName,
|
||||
TaxiPassengerModel.currentOCHOrder!!.orderEndSite.siteName,
|
||||
|
||||
@@ -380,6 +380,11 @@ class MoGoAutopilotControlProvider :
|
||||
startAutoPilot(controlParameters, Constants.AUTOPILOT_SOURCE.MO_FANG)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 无参数启动自动驾驶,现在的调用方有:魔方
|
||||
* @param source 数据来源
|
||||
*/
|
||||
private fun startAutoPilotWithNoParameter(source: Int) {
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
val invokeResult = AdasManager.getInstance()
|
||||
@@ -396,6 +401,7 @@ class MoGoAutopilotControlProvider :
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun startAutoPilot(controlParameters: AutopilotControlParameters, source: Int) {
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
val invokeResult = AdasManager.getInstance()
|
||||
@@ -440,12 +446,15 @@ class MoGoAutopilotControlProvider :
|
||||
)
|
||||
}
|
||||
|
||||
override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine) {
|
||||
AdasManager.getInstance().sendTrajectoryDownloadReq(autoPilotLine.toAutoPilotLine())
|
||||
override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, routeInfo: MessagePad.RouteInfo?) {
|
||||
AdasManager.getInstance().sendTrajectoryDownloadReq(autoPilotLine.toAutoPilotLine(),routeInfo)
|
||||
}
|
||||
|
||||
override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int) {
|
||||
AdasManager.getInstance().sendTrajectoryDownloadReq(autoPilotLine.toAutoPilotLine(), downloadType)
|
||||
override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int, routeInfo: MessagePad.RouteInfo?) {
|
||||
AdasManager.getInstance().sendTrajectoryDownloadReq(
|
||||
autoPilotLine.toAutoPilotLine(),
|
||||
downloadType,
|
||||
routeInfo)
|
||||
}
|
||||
|
||||
override fun cancelAutoPilot() {
|
||||
|
||||
@@ -74,6 +74,7 @@ import com.zhjt.mogo.adas.data.sweeper.task.status.SweeperTaskStatus
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.stop.SweeperTaskStop
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import fault_management.FmInfo
|
||||
import fsm.Fsm2024
|
||||
import function_state_management.FunctionStates
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
@@ -491,6 +492,16 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
CallerFaultManagementStateListenerManager.invokeFaultManagementState(fmInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
* FSM状态
|
||||
* 目前在启动自驾前置条件检测440版本中使用
|
||||
* @param header 头
|
||||
* @param fsmState 数据
|
||||
*/
|
||||
override fun onFSM2024State(header: MessagePad.Header, fsmState: Fsm2024.FSMStateMsg) {
|
||||
CallerFsm2024ListenerManager.invokeFSM2024State(fsmState)
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据采集配置应答
|
||||
*/
|
||||
@@ -938,10 +949,26 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
CallerRoboBusJinlvM1StitchedVideoListenerManager.invokeRoboBusJinlvM1StitchedVideo(data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 域控SSM接口接收超时
|
||||
* 状态变动时才会回调,默认SSM状态正常
|
||||
*
|
||||
* @param isTimeout true:SSM接口接收超时 false:SSM接口恢复正常
|
||||
*/
|
||||
override fun onSsmReceiveTimeout(isTimeout: Boolean) {
|
||||
CallerAutoPilotStatusListenerManager.invokeSsmReceiveTimeout(isTimeout)
|
||||
}
|
||||
|
||||
/**
|
||||
* 域控FSM接口接收超时
|
||||
* 状态变动时才会回调,默认FSM状态正常 前提是存在FSM接口
|
||||
*
|
||||
* @param isTimeout true:FSM接口接收超时 false:FSM接口恢复正常
|
||||
*/
|
||||
override fun onFsm2024ReceiveTimeout(isTimeout: Boolean) {
|
||||
CallerAutoPilotStatusListenerManager.invokeFsmReceiveTimeout(isTimeout)
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否可以启动自动驾驶
|
||||
* 使用方法查看:app_ipc_monitoring/uiMainActivity/onAutopilotAbility
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.content.Context
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.EnvConfig
|
||||
@@ -26,6 +27,7 @@ import com.mogo.eagle.core.function.api.devatools.logcat.*
|
||||
import com.mogo.eagle.core.function.api.devatools.mofang.*
|
||||
import com.mogo.eagle.core.function.api.devatools.perf.IMoGoCpuUsageProvider
|
||||
import com.mogo.eagle.core.function.api.lookaround.*
|
||||
import com.mogo.eagle.core.function.api.map.route.IMapRouteProvider
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.w
|
||||
import com.tencent.matrix.Matrix
|
||||
@@ -112,6 +114,10 @@ class DevaToolsProvider : IDevaToolsProvider, IAppStateListener {
|
||||
private val downloadCallbacks by lazy { ConcurrentHashMap<String, ArrayList<(Int) -> Unit>>() }
|
||||
private val startAutopilotCallbacks by lazy { ConcurrentHashMap<String, ArrayList<(Boolean) -> Unit>>() }
|
||||
|
||||
private val mapRouteProvider by lazy {
|
||||
ARouter.getInstance().build(MogoServicePaths.PATH_MAP_ROUTE_GUIDE).navigation() as? IMapRouteProvider
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var lastCanAutopilotStatus: Int? = null
|
||||
|
||||
@@ -607,4 +613,8 @@ class DevaToolsProvider : IDevaToolsProvider, IAppStateListener {
|
||||
override fun unRegisterStartAutopilotStateListener(tag: String) {
|
||||
startAutopilotCallbacks.remove(tag)
|
||||
}
|
||||
|
||||
override fun setRouteDynamicColorEnable(enable: Boolean) {
|
||||
mapRouteProvider?.setRouteDynamicColorEnable(enable)
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.function.api.devatools.logcat.*
|
||||
import com.mogo.eagle.core.utilcode.download.DownloadUtils
|
||||
import com.zhidao.loglib.bean.RemoteLogPushContent
|
||||
import com.zhjt.mogo_core_function_devatools.BuildConfig
|
||||
import com.zhjt.mogo_core_function_devatools.logcat.checker.AnrLogChecker
|
||||
import com.zhjt.mogo_core_function_devatools.logcat.config.LogRecordConfig
|
||||
import com.zhjt.mogo_core_function_devatools.logcat.uploader.*
|
||||
@@ -73,6 +74,7 @@ internal class MoGoLogRecordProviderImpl: IMoGoLogRecordProvider,
|
||||
itx["应用版本名称"] = AppConfigInfo.appVersionName
|
||||
itx["应用版本号"] = AppConfigInfo.appVersionCode
|
||||
itx["渠道"] = AppConfigInfo.flavor
|
||||
itx["构建类型"] = BuildConfig.BUILD_TYPE
|
||||
itx["GIT分支"] = AppConfigInfo.workingBranchName
|
||||
itx["GIT分支HASH"] = AppConfigInfo.workingBranchHash
|
||||
itx["${divider}-2"] = divider
|
||||
|
||||
@@ -1378,6 +1378,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
tbRouteDynamicEffect.isChecked = HmiBuildConfig.isShowRouteStrategy
|
||||
tbRouteDynamicEffect.setOnCheckedChangeListener { _, isChecked ->
|
||||
HmiBuildConfig.isShowRouteStrategy = isChecked
|
||||
CallerDevaToolsManager.setRouteDynamicColorEnable(isChecked)
|
||||
}
|
||||
|
||||
btnThresholdDefine.setOnClickListener {
|
||||
|
||||
@@ -419,6 +419,7 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
scRouteDynamicEffect.setOnCheckedChangeListener { _, isChecked ->
|
||||
hmiAction("SOP 引导线动态效果, ", isChecked)
|
||||
HmiBuildConfig.isShowRouteStrategy = isChecked
|
||||
CallerDevaToolsManager.setRouteDynamicColorEnable(isChecked)
|
||||
}
|
||||
|
||||
//点云效果
|
||||
|
||||
@@ -84,6 +84,9 @@ class ConnectionProcessView @JvmOverloads constructor(
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
//隐藏视图
|
||||
dismissConnectionView()
|
||||
//如果已经开始连接倒计时,则取消Timer
|
||||
connectSSMTimer?.cancel()
|
||||
autopilotReadyTimer?.cancel()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,14 +215,16 @@ class ConnectionProcessView @JvmOverloads constructor(
|
||||
* 展示域控连接成功视图
|
||||
*/
|
||||
private fun showIPCConnectSuccessView(){
|
||||
ThreadUtils.runOnUiThread {
|
||||
this.visibility = View.VISIBLE
|
||||
pbConnectionProgress.setPadding(5,3,5,8)
|
||||
pbConnectionProgress.progressDrawable = ContextCompat.getDrawable(context, R.drawable.connection_progress_style)
|
||||
pbConnectionProgress.progress = 25
|
||||
tvConnectionStatus.setPadding(0,0,0,10)
|
||||
tvConnectionStatus.text = "系统启动中..."
|
||||
clConnectionTip.visibility = View.GONE
|
||||
if(HmiBuildConfig.isShowConnectionProgressView){
|
||||
ThreadUtils.runOnUiThread {
|
||||
this.visibility = View.VISIBLE
|
||||
pbConnectionProgress.setPadding(5,3,5,8)
|
||||
pbConnectionProgress.progressDrawable = ContextCompat.getDrawable(context, R.drawable.connection_progress_style)
|
||||
pbConnectionProgress.progress = 25
|
||||
tvConnectionStatus.setPadding(0,0,0,10)
|
||||
tvConnectionStatus.text = "系统启动中..."
|
||||
clConnectionTip.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,14 +232,16 @@ class ConnectionProcessView @JvmOverloads constructor(
|
||||
* 展示SSM连接成功视图
|
||||
*/
|
||||
private fun showSSMConnectSuccessView(){
|
||||
ThreadUtils.runOnUiThread{
|
||||
this.visibility = View.VISIBLE
|
||||
pbConnectionProgress.setPadding(5,3,5,8)
|
||||
pbConnectionProgress.progressDrawable = ContextCompat.getDrawable(context, R.drawable.connection_progress_style)
|
||||
pbConnectionProgress.progress = 50
|
||||
tvConnectionStatus.setPadding(0,0,0,10)
|
||||
tvConnectionStatus.text = "系统启动中..."
|
||||
clConnectionTip.visibility = View.GONE
|
||||
if(HmiBuildConfig.isShowConnectionProgressView){
|
||||
ThreadUtils.runOnUiThread{
|
||||
this.visibility = View.VISIBLE
|
||||
pbConnectionProgress.setPadding(5,3,5,8)
|
||||
pbConnectionProgress.progressDrawable = ContextCompat.getDrawable(context, R.drawable.connection_progress_style)
|
||||
pbConnectionProgress.progress = 50
|
||||
tvConnectionStatus.setPadding(0,0,0,10)
|
||||
tvConnectionStatus.text = "系统启动中..."
|
||||
clConnectionTip.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,14 +249,16 @@ class ConnectionProcessView @JvmOverloads constructor(
|
||||
* 展示冷启动成功视图
|
||||
*/
|
||||
private fun showAutopilotReadySuccessView(){
|
||||
ThreadUtils.runOnUiThread{
|
||||
this.visibility = View.VISIBLE
|
||||
pbConnectionProgress.setPadding(0,0,0,0)
|
||||
pbConnectionProgress.progressDrawable = ContextCompat.getDrawable(context, R.drawable.connection_success_style)
|
||||
pbConnectionProgress.progress = 100
|
||||
tvConnectionStatus.setPadding(0,0,0,0)
|
||||
tvConnectionStatus.text = "系统启动成功"
|
||||
clConnectionTip.visibility = View.GONE
|
||||
if(HmiBuildConfig.isShowConnectionProgressView){
|
||||
ThreadUtils.runOnUiThread{
|
||||
this.visibility = View.VISIBLE
|
||||
pbConnectionProgress.setPadding(0,0,0,0)
|
||||
pbConnectionProgress.progressDrawable = ContextCompat.getDrawable(context, R.drawable.connection_success_style)
|
||||
pbConnectionProgress.progress = 100
|
||||
tvConnectionStatus.setPadding(0,0,0,0)
|
||||
tvConnectionStatus.text = "系统启动成功"
|
||||
clConnectionTip.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,16 +266,18 @@ class ConnectionProcessView @JvmOverloads constructor(
|
||||
* 展示域控连接失败视图
|
||||
*/
|
||||
private fun showIPCConnectFailView(){
|
||||
ThreadUtils.runOnUiThread {
|
||||
this.visibility = View.VISIBLE
|
||||
pbConnectionProgress.setPadding(0,0,0,0)
|
||||
pbConnectionProgress.progressDrawable = ContextCompat.getDrawable(context, R.drawable.connection_fail_style)
|
||||
pbConnectionProgress.progress = 25
|
||||
tvConnectionStatus.setPadding(0,0,0,0)
|
||||
tvConnectionStatus.text = "系统启动异常"
|
||||
clConnectionTip.visibility = View.VISIBLE
|
||||
tvConnectionTipTitle.text = "Telematics连接异常"
|
||||
tvConnectionTipContent.text = "建议重启车辆并上报问题"
|
||||
if(HmiBuildConfig.isShowConnectionProgressView){
|
||||
ThreadUtils.runOnUiThread {
|
||||
this.visibility = View.VISIBLE
|
||||
pbConnectionProgress.setPadding(0,0,0,0)
|
||||
pbConnectionProgress.progressDrawable = ContextCompat.getDrawable(context, R.drawable.connection_fail_style)
|
||||
pbConnectionProgress.progress = 25
|
||||
tvConnectionStatus.setPadding(0,0,0,0)
|
||||
tvConnectionStatus.text = "系统启动异常"
|
||||
clConnectionTip.visibility = View.VISIBLE
|
||||
tvConnectionTipTitle.text = "Telematics连接异常"
|
||||
tvConnectionTipContent.text = "建议重启车辆并上报问题"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,16 +285,18 @@ class ConnectionProcessView @JvmOverloads constructor(
|
||||
* 展示SSM连接失败视图
|
||||
*/
|
||||
private fun showSSMConnectFailView(){
|
||||
ThreadUtils.runOnUiThread {
|
||||
this.visibility = View.VISIBLE
|
||||
pbConnectionProgress.setPadding(0,0,0,0)
|
||||
pbConnectionProgress.progressDrawable = ContextCompat.getDrawable(context, R.drawable.connection_fail_style)
|
||||
pbConnectionProgress.progress = 50
|
||||
tvConnectionStatus.setPadding(0,0,0,0)
|
||||
tvConnectionStatus.text = "系统启动异常"
|
||||
clConnectionTip.visibility = View.VISIBLE
|
||||
tvConnectionTipTitle.text = "SSM连接异常"
|
||||
tvConnectionTipContent.text = "建议重启车辆并上报问题"
|
||||
if(HmiBuildConfig.isShowConnectionProgressView){
|
||||
ThreadUtils.runOnUiThread {
|
||||
this.visibility = View.VISIBLE
|
||||
pbConnectionProgress.setPadding(0,0,0,0)
|
||||
pbConnectionProgress.progressDrawable = ContextCompat.getDrawable(context, R.drawable.connection_fail_style)
|
||||
pbConnectionProgress.progress = 50
|
||||
tvConnectionStatus.setPadding(0,0,0,0)
|
||||
tvConnectionStatus.text = "系统启动异常"
|
||||
clConnectionTip.visibility = View.VISIBLE
|
||||
tvConnectionTipTitle.text = "SSM连接异常"
|
||||
tvConnectionTipContent.text = "建议重启车辆并上报问题"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -291,16 +304,18 @@ class ConnectionProcessView @JvmOverloads constructor(
|
||||
* 展示SSM冷启动失败视图
|
||||
*/
|
||||
private fun showAutopilotReadyFailView(){
|
||||
ThreadUtils.runOnUiThread {
|
||||
this.visibility = View.VISIBLE
|
||||
pbConnectionProgress.setPadding(0,0,0,0)
|
||||
pbConnectionProgress.progressDrawable = ContextCompat.getDrawable(context, R.drawable.connection_fail_style)
|
||||
pbConnectionProgress.progress = 100
|
||||
tvConnectionStatus.setPadding(0,0,0,0)
|
||||
tvConnectionStatus.text = "系统启动异常"
|
||||
clConnectionTip.visibility = View.VISIBLE
|
||||
tvConnectionTipTitle.text = "系统冷启动异常"
|
||||
tvConnectionTipContent.text = "建议重启车辆并上报问题"
|
||||
if(HmiBuildConfig.isShowConnectionProgressView){
|
||||
ThreadUtils.runOnUiThread {
|
||||
this.visibility = View.VISIBLE
|
||||
pbConnectionProgress.setPadding(0,0,0,0)
|
||||
pbConnectionProgress.progressDrawable = ContextCompat.getDrawable(context, R.drawable.connection_fail_style)
|
||||
pbConnectionProgress.progress = 100
|
||||
tvConnectionStatus.setPadding(0,0,0,0)
|
||||
tvConnectionStatus.text = "系统启动异常"
|
||||
clConnectionTip.visibility = View.VISIBLE
|
||||
tvConnectionTipTitle.text = "系统冷启动异常"
|
||||
tvConnectionTipContent.text = "建议重启车辆并上报问题"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 29 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
@@ -1,7 +1,8 @@
|
||||
<?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_804"
|
||||
android:layout_height="@dimen/dp_160"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="@dimen/dp_160"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/bg_msg_box_v2x"
|
||||
android:layout_gravity="center_horizontal"
|
||||
@@ -30,7 +31,9 @@
|
||||
app:layout_constraintLeft_toRightOf="@id/ivAutopilotImage"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -42,7 +45,7 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="24dp"
|
||||
android:textSize="@dimen/sp_24"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -54,9 +57,9 @@
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvAutopilotTitle"
|
||||
app:layout_constraintRight_toRightOf="@id/tvAutopilotTime"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="@dimen/dp_28"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:textSize="@dimen/sp_28"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,7 +1,8 @@
|
||||
<?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_804"
|
||||
android:layout_height="@dimen/dp_160"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="@dimen/dp_160"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/bg_msg_box_v2x"
|
||||
android:layout_gravity="center_horizontal"
|
||||
@@ -30,7 +31,9 @@
|
||||
app:layout_constraintLeft_toRightOf="@id/ivFSMImage"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -42,7 +45,7 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="24dp"
|
||||
android:textSize="@dimen/sp_24"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -54,9 +57,9 @@
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvFSMTitle"
|
||||
app:layout_constraintRight_toRightOf="@id/tvFSMTime"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="@dimen/dp_28"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:textSize="@dimen/sp_28"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,7 +1,8 @@
|
||||
<?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_804"
|
||||
android:layout_height="@dimen/dp_160"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="@dimen/dp_160"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/bg_msg_box_v2x"
|
||||
android:layout_gravity="center_horizontal"
|
||||
@@ -30,7 +31,9 @@
|
||||
app:layout_constraintLeft_toRightOf="@id/ivSsmImage"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -42,7 +45,7 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="24dp"
|
||||
android:textSize="@dimen/sp_24"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -54,9 +57,9 @@
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvSsmTitle"
|
||||
app:layout_constraintRight_toRightOf="@id/tvSsmTime"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="@dimen/dp_28"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:textSize="@dimen/sp_28"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,7 +1,8 @@
|
||||
<?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_804"
|
||||
android:layout_height="@dimen/dp_160"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="@dimen/dp_160"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/bg_msg_box_v2x"
|
||||
android:layout_gravity="center_horizontal"
|
||||
@@ -28,7 +29,9 @@
|
||||
app:layout_constraintLeft_toRightOf="@id/ivV2XImage"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -40,7 +43,7 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="24dp"
|
||||
android:textSize="@dimen/sp_24"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -52,9 +55,9 @@
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvV2XTitle"
|
||||
app:layout_constraintRight_toRightOf="@id/tvV2XTime"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="@dimen/dp_28"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:textSize="@dimen/sp_28"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -2,7 +2,8 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/clAutopilotLayout"
|
||||
android:layout_width="@dimen/dp_804"
|
||||
android:layout_height="@dimen/dp_160"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="@dimen/dp_160"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/bg_msg_box_v2x"
|
||||
android:layout_gravity="center_horizontal"
|
||||
@@ -30,7 +31,9 @@
|
||||
app:layout_constraintLeft_toRightOf="@id/ivAutopilotImage"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -42,7 +45,7 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="24dp"
|
||||
android:textSize="@dimen/sp_24"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -54,9 +57,9 @@
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvAutopilotTitle"
|
||||
app:layout_constraintRight_toRightOf="@id/tvAutopilotTime"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="@dimen/dp_28"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:textSize="@dimen/sp_28"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -2,7 +2,8 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/clFSMLayout"
|
||||
android:layout_width="@dimen/dp_804"
|
||||
android:layout_height="@dimen/dp_160"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="@dimen/dp_160"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/bg_msg_box_v2x"
|
||||
android:layout_gravity="center_horizontal"
|
||||
@@ -30,7 +31,9 @@
|
||||
app:layout_constraintLeft_toRightOf="@id/ivFSMImage"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -42,7 +45,7 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="24dp"
|
||||
android:textSize="@dimen/sp_24"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -54,9 +57,9 @@
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvFSMTitle"
|
||||
app:layout_constraintRight_toRightOf="@id/tvFSMTime"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="@dimen/dp_28"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:textSize="@dimen/sp_28"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -2,7 +2,8 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/clSsmLayout"
|
||||
android:layout_width="@dimen/dp_804"
|
||||
android:layout_height="@dimen/dp_160"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="@dimen/dp_160"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/bg_msg_box_v2x"
|
||||
android:layout_gravity="center_horizontal"
|
||||
@@ -30,7 +31,9 @@
|
||||
app:layout_constraintLeft_toRightOf="@id/ivSsmImage"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -42,7 +45,7 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="24dp"
|
||||
android:textSize="@dimen/sp_24"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -54,9 +57,9 @@
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvSsmTitle"
|
||||
app:layout_constraintRight_toRightOf="@id/tvSsmTime"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="@dimen/dp_28"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:textSize="@dimen/sp_28"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -2,7 +2,8 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/clV2XLayout"
|
||||
android:layout_width="@dimen/dp_804"
|
||||
android:layout_height="@dimen/dp_160"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="@dimen/dp_160"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/bg_msg_box_v2x"
|
||||
android:layout_gravity="center_horizontal"
|
||||
@@ -28,7 +29,9 @@
|
||||
app:layout_constraintLeft_toRightOf="@id/ivV2XImage"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -40,7 +43,7 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="24dp"
|
||||
android:textSize="@dimen/sp_24"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -52,9 +55,9 @@
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvV2XTitle"
|
||||
app:layout_constraintRight_toRightOf="@id/tvV2XTime"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="@dimen/dp_28"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:textSize="@dimen/sp_28"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -11,6 +11,7 @@ import com.mogo.eagle.core.function.business.SpeedLimitDataManager
|
||||
import com.mogo.eagle.core.function.business.ai.AiCloudIdentifyDataManager.Companion.aiCloudIdentifyDataManager
|
||||
import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.MogoRouteOverlayManager
|
||||
import com.mogo.eagle.core.function.business.trajectoryoverlay.MogoTrajectoryOverlayManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
|
||||
import com.mogo.eagle.core.utilcode.util.DeviceUtils
|
||||
import com.mogo.map.MapDataWrapper
|
||||
@@ -25,6 +26,7 @@ class MapBizProvider :IMoGoFunctionServerProvider, IMogoRoma {
|
||||
MapDataWrapper.init()
|
||||
MapIdentifySubscriber.instance
|
||||
MogoRouteOverlayManager.getInstance().init()
|
||||
MogoTrajectoryOverlayManager.getInstance().init()
|
||||
MapPointCloudSubscriber.instance
|
||||
SpeedLimitDataManager.getInstance().start()
|
||||
if(DeviceUtils.isLenovoModel() || DeviceUtils.isEB5Model()){ //todo 新增稳定设备类型需要添加,目的避免在nuc设备上使用此类功能
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.mogo.eagle.core.function.business.routeoverlay
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.map.route.IMapRouteProvider
|
||||
|
||||
@Route(path = MogoServicePaths.PATH_MAP_ROUTE_GUIDE)
|
||||
class MapRouteProviderImpl: IMapRouteProvider {
|
||||
|
||||
override fun setRouteDynamicColorEnable(enable: Boolean) {
|
||||
RouteStrategy.isEnable = enable
|
||||
}
|
||||
|
||||
override fun init(context: Context?) { }
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public class RouteOverlayDrawer {
|
||||
if (mRenderTask != null) {
|
||||
mRenderHandler.removeCallbacks(mRenderTask);
|
||||
}
|
||||
mogoOverlayManager.removeAllLinesInLevel(Level.GUIDE_ROUTE_LINE);
|
||||
mogoOverlayManager.hideAllLinesInLevel(Level.GUIDE_ROUTE_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,13 +3,11 @@ package com.mogo.eagle.core.function.business.routeoverlay
|
||||
import android.animation.ArgbEvaluator
|
||||
import android.graphics.Color
|
||||
import android.view.animation.AccelerateInterpolator
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.Colors.Companion.COLOR_BLUE
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.Colors.Companion.COLOR_BLUE_DARK
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.Colors.Companion.COLOR_RED_DARK
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.Colors.Companion.COLOR_TRANSPARENT
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import java.util.*
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
@@ -42,7 +40,7 @@ class ColorfulStrategy(private val colors: List<Int> = emptyList(), var isLightO
|
||||
|
||||
object RouteStrategy {
|
||||
|
||||
private var isEnable by Delegates.observable(HmiBuildConfig.isShowRouteStrategy) { _, _, newValue ->
|
||||
internal var isEnable by Delegates.observable(HmiBuildConfig.isShowRouteStrategy) { _, _, newValue ->
|
||||
if (!newValue) {
|
||||
strategy = null
|
||||
colors.clear()
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.mogo.eagle.core.function.business.trajectoryoverlay;
|
||||
|
||||
import android.util.Log;
|
||||
import android.util.Pair;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
public class MogoTrajectoryOverlayManager implements IMoGoPlanningRottingListener, IMoGoChassisLocationGCJ02Listener {
|
||||
private static volatile MogoTrajectoryOverlayManager sInstance;
|
||||
private static final String TAG = "MogoTrajectoryOverlayManager";
|
||||
private static final String ANALYTICS_KEY = "mogo_map_trajectory_overlay_manager";
|
||||
|
||||
private final List<MessagePad.Location> queue = new ArrayList<>();
|
||||
|
||||
private MogoTrajectoryOverlayManager() {
|
||||
}
|
||||
|
||||
public void init() {
|
||||
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, 1, this);
|
||||
}
|
||||
|
||||
public static MogoTrajectoryOverlayManager getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (MogoTrajectoryOverlayManager.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new MogoTrajectoryOverlayManager();
|
||||
//需要先初始化,否则第一次调用drawTrajectoryOverlayOnce()会因为mRenderHandler=null实际不会绘制
|
||||
TrajectoryOverlayDrawer.getInstance();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRotting(@Nullable MessagePad.GlobalPathResp globalPathResp) {
|
||||
if (globalPathResp != null) {
|
||||
CallerLogger.i(TAG, "onAutopilotRotting size=" + globalPathResp.getWayPointsList().size());
|
||||
synchronized (queue) {
|
||||
queue.clear();
|
||||
queue.addAll(globalPathResp.getWayPointsList());
|
||||
}
|
||||
trackEvent("onAutopilotRotting", "接收到全局轨迹规划, size=" + globalPathResp.getWayPointsList().size());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
|
||||
|
||||
}
|
||||
|
||||
public Pair<Boolean, String> drawTrajectoryOverlayOnce() {
|
||||
CallerLogger.i(TAG, "drawTrajectoryOverlayOnce");
|
||||
trackEvent("drawTrajectoryOverlayOnce", "开始执行");
|
||||
synchronized (queue) {
|
||||
if (queue != null && !queue.isEmpty()) {
|
||||
double heading = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getHeading();
|
||||
TrajectoryOverlayDrawer.getInstance().drawTrajectoryList(queue, heading);
|
||||
trackEvent("drawTrajectoryOverlayOnce", "执行结果(result=true, msg=success)");
|
||||
return new Pair(true, "success");
|
||||
}
|
||||
trackEvent("drawTrajectoryOverlayOnce", "执行结果(result=false, msg=全局轨迹未就绪或为空)");
|
||||
return new Pair(false, "全局轨迹未就绪或为空");
|
||||
}
|
||||
}
|
||||
|
||||
public void clearTrajectoryOverlay(boolean isClearData) {
|
||||
CallerLogger.i(TAG, "clearTrajectoryOverlay");
|
||||
trackEvent("clearTrajectoryOverlay", "开始执行");
|
||||
TrajectoryOverlayDrawer.getInstance().clearMogoTrajectoryOverlay();
|
||||
if (isClearData) {
|
||||
queue.clear();
|
||||
}
|
||||
trackEvent("clearTrajectoryOverlay", "success");
|
||||
}
|
||||
|
||||
public void trackEvent(String eventKey, String eventValue) {
|
||||
ThreadUtils.getIoPool().submit(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Log.i(TAG, eventKey + "-->" + eventValue);
|
||||
Map map = new HashMap();
|
||||
map.put(eventKey, eventValue);
|
||||
MogoAnalyticUtils.INSTANCE.track(ANALYTICS_KEY, map);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.mogo.eagle.core.function.business.trajectoryoverlay
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.map.trajectory.IMoGoGlobalTrajectoryDrawListener
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
|
||||
@Route(path = MogoServicePaths.PATH_MAP_GLOBAL_TRAJECTORY)
|
||||
class MogoTrajectoryOverlayProvider : IMoGoGlobalTrajectoryDrawListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "MogoTrajectoryOverlayProvider"
|
||||
}
|
||||
|
||||
private var hasDrawn = AtomicReference<Boolean>(false)
|
||||
|
||||
override fun init(context: Context?) {
|
||||
CallerLogger.i(TAG, "---init---")
|
||||
}
|
||||
|
||||
override fun hasDrawnGlobalTrajectory(): Boolean {
|
||||
val result = hasDrawn.get()
|
||||
CallerLogger.i(TAG, "hasDrawnGlobalTrajectory --> hasDrawn=$result")
|
||||
return result
|
||||
}
|
||||
|
||||
override fun drawGlobalTrajectory(): Pair<Boolean, String> {
|
||||
val result = MogoTrajectoryOverlayManager.getInstance().drawTrajectoryOverlayOnce()
|
||||
if (result.first) {
|
||||
hasDrawn.set(result.first)
|
||||
}
|
||||
CallerLogger.i(TAG, "drawGlobalTrajectory --> hasDrawn=$hasDrawn, result.first=${result.first}, result.second=${result.second}")
|
||||
return Pair(result.first, result.second)
|
||||
}
|
||||
|
||||
override fun clearGlobalTrajectory(isClearData: Boolean) {
|
||||
MogoTrajectoryOverlayManager.getInstance().clearTrajectoryOverlay(isClearData)
|
||||
hasDrawn.set(false)
|
||||
CallerLogger.i(TAG, "clearGlobalTrajectory --> hasDrawn=$hasDrawn")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
package com.mogo.eagle.core.function.business.trajectoryoverlay;
|
||||
|
||||
import static com.mogo.map.MogoMap.DEFAULT;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.graphics.Color;
|
||||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.core.util.Pools;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils;
|
||||
import com.mogo.map.overlay.IMoGoOverlayManager;
|
||||
import com.mogo.map.overlay.core.Level;
|
||||
import com.mogo.map.overlay.line.Polyline;
|
||||
import com.zhidaoauto.map.sdk.open.common.tools.MapTools;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import kotlin.Pair;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
public class TrajectoryOverlayDrawer {
|
||||
|
||||
private static final String TAG = "TrajectoryOverlayDrawer";
|
||||
|
||||
// 连接线参数
|
||||
private Handler mRenderHandler;
|
||||
private final IMoGoOverlayManager mogoOverlayManager;
|
||||
private static volatile TrajectoryOverlayDrawer sInstance;
|
||||
private static final byte[] obj = new byte[0];
|
||||
private Polyline.Options mPolylineOptions;
|
||||
private static final int COLOR_LIGHT = Color.parseColor("#BAEBF5");
|
||||
private static final int mPolylineWidth = 50;
|
||||
|
||||
//用于taxi乘客屏渐变颜色集合
|
||||
private static List<Integer> colors = null;
|
||||
|
||||
private TrajectoryOverlayDrawer() {
|
||||
// 渐变色
|
||||
mogoOverlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
|
||||
if (mogoOverlayManager != null) {
|
||||
mPolylineOptions = new Polyline.Options.Builder("trajectory_overlay", Level.TRAJECTORY_LINE)
|
||||
.setUseGps(true)
|
||||
.setWidth(mPolylineWidth)
|
||||
.setIsGradient(true)
|
||||
.build();
|
||||
|
||||
// 线条粗细,渐变,渐变色值
|
||||
HandlerThread renderTask = new HandlerThread("trajectory_render") {
|
||||
@Override
|
||||
protected void onLooperPrepared() {
|
||||
super.onLooperPrepared();
|
||||
mRenderHandler = new Handler(getLooper());
|
||||
}
|
||||
};
|
||||
renderTask.start();
|
||||
}
|
||||
}
|
||||
|
||||
public static TrajectoryOverlayDrawer getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (obj) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new TrajectoryOverlayDrawer();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public void clearMogoTrajectoryOverlay() {
|
||||
if (mogoOverlayManager != null) {
|
||||
if (mRenderTask != null) {
|
||||
mRenderHandler.removeCallbacks(mRenderTask);
|
||||
}
|
||||
mogoOverlayManager.hideAllLinesInLevel(Level.TRAJECTORY_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
private class RenderTask implements Runnable {
|
||||
private volatile List<MessagePad.Location> routeList;
|
||||
private final Pools.Pool<MogoLatLng> pools;
|
||||
private final LinkedList<MogoLatLng> points;
|
||||
private double bearing;
|
||||
|
||||
public RenderTask() {
|
||||
this.pools = new Pools.SimplePool<>(500);
|
||||
this.points = new LinkedList<>();
|
||||
}
|
||||
|
||||
public void setData(List<MessagePad.Location> routeList, double bearing) {
|
||||
this.routeList = routeList;
|
||||
this.bearing = bearing;
|
||||
}
|
||||
|
||||
@SuppressLint("LongLogTag")
|
||||
@Override
|
||||
public void run() {
|
||||
IMoGoOverlayManager overlayManager = mogoOverlayManager;
|
||||
if (overlayManager == null) {
|
||||
return;
|
||||
}
|
||||
LinkedList<MogoLatLng> pps = this.points;
|
||||
boolean isExcept = false;
|
||||
int total;
|
||||
|
||||
try {
|
||||
pps.clear();
|
||||
List<MessagePad.Location> routes = this.routeList;
|
||||
if (routes == null || (total = routes.size()) < 2) {
|
||||
isExcept = true;
|
||||
return;
|
||||
}
|
||||
//boolean isColorfulStrategy = !AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) || !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode);
|
||||
//全局轨迹线 没有颜色策略,使用固定颜色
|
||||
boolean isColorfulStrategy = false;
|
||||
if (isColorfulStrategy) {
|
||||
TrajectoryStrategy.INSTANCE.start();
|
||||
} else {
|
||||
if (colors == null) {
|
||||
ArrayList<Pair<Integer, Integer>> temps = new ArrayList<>();
|
||||
temps.add(new Pair<>(0, 70));
|
||||
temps.add(new Pair<>(2, 100));
|
||||
temps.add(new Pair<>(98, 100));
|
||||
temps.add(new Pair<>(100, 70));
|
||||
List<Integer> alphas = MapTools.INSTANCE.getColorAlpha(temps);
|
||||
if (alphas != null && !alphas.isEmpty()) {
|
||||
colors = new ArrayList<>();
|
||||
for (int i : alphas) {
|
||||
colors.add(Color.argb(i, 48,163,255));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < total; i++) {
|
||||
MessagePad.Location route = null;
|
||||
try {
|
||||
route = routes.get(i);
|
||||
if (route == null) {
|
||||
continue;
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
Log.d("Trajectory", "render-error:" + t.getMessage());
|
||||
}
|
||||
if (route == null) {
|
||||
//数组越界了,结束循环
|
||||
break;
|
||||
}
|
||||
MogoLatLng acquire = pools.acquire();
|
||||
double latitude = route.getLatitude();
|
||||
double longitude = route.getLongitude();
|
||||
if (acquire == null) {
|
||||
acquire = new MogoLatLng(latitude, longitude);
|
||||
} else {
|
||||
acquire.lon = longitude;
|
||||
acquire.lat = latitude;
|
||||
}
|
||||
pps.add(acquire);
|
||||
}
|
||||
// double lon = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLongitude();
|
||||
// double lat = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLatitude();
|
||||
if (points.size() > 0) {
|
||||
// MogoLatLng top = null;
|
||||
// while (points.size() != 0) {
|
||||
// MogoLatLng first = points.peek();
|
||||
// if (first == null) {
|
||||
// continue;
|
||||
// }
|
||||
// if (first == top) {
|
||||
// break;
|
||||
// }
|
||||
// lon = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLongitude();
|
||||
// lat = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLatitude();
|
||||
// long angle = isPointOnCarFront(lon, lat, bearing, first.lon, first.lat);
|
||||
// if (angle >= 90) {
|
||||
// if (isColorfulStrategy) {
|
||||
// TrajectoryStrategy.INSTANCE.remove(first.acc);
|
||||
// }
|
||||
// pools.release(first);
|
||||
// points.poll();
|
||||
// }
|
||||
// top = first;
|
||||
// }
|
||||
// if (points.size() == 0) {
|
||||
// isExcept = true;
|
||||
// return;
|
||||
// }
|
||||
// MogoLatLng self = pools.acquire();
|
||||
// if (self == null) {
|
||||
// self = new MogoLatLng(lat, lon);
|
||||
// } else {
|
||||
// self.lat = lat;
|
||||
// self.lon = lon;
|
||||
// }
|
||||
// points.addFirst(self);
|
||||
|
||||
Polyline.Options.Builder builder;
|
||||
if (mPolylineOptions == null) {
|
||||
builder = new Polyline.Options.Builder("trajectory_overlay", Level.TRAJECTORY_LINE)
|
||||
.setUseGps(true)
|
||||
.setWidth(mPolylineWidth)
|
||||
.setIsGradient(false);
|
||||
} else {
|
||||
builder = mPolylineOptions.builder();
|
||||
}
|
||||
|
||||
if (isColorfulStrategy) {
|
||||
TrajectoryStrategy.INSTANCE.end();
|
||||
Strategy strategy = TrajectoryStrategy.INSTANCE.getStrategy();
|
||||
List<Integer> colors = strategy.getColors();
|
||||
boolean isLightOn = strategy instanceof ColorfulStrategy && ((ColorfulStrategy) strategy).isLightOn();
|
||||
builder.colors(colors);
|
||||
builder.setLightOn(isLightOn);
|
||||
//builder.setLightColor(COLOR_LIGHT);
|
||||
//builder.setLightSpeed(0.3f);
|
||||
} else {
|
||||
if (colors != null && !colors.isEmpty()) {
|
||||
builder.colors(colors);
|
||||
builder.setIsGradient(true);
|
||||
builder.setLightOn(false);
|
||||
//builder.setLightColor(COLOR_LIGHT);
|
||||
//builder.setLightSpeed(0.3f);
|
||||
}
|
||||
}
|
||||
builder.points(points);
|
||||
builder.setVisible(true);
|
||||
Polyline.Options options = builder.build();
|
||||
if (mPolylineOptions == null) {
|
||||
mPolylineOptions = options;
|
||||
}
|
||||
overlayManager.showOrUpdateLine(options,DEFAULT);
|
||||
} else {
|
||||
isExcept = true;
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
} finally {
|
||||
if (isExcept) {
|
||||
setVisible(false);
|
||||
}
|
||||
if (points.size() > 0) {
|
||||
for (int i = 0; i < points.size(); i++) {
|
||||
MogoLatLng latLng = points.get(i);
|
||||
if (latLng == null) {
|
||||
continue;
|
||||
}
|
||||
pools.release(latLng);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private long isPointOnCarFront(double car_lon, double car_lat, double car_head, double lon, double lat) {
|
||||
return DrivingDirectionUtils.getDegreeOfCar2Poi2(car_lon, car_lat, lon, lat, car_head);
|
||||
}
|
||||
}
|
||||
|
||||
private volatile RenderTask mRenderTask;
|
||||
|
||||
public void drawTrajectoryList(List<MessagePad.Location> routeList, double bearing) {
|
||||
if (mogoOverlayManager != null) {
|
||||
if (mRenderTask == null) {
|
||||
mRenderTask = new RenderTask();
|
||||
}
|
||||
mRenderTask.setData(routeList, bearing);
|
||||
if (mRenderHandler != null) {
|
||||
mRenderHandler.removeCallbacks(mRenderTask);
|
||||
mRenderHandler.post(mRenderTask);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setVisible(boolean isVisible) {
|
||||
if (mogoOverlayManager != null) {
|
||||
if (isVisible) {
|
||||
mogoOverlayManager.showAllLinesInLevel(Level.TRAJECTORY_LINE);
|
||||
} else {
|
||||
mogoOverlayManager.hideAllLinesInLevel(Level.TRAJECTORY_LINE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
package com.mogo.eagle.core.function.business.trajectoryoverlay
|
||||
|
||||
import android.animation.ArgbEvaluator
|
||||
import android.graphics.Color
|
||||
import android.view.animation.AccelerateInterpolator
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.function.business.trajectoryoverlay.Colors.Companion.COLOR_BLUE
|
||||
import com.mogo.eagle.core.function.business.trajectoryoverlay.Colors.Companion.COLOR_BLUE_DARK
|
||||
import com.mogo.eagle.core.function.business.trajectoryoverlay.Colors.Companion.COLOR_RED_DARK
|
||||
import com.mogo.eagle.core.function.business.trajectoryoverlay.Colors.Companion.COLOR_TRANSPARENT
|
||||
import java.util.NavigableMap
|
||||
import java.util.TreeMap
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
|
||||
interface IStrategy {
|
||||
fun getColors(): List<Int>
|
||||
}
|
||||
|
||||
class Colors {
|
||||
|
||||
companion object {
|
||||
val COLOR_BLUE = Color.parseColor("#FF2ABAD9")
|
||||
val COLOR_BLUE_DARK = Color.parseColor("#FF074EFF")
|
||||
val COLOR_RED_DARK = Color.parseColor("#FF0FF5F0")
|
||||
val COLOR_TRANSPARENT = Color.parseColor("#002ABAD9")
|
||||
}
|
||||
}
|
||||
|
||||
sealed class Strategy : IStrategy
|
||||
|
||||
class DefaultStrategy(private val colors: List<Int>? = null) : Strategy() {
|
||||
|
||||
override fun getColors(): List<Int> = colors ?: listOf(COLOR_BLUE, COLOR_TRANSPARENT)
|
||||
}
|
||||
|
||||
class ColorfulStrategy(private val colors: List<Int> = emptyList(), var isLightOn: Boolean) :
|
||||
Strategy() {
|
||||
override fun getColors(): List<Int> = colors
|
||||
}
|
||||
|
||||
object TrajectoryStrategy {
|
||||
|
||||
private var isEnable by Delegates.observable(HmiBuildConfig.isShowRouteStrategy) { _, _, newValue ->
|
||||
if (!newValue) {
|
||||
strategy = null
|
||||
colors.clear()
|
||||
}
|
||||
}
|
||||
|
||||
private var strategy: Strategy? = null
|
||||
|
||||
private val colors: ArrayList<Int> = ArrayList()
|
||||
|
||||
private var index = 0
|
||||
|
||||
private val sorted: NavigableMap<Double, Int> by lazy { TreeMap() }
|
||||
|
||||
private var endEvaluator: ArgbEvaluator? = null
|
||||
|
||||
private var startColor = Int.MAX_VALUE
|
||||
|
||||
private var hasLessThan0 = false
|
||||
|
||||
fun start() {
|
||||
if (sorted.isEmpty()) {
|
||||
fill()
|
||||
}
|
||||
strategy = null
|
||||
index = 0
|
||||
startColor = Int.MAX_VALUE
|
||||
colors.clear()
|
||||
endEvaluator = null
|
||||
hasLessThan0 = false
|
||||
}
|
||||
|
||||
fun end() {
|
||||
if (isEnable) {
|
||||
if (colors.isEmpty()) {
|
||||
return
|
||||
}
|
||||
val first = colors[0]
|
||||
colors.add(0, first)
|
||||
strategy = ColorfulStrategy(colors, true)
|
||||
}
|
||||
}
|
||||
|
||||
fun check(speed: Double, acc: Double, total: Int) {
|
||||
if (!isEnable) {
|
||||
return
|
||||
}
|
||||
if (sorted.isEmpty()) {
|
||||
return
|
||||
}
|
||||
if (acc < 0) {
|
||||
hasLessThan0 = true
|
||||
}
|
||||
val delta = (total * 0.35).toInt()
|
||||
val last = total - delta
|
||||
val entry = sorted.floorEntry(acc)
|
||||
if (entry != null) {
|
||||
if (index >= last - 1) {
|
||||
if (startColor == Int.MAX_VALUE) {
|
||||
startColor = entry.value
|
||||
if (endEvaluator == null) {
|
||||
endEvaluator = ArgbEvaluator()
|
||||
}
|
||||
colors += entry.value
|
||||
} else {
|
||||
if (endEvaluator != null) {
|
||||
val fraction = (index - last) * 1.0f / delta
|
||||
colors += endEvaluator!!.evaluate(
|
||||
fraction,
|
||||
startColor,
|
||||
COLOR_TRANSPARENT
|
||||
) as Int
|
||||
}
|
||||
}
|
||||
} else {
|
||||
colors += entry.value
|
||||
}
|
||||
}
|
||||
index++
|
||||
}
|
||||
|
||||
fun remove(acc: Double): List<Int> {
|
||||
if (!isEnable) {
|
||||
return emptyList()
|
||||
}
|
||||
if (sorted.isEmpty()) {
|
||||
throw AssertionError("sorted map must not be null.")
|
||||
}
|
||||
val entry = sorted.floorEntry(acc)
|
||||
if (entry != null) {
|
||||
colors.remove(entry.value)
|
||||
}
|
||||
return ArrayList(colors)
|
||||
}
|
||||
|
||||
private fun fill() {
|
||||
var startValue = -4.0
|
||||
var endValue = 0.0
|
||||
val step = 0.01
|
||||
var current = startValue
|
||||
val evaluator = ArgbEvaluator()
|
||||
val interceptor = AccelerateInterpolator()
|
||||
var total = endValue - startValue
|
||||
while (current <= endValue) {
|
||||
val fraction = interceptor.getInterpolation(((current - startValue) / total).toFloat())
|
||||
val colorValue = evaluator.evaluate(fraction, COLOR_RED_DARK, COLOR_BLUE) as Int
|
||||
sorted[current] = colorValue
|
||||
current += step
|
||||
}
|
||||
startValue = 0.01
|
||||
endValue = 3.0
|
||||
current = startValue
|
||||
total = endValue - startValue
|
||||
while (current <= endValue) {
|
||||
val fraction = (current - startValue) / total
|
||||
val colorValue =
|
||||
evaluator.evaluate(fraction.toFloat(), COLOR_BLUE, COLOR_BLUE_DARK) as Int
|
||||
sorted[current] = colorValue
|
||||
current += step
|
||||
}
|
||||
}
|
||||
|
||||
fun getStrategy(): Strategy = if (isEnable) {
|
||||
(strategy ?: DefaultStrategy())
|
||||
} else DefaultStrategy()
|
||||
}
|
||||
@@ -113,7 +113,10 @@ class AutopilotControlParameters {
|
||||
var startLatLon: AutoPilotLonLat? = null
|
||||
|
||||
@JvmField
|
||||
var wayLatLons: List<AutoPilotLonLat>? = null
|
||||
var wayLatLons: List<AutoPilotLonLat>? = null // Routing 给算路引擎使用的经停点列表,不是真正的要停车
|
||||
|
||||
@JvmField
|
||||
var blackLatLons: List<AutoPilotLonLat>? = null // Routing 给算路引擎使用的黑名单点,目的是不参与算路
|
||||
|
||||
@JvmField
|
||||
var endLatLon: AutoPilotLonLat? = null
|
||||
@@ -139,6 +142,7 @@ class AutopilotControlParameters {
|
||||
@JvmField
|
||||
var autoPilotLine: AutoPilotLine? = null // 自动驾驶路线
|
||||
|
||||
|
||||
class AutoPilotLine {
|
||||
var lineId = 0L
|
||||
var lineName = ""
|
||||
@@ -216,15 +220,20 @@ class AutopilotControlParameters {
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "AutopilotControlParameters{" +
|
||||
"startName='" + startName + '\'' +
|
||||
", endName='" + endName + '\'' +
|
||||
", startLatLon=" + startLatLon +
|
||||
", wayLatLons=" + wayLatLons +
|
||||
", endLatLon=" + endLatLon +
|
||||
", speedLimit=" + speedLimit +
|
||||
", vehicleType=" + vehicleType +
|
||||
", isSpeakVoice=" + isSpeakVoice +
|
||||
'}'
|
||||
return "AutopilotControlParameters(" +
|
||||
"startName='$startName', " +
|
||||
"endName='$endName', " +
|
||||
"startLatLon=$startLatLon, " +
|
||||
"wayLatLons=$wayLatLons," +
|
||||
"blackLatLons=$blackLatLons," +
|
||||
"endLatLon=$endLatLon," +
|
||||
"speedLimit=$speedLimit, " +
|
||||
"vehicleType=$vehicleType, " +
|
||||
"routeID=$routeID, " +
|
||||
"routeName='$routeName', " +
|
||||
"isSpeakVoice=$isSpeakVoice, " +
|
||||
"autoPilotLine=$autoPilotLine)"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -103,6 +103,12 @@ public class MogoServicePaths {
|
||||
@Keep
|
||||
public static final String PATH_VISUAL_ANGLE = "/map/angle_change";
|
||||
|
||||
@Keep
|
||||
public static final String PATH_MAP_GLOBAL_TRAJECTORY = "/map/global_trajectory";
|
||||
|
||||
@Keep
|
||||
public static final String PATH_MAP_ROUTE_GUIDE = "/map/route_guide";
|
||||
|
||||
@Keep
|
||||
public static final String PATH_PATCH_UPGRADE = "/patch/api";
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.zhjt.mogo.adas.data.sweeper.task.confirm.SweeperTaskConfirm.TaskConfi
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.stop.SweeperTaskStop.StopTaskResp
|
||||
import com.zhjt.mogo.adas.data.AdasConstants
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.cloud.s_r.SweeperTaskCloudSuspendResume.BigTaskActionResp
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.yycp.paralleldriving.protocol.ParallelDrivingRequest
|
||||
|
||||
/**
|
||||
@@ -55,13 +56,16 @@ interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider {
|
||||
/**
|
||||
* 发送 轨迹下载请求
|
||||
*/
|
||||
fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine)
|
||||
fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, routeInfo: MessagePad.RouteInfo?)
|
||||
|
||||
/**
|
||||
* 发送 轨迹下载请求
|
||||
* @param downloadType 下载类型: 0:正常下载 1:预下载
|
||||
*
|
||||
* @param autoPilotLine 线路相关参数详情见PB message_pad.proto -> Line
|
||||
* @param downloadType 下载类型: 0:正常下载 1:预下载
|
||||
* @param routeInfo 20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填!
|
||||
*/
|
||||
fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int)
|
||||
fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int, routeInfo: MessagePad.RouteInfo?)
|
||||
/**
|
||||
* 结束自动驾驶
|
||||
*/
|
||||
|
||||
@@ -56,6 +56,14 @@ interface IMoGoAutopilotStatusListener {
|
||||
*/
|
||||
fun onSsmReceiveTimeout(isTimeout: Boolean) {}
|
||||
|
||||
/**
|
||||
* 域控FSM接口接收超时
|
||||
* 状态变动时才会回调,默认FSM状态正常 前提是存在FSM接口
|
||||
*
|
||||
* @param isTimeout true:FSM接口接收超时 false:FSM接口恢复正常
|
||||
*/
|
||||
fun onFsmReceiveTimeout(isTimeout: Boolean) {}
|
||||
|
||||
/**
|
||||
* 工控机主动查询 AdasManager#sendStatusQueryReq(),后会收到如下回调
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.mogo.eagle.core.function.api.autopilot
|
||||
|
||||
import fsm.Fsm2024
|
||||
|
||||
/**
|
||||
* 新版FSM状态
|
||||
*/
|
||||
interface IMoGoFsm2024Listener {
|
||||
|
||||
/**
|
||||
* FSM状态
|
||||
* 目前在启动自驾前置条件检测440版本中使用
|
||||
* @param header 头
|
||||
* @param fsmState 数据
|
||||
*/
|
||||
fun onFSM2024State(fsmState: Fsm2024.FSMStateMsg)
|
||||
|
||||
}
|
||||
@@ -316,4 +316,9 @@ interface IDevaToolsProvider : IProvider {
|
||||
fun registerStartAutopilotStateListener(tag: String, block: (isCanStartAutopilot: Boolean) -> Unit)
|
||||
|
||||
fun unRegisterStartAutopilotStateListener(tag: String)
|
||||
|
||||
/**
|
||||
* 是否开启引导线动效
|
||||
*/
|
||||
fun setRouteDynamicColorEnable(enable: Boolean)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.mogo.eagle.core.function.api.map.route
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider
|
||||
|
||||
interface IMapRouteProvider: IProvider {
|
||||
|
||||
fun setRouteDynamicColorEnable(enable: Boolean)
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.mogo.eagle.core.function.api.map.trajectory
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider
|
||||
|
||||
interface IMoGoGlobalTrajectoryDrawListener : IProvider {
|
||||
|
||||
/**
|
||||
* 是否已经在高精地图绘制了全局轨迹
|
||||
*/
|
||||
fun hasDrawnGlobalTrajectory(): Boolean
|
||||
|
||||
/**
|
||||
* 在高精地图绘制全局规划
|
||||
* @return boolean-是否绘制成功, string-绘制结果原因
|
||||
*/
|
||||
fun drawGlobalTrajectory(): Pair<Boolean, String>
|
||||
|
||||
/**
|
||||
* 清除高精地图中的全局轨迹
|
||||
*/
|
||||
fun clearGlobalTrajectory(isClearData: Boolean)
|
||||
}
|
||||
@@ -4,6 +4,8 @@ import android.os.SystemClock
|
||||
import chassis.SpecialVehicleTaskCmdOuterClass
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.toAutoPilotLine
|
||||
import com.mogo.eagle.core.data.autopilot.toRouteInfo
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagManagerEntity
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
@@ -177,12 +179,24 @@ object CallerAutoPilotControlManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送 轨迹下载请求
|
||||
*/
|
||||
fun sendTrajectoryDownloadReq(autopilotControlParameters: AutopilotControlParameters) {
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
// Routing 需要传参 routeInfo
|
||||
providerApi?.sendTrajectoryDownloadReq(autopilotControlParameters.autoPilotLine!!, autopilotControlParameters.toRouteInfo())
|
||||
CallerAutoPilotStatusListenerManager.invokeTrajectoryDownloadReq(autopilotControlParameters.autoPilotLine!!, 0)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送 轨迹下载请求
|
||||
*/
|
||||
fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine) {
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
providerApi?.sendTrajectoryDownloadReq(autoPilotLine)
|
||||
//TODO Routing 需要传参 routeInfo,这里建议业务侧重新整合到同一个数据实体内传入
|
||||
providerApi?.sendTrajectoryDownloadReq(autoPilotLine, null)
|
||||
CallerAutoPilotStatusListenerManager.invokeTrajectoryDownloadReq(autoPilotLine, 0)
|
||||
}
|
||||
}
|
||||
@@ -193,7 +207,8 @@ object CallerAutoPilotControlManager {
|
||||
*/
|
||||
fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int) {
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
providerApi?.sendTrajectoryDownloadReq(autoPilotLine, downloadType)
|
||||
//TODO Routing 需要传参 routeInfo,这里建议业务侧重新整合到同一个数据实体内传入
|
||||
providerApi?.sendTrajectoryDownloadReq(autoPilotLine, downloadType, null)
|
||||
CallerAutoPilotStatusListenerManager.invokeTrajectoryDownloadReq(autoPilotLine, downloadType)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,6 +236,19 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 域控FSM接口接收超时
|
||||
* 状态变动时才会回调,默认FSM状态正常 前提是存在FSM接口
|
||||
*
|
||||
* @param isTimeout true:FSM接口接收超时 false:FSM接口恢复正常
|
||||
*/
|
||||
fun invokeFsmReceiveTimeout(isTimeout: Boolean) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onFsmReceiveTimeout(isTimeout)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 主动调查询接口:AdasManager#sendStatusQueryReq(), 会收到以下回调
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoFsm2024Listener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import fsm.Fsm2024
|
||||
import mogo.telematics.pad.MessagePad
|
||||
|
||||
/**
|
||||
* 新版FSM状态
|
||||
*/
|
||||
object CallerFsm2024ListenerManager : CallerBase<IMoGoFsm2024Listener>() {
|
||||
|
||||
/**
|
||||
* 绿波通行(单路口)事件推送, 透传
|
||||
*/
|
||||
fun invokeFSM2024State(fsmState: Fsm2024.FSMStateMsg) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onFSM2024State(fsmState)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -396,4 +396,8 @@ object CallerDevaToolsManager {
|
||||
fun unRegisterStartAutopilotStateListener(tag: String) {
|
||||
devaToolsProviderApi?.unRegisterStartAutopilotStateListener(tag)
|
||||
}
|
||||
|
||||
fun setRouteDynamicColorEnable(enable: Boolean) {
|
||||
devaToolsProviderApi?.setRouteDynamicColorEnable(enable)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.mogo.eagle.core.function.call.map
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.map.trajectory.IMoGoGlobalTrajectoryDrawListener
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
|
||||
|
||||
object CallerMapGlobalTrajectoryDrawManager {
|
||||
|
||||
private val provider by lazy {
|
||||
ARouter.getInstance().build(MogoServicePaths.PATH_MAP_GLOBAL_TRAJECTORY)
|
||||
.navigation() as? IMoGoGlobalTrajectoryDrawListener
|
||||
}
|
||||
|
||||
fun init() {
|
||||
provider?.let {
|
||||
CallerLogger.i("CallerMapGlobalTrajectoryDrawManager", "--- init ---")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否已经在高精地图绘制了全局轨迹
|
||||
*/
|
||||
fun hasDrawnGlobalTrajectory(): Boolean {
|
||||
return provider?.hasDrawnGlobalTrajectory() ?: false
|
||||
}
|
||||
|
||||
/**
|
||||
* 在高精地图绘制全局轨迹
|
||||
* @return boolean-是否绘制成功, string-未绘制原因
|
||||
*/
|
||||
fun drawGlobalTrajectory(): Pair<Boolean, String> {
|
||||
return provider?.drawGlobalTrajectory() ?: Pair(false, "provider=null")
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除高精地图中的全局轨迹
|
||||
*/
|
||||
fun clearGlobalTrajectory(isClearData: Boolean) {
|
||||
provider?.clearGlobalTrajectory(isClearData)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -149,7 +149,7 @@ MATRIX_VERSION=2.0.8
|
||||
|
||||
|
||||
# 公交模式司机端版本号
|
||||
DRIVER_VERSION=6.4.4
|
||||
DRIVER_VERSION=6.4.6
|
||||
# 公交模式乘客端端版本号
|
||||
PASSENGER_VERSION=5.4.4
|
||||
PASSENGER_VERSION=5.4.6
|
||||
|
||||
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
||||
#Fri Sep 22 11:53:55 CST 2023
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
|
||||
distributionUrl=https\://mirrors.tencent.com/gradle/gradle-6.1.1-all.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -30,6 +30,7 @@ public enum MessageType {
|
||||
TYPE_RECEIVE_M1_STITCHED_VIDEO(MessagePad.MessageType.MsgTypeM1StitchedVideo, "M1拼接视频"),
|
||||
TYPE_RECEIVE_SSM(MessagePad.MessageType.MsgTypeSSMState, "SSM系统状态"),
|
||||
TYPE_RECEIVE_FM_STATE(MessagePad.MessageType.MsgTypeFMState, "FM状态"),
|
||||
TYPE_RECEIVE_FSM2024_STATE(MessagePad.MessageType.MsgTypeFSM2024State, "FSM状态"),
|
||||
|
||||
TYPE_RECEIVE_BASIC_INFO_REQ(MessagePad.MessageType.MsgTypeBasicInfoReq, "自动驾驶设备基础信息请求"),
|
||||
TYPE_SEND_BASIC_INFO_RESP(MessagePad.MessageType.MsgTypeBasicInfoResp, "自动驾驶设备基础信息应答"),
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.json.JSONObject;
|
||||
|
||||
import chassis.Chassis;
|
||||
import chassis.ChassisStatesOuterClass;
|
||||
import fsm.Fsm2024;
|
||||
import function_state_management.FSMStatusReasonQueryOuterClass;
|
||||
import system_master.SsmInfo;
|
||||
import system_master.SystemStatusInfo;
|
||||
@@ -45,14 +46,19 @@ public class LaunchConditionData {
|
||||
*/
|
||||
public final SsmInfo.SsmStatusInf ssmInfo;
|
||||
public final FSMStatusReasonQueryOuterClass.FSMStatusReasonRespond fsmStatusReasonRespond;//FSM数据
|
||||
public final Fsm2024.FSMStateMsg fsmState;//FSM数据
|
||||
|
||||
public final long createTime;
|
||||
|
||||
public LaunchConditionData(String abilityVersion, Fsm2024.FSMStateMsg fsmState) {
|
||||
this(abilityVersion, null, Float.MAX_VALUE, null, null, null, null, fsmState);
|
||||
}
|
||||
|
||||
public LaunchConditionData(String abilityVersion,
|
||||
SystemStatusInfo.StatusInfo statusInfo,
|
||||
SsmInfo.SsmStatusInf ssmInfo,
|
||||
FSMStatusReasonQueryOuterClass.FSMStatusReasonRespond fsmStatusReasonRespond) {
|
||||
this(abilityVersion, null, Float.MAX_VALUE, null, statusInfo, ssmInfo, fsmStatusReasonRespond);
|
||||
this(abilityVersion, null, Float.MAX_VALUE, null, statusInfo, ssmInfo, fsmStatusReasonRespond, null);
|
||||
}
|
||||
|
||||
public LaunchConditionData(String abilityVersion,
|
||||
@@ -62,6 +68,17 @@ public class LaunchConditionData {
|
||||
SystemStatusInfo.StatusInfo statusInfo,
|
||||
SsmInfo.SsmStatusInf ssmInfo,
|
||||
FSMStatusReasonQueryOuterClass.FSMStatusReasonRespond fsmStatusReasonRespond) {
|
||||
this(abilityVersion, chassisStates, oldSteering, light, statusInfo, ssmInfo, fsmStatusReasonRespond, null);
|
||||
}
|
||||
|
||||
public LaunchConditionData(String abilityVersion,
|
||||
ChassisStatesOuterClass.ChassisStates chassisStates,
|
||||
float oldSteering,
|
||||
Chassis.LightSwitch light,
|
||||
SystemStatusInfo.StatusInfo statusInfo,
|
||||
SsmInfo.SsmStatusInf ssmInfo,
|
||||
FSMStatusReasonQueryOuterClass.FSMStatusReasonRespond fsmStatusReasonRespond,
|
||||
Fsm2024.FSMStateMsg fsmState) {
|
||||
this.abilityVersion = abilityVersion;
|
||||
this.chassisStates = chassisStates;
|
||||
this.oldSteering = oldSteering;
|
||||
@@ -69,6 +86,7 @@ public class LaunchConditionData {
|
||||
this.statusInfo = statusInfo;
|
||||
this.ssmInfo = ssmInfo;
|
||||
this.fsmStatusReasonRespond = fsmStatusReasonRespond;
|
||||
this.fsmState = fsmState;
|
||||
createTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
@@ -78,9 +96,10 @@ public class LaunchConditionData {
|
||||
jsonObject.put("ability_version", abilityVersion);
|
||||
jsonObject.put("create_object_time", createTime);
|
||||
JSONArray array = new JSONArray();
|
||||
JSONObject chassisStatesObject = new JSONObject();
|
||||
chassisStatesObject.put("name", "ChassisStates");
|
||||
JSONObject chassisStatesObject = null;
|
||||
if (chassisStates != null) {
|
||||
chassisStatesObject = new JSONObject();
|
||||
chassisStatesObject.put("name", "ChassisStates");
|
||||
if (chassisStates.hasHeader()) {
|
||||
chassisStatesObject.put("data_header", TextFormat.printer().escapingNonAscii(false).printToString(chassisStates.getHeader()));
|
||||
}
|
||||
@@ -120,18 +139,27 @@ public class LaunchConditionData {
|
||||
}
|
||||
//车灯
|
||||
if (light != null) {
|
||||
if (chassisStatesObject == null) {
|
||||
chassisStatesObject = new JSONObject();
|
||||
chassisStatesObject.put("name", "ChassisStates");
|
||||
}
|
||||
chassisStatesObject.put("light", light.name());
|
||||
}
|
||||
array.put(chassisStatesObject);
|
||||
if (chassisStatesObject != null) {
|
||||
array.put(chassisStatesObject);
|
||||
}
|
||||
if (statusInfo != null) {
|
||||
arrayPut(array, statusInfo.getClass().getName(), statusInfo.getAutoPilotReady(), statusInfo.getAutoPilotUnreadyReason());
|
||||
arrayPut(array, statusInfo);
|
||||
}
|
||||
if (ssmInfo != null) {
|
||||
arrayPut(array, ssmInfo.getClass().getName(), ssmInfo.getAutoPilotReady(), ssmInfo.getAutoPilotUnreadyReason());
|
||||
arrayPut(array, ssmInfo);
|
||||
}
|
||||
if (fsmStatusReasonRespond != null) {
|
||||
arrayPut(array, fsmStatusReasonRespond);
|
||||
}
|
||||
if (fsmState != null) {
|
||||
arrayPut(array, fsmState);
|
||||
}
|
||||
if (array.length() > 0) {
|
||||
jsonObject.put("data", array);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,8 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* 监控事件报告中定义的事件以及解释
|
||||
* 根据MAP4.2.0事件定义编写 最后修改于2024-04-07
|
||||
* 根据诊断事件定义表 第143版 编写 最后修改于2024-06-13
|
||||
* 由于 MAP420及以后版本 诊断事件定义表 中不会标记 新增版本以及弃用版本,所以将不再使用 @ReportState进行版本注解
|
||||
*/
|
||||
public class MogoReport {
|
||||
public interface Result {
|
||||
@@ -341,6 +342,8 @@ public class MogoReport {
|
||||
@ReportState("4.2.0")
|
||||
String HOST_MEMORY_EXCEED = "EMAP_HOST_MEMORY_EXCEED";//系统内存占用过高
|
||||
|
||||
String ENTRY_AUTOPILOT_FOR_GEAR_NOT_READY = "EMAP_ENTRY_AUTOPILOT_FOR_GEAR_NOT_READY";//档位不正确未进自驾
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -583,6 +586,14 @@ public class MogoReport {
|
||||
@ReportState("4.1.0")
|
||||
String RADAR_CHECK_FAILED = "ECLB_RADAR_CHECK_FAILED";//radar标定自检算法失败,无法判定外参是否正常,建议重试
|
||||
}
|
||||
|
||||
/**
|
||||
* EFSM(功能状态管理)
|
||||
*/
|
||||
interface EFSM {
|
||||
@ReportState("4.4.0")
|
||||
String ENTRY_AUTOPILOT = "EFSM_ENTRY_AUTOPILOT";//FSM因为某些原因未进自驾
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -973,6 +984,8 @@ public class MogoReport {
|
||||
String REMOTE_PILOT_STATE_CHANGED = "IFSM_REMOTE_PILOT_STATE_CHANGED";//平行驾驶状态机变化
|
||||
@ReportState("3.5.0")
|
||||
String TELECTRL_PILOT_STATE_CHANGED = "IFSM_TELECTRL_PILOT_STATE_CHANGED";//遥感驾驶状态机变化
|
||||
@ReportState("4.4.0")
|
||||
String RECEIVE_AP_REQUEST = "IFSM_RECEIVE_AP_REQUEST";//FSM收到自驾或平行驾驶或手动驾驶请求信号
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,6 +14,7 @@ public class UnableLaunchReason {
|
||||
CHASSIS,//底盤
|
||||
SSM,
|
||||
FSM,
|
||||
FSM2024,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -31,7 +32,9 @@ public class UnableLaunchReason {
|
||||
CHASSIS_HAZARD_LIGHTS,//危险报警灯
|
||||
SSM_OFFER,//SSM提供的原因
|
||||
FSM_OFFER,//FSM提供的原因
|
||||
SSM_TIMEOUT//SSM超时
|
||||
FSM2024_OFFER,//FSM2024提供的原因
|
||||
SSM_TIMEOUT,//SSM超时
|
||||
FSM2024_TIMEOUT//FSM2024超时
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
53
libraries/mogo-adas-data/src/main/proto/fsm2024.proto
Normal file
53
libraries/mogo-adas-data/src/main/proto/fsm2024.proto
Normal file
@@ -0,0 +1,53 @@
|
||||
syntax = "proto2";
|
||||
package fsm;
|
||||
|
||||
import "header.proto";
|
||||
|
||||
enum State {
|
||||
OFF = 0;
|
||||
STANDBY = 1; //Standby 未来会弃用, 并入OFF
|
||||
ACTIVATING = 2;
|
||||
PILOT_DRIVING_ACTIVE = 3; //未来会被弃用,所有激活状态统一在Active状态下作为子状态管理
|
||||
PARALLEL_DRIVING_ACTIVE = 4; //未来会被弃用,所有激活状态统一在Active状态下作为子状态管理
|
||||
SAFETY_STOP = 5;
|
||||
ACTIVE = 6;
|
||||
}
|
||||
|
||||
enum SafetyStopMode {
|
||||
NOT_NEEDED = 0;
|
||||
PLANNER_STOP = 1;
|
||||
CONTROLLER_COMFORT_STOP = 2;
|
||||
CONTROLLER_EMERGENCY_STOP = 3;
|
||||
}
|
||||
|
||||
enum ActiveMode {
|
||||
NOT_ACTIVE= 0;
|
||||
PILOT_ACTIVE= 1;
|
||||
PARALLEL_ACTIVE= 2;
|
||||
SIMULATOR_ACTIVE= 3; //模拟器驾驶, M1上专用
|
||||
}
|
||||
|
||||
message FSMStateMsg {
|
||||
required common.Header header = 1;
|
||||
required State function_state = 2;
|
||||
required SafetyStopMode fsm_safety_stop_mode = 4; //FSM如果进入safety stop,是planning 进行停车,还是control进行舒适停车,还是control进行紧急停车
|
||||
|
||||
required ActiveMode active_mode = 6;
|
||||
|
||||
required bool new_msg_flag = 10;
|
||||
|
||||
required bool pilot_standby_flag = 11;
|
||||
required bool parallel_standby_flag = 12;
|
||||
required bool simulator_standby_flag = 13;
|
||||
|
||||
optional string pilot_not_standby_reason= 21; //FSM 无法自驾无法就绪的原因。
|
||||
optional string parallel_not_standby_reason= 22; //FSM 无法平行即使就绪原因
|
||||
optional string simulator_not_standby_reason= 23; //FSM 无法模拟器驾驶原因
|
||||
|
||||
optional uint64 fail_to_pilot_session_id= 36;
|
||||
optional uint64 fail_to_parallel_session_id= 37;
|
||||
optional uint64 fail_to_simulator_session_id= 38;
|
||||
|
||||
optional string abnormal_state_trans_reason= 41; //FSM 异常退出ACTIVATING/自驾/平行驾驶/模拟器驾驶原因 (包括接管)
|
||||
|
||||
}
|
||||
@@ -35,6 +35,7 @@ enum MessageType
|
||||
MsgTypeM1StitchedVideo = 0x1000e; //m1拼接视频 定频10hz
|
||||
MsgTypeSSMState = 0x1000f; //ssm 系统状态 定频1hz hq m1 MAP350开始支持,其他车型MAP360开始支持
|
||||
MsgTypeFMState = 0x10010; //FM状态 定频1hz bus和清扫车是MAP370开始支持,其他车型MAP360开始支持
|
||||
MsgTypeFSM2024State = 0x10011; //20240531 FSM状态 定频10hz (telematics做状态变化判断,无变化10hz上报,有变化立即上报) BUS MAP440开始支持,其他车型暂未支持
|
||||
|
||||
//### 以下消息全部不定频 ###
|
||||
MsgTypeBasicInfoReq = 0x10100; //自动驾驶设备基础信息请求
|
||||
@@ -272,6 +273,8 @@ message TrajectoryDownloadReq
|
||||
Line line = 1; //路线
|
||||
uint32 source = 2; //指令来源: 0: default, 1:pad, 2:aicloud
|
||||
uint32 downloadType = 3; //下载类型: 0:正常下载 1:预下载
|
||||
|
||||
RouteInfo routeInfo = 4; //20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填!(Line信息重复)
|
||||
}
|
||||
|
||||
// message definition for MessageType: MsgTypeBasicInfoReq
|
||||
@@ -297,6 +300,8 @@ message Location
|
||||
double latitude = 2;
|
||||
double altitude = 3;
|
||||
double heading = 4;
|
||||
|
||||
bool station = 5; //20240523, 判断此点是中间站点还是途径点 ------- true:站点, false:简单的途径点
|
||||
}
|
||||
|
||||
message RouteInfo
|
||||
@@ -311,7 +316,10 @@ message RouteInfo
|
||||
bool isSpeakVoice = 8; //abandoned
|
||||
uint32 routeID = 9;
|
||||
string routeName = 10;
|
||||
Line line = 11; //路线信息
|
||||
Line line = 11; //路线信息,原有轨迹线路信息
|
||||
|
||||
repeated Location blackPoints = 12; //20240523 不让走的道路,异常线路点
|
||||
bool isStation = 13; //20240523 用于表示判断是否是站点下单。默认false:起点下单,接管下单; true: 中间站点下单
|
||||
}
|
||||
|
||||
message SetAutopilotModeReq
|
||||
@@ -319,6 +327,7 @@ message SetAutopilotModeReq
|
||||
uint32 mode = 1; //1: enter autopilot mode, 0: quit autopilot mode
|
||||
uint32 source = 2; //命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线)
|
||||
RouteInfo routeInfo = 3; //自动驾驶路径信息
|
||||
|
||||
}
|
||||
|
||||
// message definition for MsgTypeSetDemoModeReq
|
||||
@@ -747,3 +756,6 @@ message SessionInfo
|
||||
|
||||
//message definition for MsgTypeFMState
|
||||
//refer to fm_info.proto for details
|
||||
|
||||
//message definition for MsgTypeFSM2024State
|
||||
//refer to fsm2024.proto
|
||||
|
||||
@@ -1189,9 +1189,9 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
* 设置自动驾驶模式 启动自动驾驶
|
||||
* 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL},详情参见CheckSystemView中的onReceiveReceivedAck
|
||||
*
|
||||
* @param mode 1: enter autopilot mode, 0: quit autopilot mode
|
||||
* @param source 命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线)
|
||||
* @param routeInfo 自动驾驶路径信息
|
||||
* @param mode 1: enter autopilot mode, 0: quit autopilot mode
|
||||
* @param source 命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线)
|
||||
* @param routeInfo 自动驾驶路径信息
|
||||
* @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID
|
||||
* * >=0:表示添加到WS发送消息队列
|
||||
* * =0:表示乘客屏模式添加到WS发送消息队列
|
||||
@@ -1655,8 +1655,9 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
* 发送 轨迹下载请求
|
||||
* 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL},详情参见CheckSystemView中的onReceiveReceivedAck
|
||||
*
|
||||
* @param line 线路相关参数详情见PB message_pad.proto -> Line
|
||||
* @param downloadType 下载类型: 0:正常下载 1:预下载
|
||||
* @param line 线路相关参数详情见PB message_pad.proto -> Line
|
||||
* @param downloadType 下载类型: 0:正常下载 1:预下载
|
||||
* @param routeInfo 20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填!
|
||||
* @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID
|
||||
* * >=0:表示添加到WS发送消息队列
|
||||
* * =0:表示乘客屏模式添加到WS发送消息队列
|
||||
@@ -1669,13 +1670,18 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
paramIndexes = {0}
|
||||
)
|
||||
@Override
|
||||
public long sendTrajectoryDownloadReq(MessagePad.Line line, int downloadType) {
|
||||
public long sendTrajectoryDownloadReq(MessagePad.Line line, int downloadType, MessagePad.RouteInfo routeInfo) {
|
||||
MessagePad.TrajectoryDownloadReq.Builder builder = MessagePad.TrajectoryDownloadReq.newBuilder();
|
||||
builder.setSource(1);//指令来源: 0: default, 1:pad, 2:aicloud
|
||||
builder.setLine(line);
|
||||
if (line != null) {
|
||||
builder.setLine(line);
|
||||
}
|
||||
if (downloadType > -1) {
|
||||
builder.setDownloadType(downloadType);
|
||||
}
|
||||
if (routeInfo != null) {
|
||||
builder.setRouteInfo(routeInfo);
|
||||
}
|
||||
MessagePad.TrajectoryDownloadReq req = builder.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_TRAJECTORY_DOWNLOAD_REQ, req.toByteArray());
|
||||
}
|
||||
|
||||
@@ -393,9 +393,9 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
* 设置自动驾驶模式 启动自动驾驶
|
||||
* 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL},详情参见CheckSystemView中的onReceiveReceivedAck
|
||||
*
|
||||
* @param mode 1: enter autopilot mode, 0: quit autopilot mode
|
||||
* @param source 命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线)
|
||||
* @param routeInfo 自动驾驶路径信息
|
||||
* @param mode 1: enter autopilot mode, 0: quit autopilot mode
|
||||
* @param source 命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线)
|
||||
* @param routeInfo 自动驾驶路径信息
|
||||
* @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID
|
||||
* * >=0:表示添加到WS发送消息队列
|
||||
* * =0:表示乘客屏模式添加到WS发送消息队列
|
||||
@@ -758,30 +758,32 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
* 发送 轨迹下载请求
|
||||
* 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL},详情参见CheckSystemView中的onReceiveReceivedAck
|
||||
*
|
||||
* @param line 线路相关参数详情见PB message_pad.proto -> Line
|
||||
* @param line 线路相关参数详情见PB message_pad.proto -> Line
|
||||
* @param routeInfo 20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填!
|
||||
* @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID
|
||||
* * >=0:表示添加到WS发送消息队列
|
||||
* * =0:表示乘客屏模式添加到WS发送消息队列
|
||||
* * -1L:添加到WS发送消息队列失败
|
||||
*/
|
||||
public long sendTrajectoryDownloadReq(MessagePad.Line line) {
|
||||
return mChannel == null ? -1L : mChannel.sendTrajectoryDownloadReq(line, -1);
|
||||
public long sendTrajectoryDownloadReq(MessagePad.Line line, MessagePad.RouteInfo routeInfo) {
|
||||
return mChannel == null ? -1L : mChannel.sendTrajectoryDownloadReq(line, -1, routeInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送 轨迹下载请求
|
||||
* 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL},详情参见CheckSystemView中的onReceiveReceivedAck
|
||||
*
|
||||
* @param line 线路相关参数详情见PB message_pad.proto -> Line
|
||||
* @param downloadType 下载类型: 0:正常下载 1:预下载
|
||||
* @param line 线路相关参数详情见PB message_pad.proto -> Line
|
||||
* @param downloadType 下载类型: 0:正常下载 1:预下载
|
||||
* @param routeInfo 20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填!
|
||||
* @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID
|
||||
* * >=0:表示添加到WS发送消息队列
|
||||
* * =0:表示乘客屏模式添加到WS发送消息队列
|
||||
* * -1L:添加到WS发送消息队列失败
|
||||
*/
|
||||
@Override
|
||||
public long sendTrajectoryDownloadReq(MessagePad.Line line, int downloadType) {
|
||||
return mChannel == null ? -1L : mChannel.sendTrajectoryDownloadReq(line, downloadType);
|
||||
public long sendTrajectoryDownloadReq(MessagePad.Line line, int downloadType, MessagePad.RouteInfo routeInfo) {
|
||||
return mChannel == null ? -1L : mChannel.sendTrajectoryDownloadReq(line, downloadType, routeInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -173,9 +173,9 @@ public interface IAdasNetCommApi {
|
||||
* 设置自动驾驶模式 启动自动驾驶
|
||||
* 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL},详情参见CheckSystemView中的onReceiveReceivedAck
|
||||
*
|
||||
* @param mode 1: enter autopilot mode, 0: quit autopilot mode
|
||||
* @param source 命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线)
|
||||
* @param routeInfo 自动驾驶路径信息
|
||||
* @param mode 1: enter autopilot mode, 0: quit autopilot mode
|
||||
* @param source 命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线)
|
||||
* @param routeInfo 自动驾驶路径信息
|
||||
* @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID
|
||||
* * >=0:表示添加到WS发送消息队列
|
||||
* * =0:表示乘客屏模式添加到WS发送消息队列
|
||||
@@ -475,14 +475,15 @@ public interface IAdasNetCommApi {
|
||||
* 发送 轨迹下载请求
|
||||
* 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL},详情参见CheckSystemView中的onReceiveReceivedAck
|
||||
*
|
||||
* @param line 线路相关参数详情见PB message_pad.proto -> Line
|
||||
* @param downloadType 下载类型: 0:正常下载 1:预下载
|
||||
* @param line 线路相关参数详情见PB message_pad.proto -> Line
|
||||
* @param downloadType 下载类型: 0:正常下载 1:预下载
|
||||
* @param routeInfo 20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填!
|
||||
* @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID
|
||||
* * >=0:表示添加到WS发送消息队列
|
||||
* * =0:表示乘客屏模式添加到WS发送消息队列
|
||||
* * -1L:添加到WS发送消息队列失败
|
||||
*/
|
||||
long sendTrajectoryDownloadReq(MessagePad.Line line, int downloadType);
|
||||
long sendTrajectoryDownloadReq(MessagePad.Line line, int downloadType, MessagePad.RouteInfo routeInfo);
|
||||
|
||||
/**
|
||||
* 发送 状态查询请求
|
||||
|
||||
@@ -30,6 +30,7 @@ import chassis.Chassis;
|
||||
import chassis.ChassisStatesOuterClass;
|
||||
import chassis.VehicleStateOuterClass;
|
||||
import fault_management.FmInfo;
|
||||
import fsm.Fsm2024;
|
||||
import function_state_management.FunctionStates;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo.v2x.MogoV2X;
|
||||
@@ -237,6 +238,14 @@ public interface OnAdasListener {
|
||||
*/
|
||||
void onFaultManagementState(MessagePad.Header header, @NonNull FmInfo.FaultResultMsg fmInfo);
|
||||
|
||||
/**
|
||||
* FSM状态
|
||||
*
|
||||
* @param header 头
|
||||
* @param fsmState 数据
|
||||
*/
|
||||
void onFSM2024State(@NonNull MessagePad.Header header, @NonNull Fsm2024.FSMStateMsg fsmState);
|
||||
|
||||
/**
|
||||
* 数据采集配置应答
|
||||
*
|
||||
@@ -488,6 +497,14 @@ public interface OnAdasListener {
|
||||
*/
|
||||
void onSsmReceiveTimeout(boolean isTimeout);
|
||||
|
||||
/**
|
||||
* 域控FSM接口接收超时
|
||||
* 状态变动时才会回调,默认FSM状态正常 前提是存在FSM接口
|
||||
*
|
||||
* @param isTimeout true:FSM接口接收超时 false:FSM接口恢复正常
|
||||
*/
|
||||
void onFsm2024ReceiveTimeout(boolean isTimeout);
|
||||
|
||||
/**
|
||||
* 是否有能力启动自动驾驶
|
||||
*
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.zhidao.support.adas.high.common.autopilot.ability;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.zhjt.mogo.adas.data.bean.LaunchConditionData;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import fsm.Fsm2024;
|
||||
|
||||
/**
|
||||
* 是否可以启动自动驾驶能力检测 工控机版本>=4400&&(isJinlv||isJinlvM1||isJinlvM) 使用此类
|
||||
* 目前监控了FSM2024状态
|
||||
*/
|
||||
public class AutopilotAbility440 {
|
||||
private final String TAG = this.getClass().getSimpleName();
|
||||
|
||||
@NonNull
|
||||
private final AutopilotAbilityManager manager;
|
||||
private OnAutopilotAbilityListener listener;
|
||||
|
||||
|
||||
public AutopilotAbility440(@NonNull AutopilotAbilityManager manager) {
|
||||
this.manager = manager;
|
||||
}
|
||||
|
||||
|
||||
public void setFSMState(Fsm2024.FSMStateMsg fsmState) {
|
||||
onCallbackFsm(fsmState);
|
||||
}
|
||||
|
||||
protected void onCallFsmTimeout() {
|
||||
onCallbackFsm(null);
|
||||
}
|
||||
|
||||
protected void onCallbackFsm(Fsm2024.FSMStateMsg fsmState) {
|
||||
ArrayList<UnableLaunchReason> unableAutopilotReasons = null;//不能启动自动驾驶原因
|
||||
if (fsmState == null) {
|
||||
unableAutopilotReasons = manager.addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.LIB, UnableLaunchReason.UnableType.FSM2024_TIMEOUT, "FSM超时无响应");
|
||||
} else {
|
||||
if (!fsmState.getPilotStandbyFlag()) {
|
||||
unableAutopilotReasons = manager.addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.FSM2024, UnableLaunchReason.UnableType.FSM2024_OFFER, fsmState.getPilotNotStandbyReason());
|
||||
}
|
||||
}
|
||||
if (listener != null) {
|
||||
boolean isAutopilotAbility = unableAutopilotReasons == null || unableAutopilotReasons.isEmpty();//是否能启动自动驾驶
|
||||
listener.onAutopilotAbility(isAutopilotAbility, new LaunchConditionData(this.getClass().getSimpleName(), fsmState), unableAutopilotReasons);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public synchronized void start(OnAutopilotAbilityListener listener) {
|
||||
this.listener = listener;
|
||||
|
||||
}
|
||||
|
||||
public synchronized void stop() {
|
||||
this.listener = null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,6 +18,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import chassis.Chassis;
|
||||
import chassis.ChassisStatesOuterClass;
|
||||
import fsm.Fsm2024;
|
||||
import function_state_management.FSMStatusReasonQueryOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import system_master.SsmInfo;
|
||||
@@ -32,7 +33,7 @@ import system_master.SystemStatusInfo;
|
||||
*/
|
||||
public class AutopilotAbilityManager implements OnAutopilotAbilityListener {
|
||||
private static final String TAG = AutopilotAbilityManager.class.getSimpleName();
|
||||
protected static final long DEFAULT_SSM_TIMEOUT = 5000L;//SSM超时时间
|
||||
protected static final long DEFAULT_TIMEOUT = 5000L;//SSM和FSM超时时间
|
||||
protected static final long DEFAULT_DETECTION_TIME = 3 * 1000L;//默认检测周期
|
||||
protected static final String[] NODE_INFO_STATE = {"未知状态", "依赖未就绪", "启动中", "运行", "停止", "无法启动状态", "人为启动状态", "人为关闭状态"};
|
||||
protected static final String[] NODE_INFO_STATE_FIXED_FREQUENCY = {"未知状态", "依赖未就绪", "启动中", "运行", "停止", "无法启动状态", "非自动启动状态", "非自动关闭状态"};
|
||||
@@ -41,24 +42,29 @@ public class AutopilotAbilityManager implements OnAutopilotAbilityListener {
|
||||
private OnAdasListener listener;
|
||||
private int mapVersion = -1;//工控机版本
|
||||
private boolean isFutianSweeper = false;//是否是福田清扫车
|
||||
private boolean isJinlv = false;//是否是小巴
|
||||
private boolean isJinlvM1 = false;//是否是M1
|
||||
private boolean isJinlvM2 = false;//是否是M2
|
||||
private boolean isHQ = false;//是否是HQ
|
||||
private AutopilotAbility230 autopilotAbility230;
|
||||
private AutopilotAbility250 autopilotAbility250;
|
||||
private AutopilotAbility330 autopilotAbility330;
|
||||
private AutopilotAbility350And360 autopilotAbility350And360;
|
||||
private AutopilotAbility360 autopilotAbility360;
|
||||
private AutopilotAbility440 autopilotAbility440;
|
||||
private Timer startTimer;
|
||||
private Timer ssmTimeoutTimer;//SSM超时计时器
|
||||
private Timer timeoutTimer;//SSM和FSM超时计时器
|
||||
private long ssmReceiveTime;//SSM接收时间
|
||||
private long fsmReceiveTime;//FSM接收时间
|
||||
|
||||
private final AtomicBoolean isOldSsmTimeout = new AtomicBoolean(false);//SSM是否超时 老状态
|
||||
private final AtomicBoolean isOldFsmTimeout = new AtomicBoolean(false);//FSM是否超时 老状态
|
||||
private final AtomicBoolean isInitCarConfig = new AtomicBoolean(false);//车辆信息是否初始化
|
||||
/**
|
||||
* 能启动自动驾驶的档位
|
||||
*/
|
||||
private Set<Chassis.GearPosition> launchAutopilotGear;
|
||||
|
||||
private boolean isSupportFSM2024 = false;
|
||||
|
||||
private AutopilotAbilityManager() {
|
||||
}
|
||||
@@ -109,7 +115,9 @@ public class AutopilotAbilityManager implements OnAutopilotAbilityListener {
|
||||
isInitCarConfig.set(true);
|
||||
mapVersion = version;
|
||||
isFutianSweeper = carConfig.getIsFutianSweeper();
|
||||
isJinlv = carConfig.getIsJinlv();
|
||||
isJinlvM1 = carConfig.getIsJinlvM1();
|
||||
isJinlvM2 = carConfig.getIsJinlvM2();
|
||||
isHQ = carConfig.getIsHQ();
|
||||
initAutopilotAbility();
|
||||
if (autopilotAbility230 != null) {
|
||||
@@ -165,6 +173,14 @@ public class AutopilotAbilityManager implements OnAutopilotAbilityListener {
|
||||
}
|
||||
}
|
||||
|
||||
public void setFSM2024State(Fsm2024.FSMStateMsg fsmState) {
|
||||
fsmReceiveTime = System.currentTimeMillis();
|
||||
onCallFSMTimeout(false);
|
||||
if (autopilotAbility440 != null) {
|
||||
autopilotAbility440.setFSMState(fsmState);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 底盘状态更新
|
||||
*
|
||||
@@ -197,13 +213,20 @@ public class AutopilotAbilityManager implements OnAutopilotAbilityListener {
|
||||
|
||||
private void initAutopilotAbility() {
|
||||
stopAllTimer();
|
||||
if (mapVersion >= 30600 && isFutianSweeper) {
|
||||
isSupportFSM2024 = false;
|
||||
if (mapVersion >= 40400 && (isJinlv || isJinlvM1 || isJinlvM2)) {
|
||||
isSupportFSM2024 = true;
|
||||
CupidLogUtils.log(TAG, "能否启动自驾能力检测使用版本:440");
|
||||
if (autopilotAbility440 == null) {
|
||||
autopilotAbility440 = new AutopilotAbility440(this);
|
||||
autopilotAbility440.start(this);
|
||||
}
|
||||
} else if (mapVersion >= 30600 && isFutianSweeper) {
|
||||
CupidLogUtils.log(TAG, "能否启动自驾能力检测使用版本:360清扫车专用");
|
||||
if (autopilotAbility360 == null) {
|
||||
autopilotAbility360 = new AutopilotAbility360(this);
|
||||
autopilotAbility360.start(this);
|
||||
}
|
||||
|
||||
} else if ((mapVersion >= 30500 && (isJinlvM1 || isHQ)) || mapVersion >= 30600) {
|
||||
CupidLogUtils.log(TAG, "能否启动自驾能力检测使用版本:350和360共用");
|
||||
if (autopilotAbility350And360 == null) {
|
||||
@@ -231,7 +254,7 @@ public class AutopilotAbilityManager implements OnAutopilotAbilityListener {
|
||||
}
|
||||
}
|
||||
if (autopilotAbility230 == null) {
|
||||
startSsmTimeoutTimer();//MAP230及以下没有SSM所以不需要超时
|
||||
startTimeoutTimer();//MAP230及以下没有SSM和FSM所以不需要超时
|
||||
}
|
||||
}
|
||||
|
||||
@@ -270,6 +293,13 @@ public class AutopilotAbilityManager implements OnAutopilotAbilityListener {
|
||||
}
|
||||
}
|
||||
|
||||
private void stop440() {
|
||||
if (autopilotAbility440 != null) {
|
||||
autopilotAbility440.stop();
|
||||
autopilotAbility440 = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void stopTimer() {
|
||||
if (startTimer != null) {
|
||||
startTimer.cancel();
|
||||
@@ -298,12 +328,14 @@ public class AutopilotAbilityManager implements OnAutopilotAbilityListener {
|
||||
}
|
||||
|
||||
|
||||
private void stopSsmTimeoutTimer() {
|
||||
if (ssmTimeoutTimer != null) {
|
||||
private void stopTimeoutTimer() {
|
||||
if (timeoutTimer != null) {
|
||||
isOldSsmTimeout.set(false);
|
||||
isOldFsmTimeout.set(false);
|
||||
ssmReceiveTime = 0;
|
||||
ssmTimeoutTimer.cancel();
|
||||
ssmTimeoutTimer = null;
|
||||
fsmReceiveTime = 0;
|
||||
timeoutTimer.cancel();
|
||||
timeoutTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,15 +343,17 @@ public class AutopilotAbilityManager implements OnAutopilotAbilityListener {
|
||||
* 连接工控机成功调用此函数,如果dockerVersion还未获取到将启动最低版本的启动自动驾驶能力检测
|
||||
* 此函数为保险措施 以防无法获取工控机版本时 也能 正常执行逻辑
|
||||
*/
|
||||
public synchronized void startSsmTimeoutTimer() {
|
||||
if (ssmTimeoutTimer == null) {
|
||||
public synchronized void startTimeoutTimer() {
|
||||
if (timeoutTimer == null) {
|
||||
ssmReceiveTime = System.currentTimeMillis();
|
||||
ssmTimeoutTimer = new Timer();
|
||||
ssmTimeoutTimer.schedule(new TimerTask() {
|
||||
fsmReceiveTime = System.currentTimeMillis();
|
||||
timeoutTimer = new Timer();
|
||||
timeoutTimer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
//SSM超时检测
|
||||
long timeDifference = System.currentTimeMillis() - ssmReceiveTime;
|
||||
if (timeDifference >= DEFAULT_SSM_TIMEOUT) {
|
||||
if (timeDifference >= DEFAULT_TIMEOUT) {
|
||||
onCallSSMTimeout(true);
|
||||
//超时
|
||||
if (autopilotAbility250 != null) {
|
||||
@@ -335,8 +369,18 @@ public class AutopilotAbilityManager implements OnAutopilotAbilityListener {
|
||||
autopilotAbility360.onCallTimeout();
|
||||
}
|
||||
}
|
||||
//FSM超时检测
|
||||
if (isSupportFSM2024) {
|
||||
timeDifference = System.currentTimeMillis() - fsmReceiveTime;
|
||||
if (timeDifference >= DEFAULT_TIMEOUT) {
|
||||
onCallFSMTimeout(true);
|
||||
if (autopilotAbility440 != null) {
|
||||
autopilotAbility440.onCallFsmTimeout();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 1000L, DEFAULT_SSM_TIMEOUT);
|
||||
}, 1000L, DEFAULT_TIMEOUT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,14 +391,22 @@ public class AutopilotAbilityManager implements OnAutopilotAbilityListener {
|
||||
}
|
||||
}
|
||||
|
||||
private synchronized void onCallFSMTimeout(boolean isTimeout) {
|
||||
if (isTimeout != isOldFsmTimeout.get()) {
|
||||
isOldFsmTimeout.set(isTimeout);
|
||||
listener.onFsm2024ReceiveTimeout(isTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
private void stopAllTimer() {
|
||||
stopSsmTimeoutTimer();
|
||||
stopTimeoutTimer();
|
||||
stopTimer();
|
||||
stop230();
|
||||
stop250();
|
||||
stop330();
|
||||
stop350And360();
|
||||
stop360();
|
||||
stop440();
|
||||
}
|
||||
|
||||
public synchronized void stop() {
|
||||
@@ -363,7 +415,10 @@ public class AutopilotAbilityManager implements OnAutopilotAbilityListener {
|
||||
mapVersion = -1;
|
||||
isFutianSweeper = false;
|
||||
isHQ = false;
|
||||
isJinlv = false;
|
||||
isJinlvM1 = false;
|
||||
isJinlvM2 = false;
|
||||
isSupportFSM2024 = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.zhidao.support.adas.high.msg;
|
||||
|
||||
import android.os.SystemClock;
|
||||
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import com.zhidao.support.adas.high.AdasChannel;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhidao.support.adas.high.common.autopilot.ability.AutopilotAbilityManager;
|
||||
import com.zhidao.support.adas.high.protocol.RawData;
|
||||
|
||||
import fsm.Fsm2024;
|
||||
|
||||
/**
|
||||
* FSM状态
|
||||
*/
|
||||
public class FSM2024StateMessage extends MyAbstractMessageHandler {
|
||||
|
||||
@Override
|
||||
public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException {
|
||||
Fsm2024.FSMStateMsg fsmState = Fsm2024.FSMStateMsg.parser().parseFrom(raw.originalData.toByteArray(), raw.getOffsetValue(), raw.getPackageLengthValue() - raw.getOffsetValue());
|
||||
AdasChannel.calculateTimeConsumingOnDispatchRaw("FSM状态", raw.receiveTime);
|
||||
AutopilotAbilityManager.getInstance().setFSM2024State(fsmState);
|
||||
long nowTime = 0;
|
||||
if (CupidLogUtils.isEnableLog())
|
||||
nowTime = SystemClock.elapsedRealtime();
|
||||
if (adasListener != null) {
|
||||
adasListener.onFSM2024State(raw.getHeader(), fsmState);
|
||||
}
|
||||
AdasChannel.calculateTimeConsumingBusiness("FSM状态", nowTime);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -32,6 +32,7 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
private IMsg statusQueryRespMessage;//状态查询应答
|
||||
private IMsg systemStatusMessage;//定频SSM
|
||||
private IMsg faultManagementMessage;//FM状态
|
||||
private IMsg fSM2024StateMessage;//FSM状态
|
||||
private IMsg recordDataConfigRespMessage;//数据采集配置应答
|
||||
private IMsg planningDecisionStateMessage;//planning决策状态
|
||||
private IMsg obuWarningDataMessage;//工控机透传OBU V2I数据
|
||||
@@ -176,6 +177,12 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
faultManagementMessage = new FaultManagementMessage();
|
||||
}
|
||||
return faultManagementMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_FSM2024_STATE.typeCode) {
|
||||
//FSM状态
|
||||
if (fSM2024StateMessage == null) {
|
||||
fSM2024StateMessage = new FSM2024StateMessage();
|
||||
}
|
||||
return fSM2024StateMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_RECORD_DATA_CONFIG_RESP.typeCode) {
|
||||
//数据采集配置应答
|
||||
if (recordDataConfigRespMessage == null) {
|
||||
|
||||
@@ -61,6 +61,11 @@ public class ReportMessage extends MyAbstractMessageHandler {
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.EMAP.ENTRY_AUTOPILOT_FOR_CHASSIS_FAULT);//控制判断底盘异常,需要重启车辆
|
||||
//不知道确切的失败原因,需要联系控制进一步排查
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.EMAP.ENTRY_AUTOPILOT_FOR_UNKNOWN);//不知道确切的失败原因,需要联系控制进一步排查
|
||||
|
||||
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.ESYS.ROUTING_RESPONSE_FAIL);//算路异常,拒绝自动驾驶
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.ESYS.TRAJECTORY_AGENT_NOT_READY);//轨迹下载客户端未就绪拒绝轨迹下载请求
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.EFSM.ENTRY_AUTOPILOT);//FSM因为某些原因未进自驾
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,6 +10,11 @@ enum class Level(val zIndex: Int) {
|
||||
*/
|
||||
MAP_MARKER(100),
|
||||
|
||||
/**
|
||||
* 全局轨迹线
|
||||
*/
|
||||
TRAJECTORY_LINE(25000),
|
||||
|
||||
/**
|
||||
* 车道中心线
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user