[3.4.0-map-sdk] merge

This commit is contained in:
zhongchao
2023-09-21 19:35:23 +08:00
7 changed files with 53 additions and 91 deletions

View File

@@ -117,18 +117,14 @@ class TaxiCurrentTaskFragment : BaseFragment(),
TAG,
"hasCurrentTask = $hasCurrentTask"
)
try {
if (hasCurrentTask) {
noTaskData.visibility = View.GONE
mCurrentTaskLayout.visibility = View.VISIBLE
} else {
noTaskData.visibility = View.VISIBLE
noOrderDataTv.text = "暂无进行中订单"
mCurrentTaskLayout.visibility = View.GONE
taskOtherInfo.text = "距离 -- 公里, 用时 -- 分钟"
}
} catch (e: NullPointerException) { //可能会出现订单信息已经轮询回来,但进行中页面控件还未初始化完成的情况
TaxiTaskModel.clearCurrentOCHOrder()
if (hasCurrentTask) {
noTaskData.visibility = View.GONE
mCurrentTaskLayout.visibility = View.VISIBLE
} else {
noTaskData.visibility = View.VISIBLE
noOrderDataTv.text = "暂无进行中订单"
mCurrentTaskLayout.visibility = View.GONE
taskOtherInfo.text = "距离 -- 公里, 用时 -- 分钟"
}
}

View File

@@ -68,6 +68,7 @@ import mogo.telematics.pad.MessagePad.GlobalPathResp
import mogo_msg.MogoReportMsg.MogoReportMessage
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.TimeUnit
import kotlin.math.ceil
/**
* @author: wangmingjun
@@ -255,6 +256,7 @@ object TaxiTaskModel {
}
override fun onAutopilotStatusResponse(state: Int) {
i(TAG, "onAutopilotStatusResponse autopilotsState= $state")
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
DebugView.printInfoMsg("[自驾状态变化] afterValue=STATUS_AUTOPILOT_RUNNINGmeaning=自动驾驶中")
mADASStatusCallback?.onAutopilotRunning()
@@ -705,6 +707,7 @@ object TaxiTaskModel {
listener.onTaskWithOrderDataChanged(null)
}
}
clearCurrentOCHOrder()
return
}
@@ -837,7 +840,7 @@ object TaxiTaskModel {
val listener = it.value
listener.onOrderTripInfoChanged(
data.data.mileage,
data.data.duration.toInt()
ceil(data.data.duration.toDouble()).toInt() //向上取整
)
}
}
@@ -1044,6 +1047,10 @@ object TaxiTaskModel {
currentStatus < TaskStatusEnum.CompleteTask.code -> return
}
}
if (currentStatus == TaskStatusEnum.None.code && order != null){
//订单送驾到站, 但是还没点服务完成的情况, 此时endSite == null currentStatus == 0
return
}
}
mDriveToNearestStationTask = data.data
mTaxiCarServiceCallback?.onCarStartServiceSuccess(
@@ -1312,18 +1319,14 @@ object TaxiTaskModel {
* 清除任务订单信息
*/
fun clearCurrentOCHOrder() {
mCurrentTaskWithOrder = null
mDriveToNearestStationTask = null
clearAutopilotControlParameters()
TaxiTrajectoryManager.getInstance().syncTrajectoryInfo()
SharedPrefsMgr.getInstance(mContext).remove(TaxiUnmannedConst.SP_KEY_OCH_TAXI_ORDER)
isRestartAutopilot = false
if (FunctionBuildConfig.isDemoMode) {
// 当美化模式(演示模式)开启时: 取消或订单已完成时置false
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false
CallerAutoPilotControlManager.setIgnoreConditionDraw(false)
CallerAutoPilotControlManager.setIPCDemoMode(false)
d(TAG, "美化模式-ignore置为false已完成or清除当前订单")
d(TAG, "美化模式-ignore置为false已完成or清除当前任务")
}
}

View File

@@ -89,7 +89,7 @@ ext {
// obu sdk
obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3",
mogoobu : 'com.mogo.support.obu:mogo-obu:1.1.1',
mogoobu : 'com.mogo.support.obu:mogo-obu:1.1.2',
// google
googlezxing : "com.google.zxing:core:3.3.3",

View File

@@ -382,7 +382,12 @@ internal class SOPSettingView @JvmOverloads constructor(
}
//自车光圈
scCarAperture.isChecked = FunctionBuildConfig.isDisplayAnimEnable
if(FunctionBuildConfig.isDrawPointCloudData){
//如果点云效果是打开的,则自车光圈也跟随打开
scCarAperture.isChecked = true
}else{
scCarAperture.isChecked = FunctionBuildConfig.isDisplayAnimEnable
}
scCarAperture.setOnCheckedChangeListener { compoundButton, isChecked ->
CallerMapUIServiceManager.getMapUIController()?.setDisplayAnimEnable(isChecked)
hmiAction("SOP 是否展示自车光圈,",isChecked)

View File

@@ -30,14 +30,10 @@ import system_master.SystemStatusInfo;
public class MogoRouteOverlayManager implements
IMoGoPlanningTrajectoryListener,
IMoGoAutopilotStatusListener,
IMoGoChassisLocationGCJ02Listener {
private static volatile MogoRouteOverlayManager sInstance;
private static final String TAG = "Route";
private final AtomicBoolean isArriveAtStation = new AtomicBoolean(false);
private final AtomicInteger autopilotMode = new AtomicInteger(0);
private final LinkedList<List<MessagePad.TrajectoryPoint>> queue = new LinkedList<>();
private MogoRouteOverlayManager() {
@@ -46,7 +42,6 @@ public class MogoRouteOverlayManager implements
public void init() {
CallerPlanningTrajectoryListenerManager.INSTANCE.addListener(TAG, this);
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, 20,this);
}
@@ -75,14 +70,16 @@ public class MogoRouteOverlayManager implements
if (gnssInfo == null) {
return;
}
// Log.d(TAG, "-- onChassisLocationGCJ02 -- 1 ---" + ":auto-mode:" + autopilotMode.get() + ", isArriveAtStation: " + isArriveAtStation.get());
if (isArriveAtStation.get() && autopilotMode.get() != 2) {
int autoPilotState = CallerAutoPilotStatusListenerManager.INSTANCE.getState();
boolean isArriveAtStation = CallerAutoPilotStatusListenerManager.INSTANCE.isArriveAtStation();
// Log.d(TAG, "-- onChassisLocationGCJ02 -- 1 ---" + ":auto-mode:" + autoPilotState + ", isArriveAtStation: " + isArriveAtStation);
if (isArriveAtStation && autoPilotState != 2) {
RouteOverlayDrawer.getInstance().clearMogoRouteOverlay();
return;
}
// Log.d(TAG, "-- onChassisLocationGCJ02 -- 2 ---" + "auto-mode:" + autopilotMode.get() + ", isDemoMode:" + FunctionBuildConfig.isDemoMode + ", force:" + FunctionBuildConfig.isForceDrawAutopilotTrajectoryByDebugSettingView);
// Log.d(TAG, "-- onChassisLocationGCJ02 -- 2 ---" + "auto-mode:" + autoPilotState + ", isDemoMode:" + FunctionBuildConfig.isDemoMode + ", force:" + FunctionBuildConfig.isForceDrawAutopilotTrajectoryByDebugSettingView);
boolean force = FunctionBuildConfig.isForceDrawAutopilotTrajectoryByDebugSettingView || FunctionBuildConfig.isDemoMode && FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData;
if (!force && autopilotMode.get() != 2) {
if (!force && autoPilotState != 2) {
RouteOverlayDrawer.getInstance().clearMogoRouteOverlay();
return;
}
@@ -96,66 +93,4 @@ public class MogoRouteOverlayManager implements
}
}
}
@Override
public void onAutopilotStatusResponse(int state) {
if (state == 2) {
isArriveAtStation.set(false);
}
Log.d(TAG, "-- onAutopilotStatusResponse ---: state:" + state);
this.autopilotMode.set(state);
}
@Override
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autoPilotStatusInfo) {
}
@Override
public void onAutopilotArriveAtStation(MessagePad.ArrivalNotification arrivalNotification) {
Log.d(TAG, "-- onAutopilotArriveAtStation --- 1 ---");
if (arrivalNotification == null) {
return;
}
Log.d(TAG, "-- onAutopilotArriveAtStation --- 2 ---");
if(!HdMapBuildConfig.isMapLoaded){
return;
}
Log.d(TAG, "-- onAutopilotArriveAtStation --- 3 ---");
if (!isArriveAtStation.get()) {
isArriveAtStation.set(true);
}
}
@Override
public void onAutopilotSNRequest() {
}
@Override
public void onAutopilotGuardian(MogoReportMsg.MogoReportMessage guardianInfo) {
}
@Override
public void onAutopilotIpcConnectStatusChanged(int status, @androidx.annotation.Nullable String reason) {
}
@Override
public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) {
}
@Override
public void onSystemStatus(@NonNull SsmInfo.SsmStatusInf statusInf) {
}
@Override
public void onAutopilotRouteLineId(long lineId) {
}
@Override
public void onAutopilotDockerInfo(@NonNull String dockerVersion) {
}
}

View File

@@ -70,6 +70,12 @@ open class AutopilotStatusInfo : Serializable, Cloneable {
@Volatile
var autopilotControlParameters: AutopilotControlParameters? = null
/**
* 是否到站
*/
@Volatile
var isArriveAtStation: Boolean = false
override fun toString(): String {
return "connectIP=$connectIP, connectPort=$connectPort, " +
"connectStatus=$connectStatus, connectDescribe=$connectStatusDescribe, version=$version, dockVersion=$dockVersion," +

View File

@@ -34,6 +34,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
private var autopilotState: Int by Delegates.observable(0) { _, oldValue, newValue ->
if (oldValue != newValue) {
fixAtStationState(newValue)
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotStatusResponse(newValue)
@@ -41,6 +42,19 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
}
}
private fun fixAtStationState(autoPilotMode: Int) {
if (autoPilotMode == 2) {
//自驾状态下将到站状态置为false
mAutopilotStatusInfo.isArriveAtStation = false
} else {
//其它状态下, 将到站状态置为false
val arriveAtStation = mAutopilotStatusInfo.isArriveAtStation
if (arriveAtStation) {
mAutopilotStatusInfo.isArriveAtStation = false
}
}
}
private var dockerV: String by Delegates.observable("") { _, oldValue, newValue ->
if (!oldValue.contentEquals(newValue)) {
M_LISTENERS.forEach {
@@ -105,6 +119,8 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
fun getAutoPilotReportMessageContent(): String = autoPilotMessageContent
fun isArriveAtStation(): Boolean = mAutopilotStatusInfo.isArriveAtStation
/**
* 通过Gnss定位更新来同步更新自动驾驶状态
*/
@@ -156,6 +172,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
*/
@Synchronized
fun invokeArriveAtStation(arrivalNotification: MessagePad.ArrivalNotification?) {
mAutopilotStatusInfo.isArriveAtStation = true
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotArriveAtStation(arrivalNotification)