diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckActivity.java b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckActivity.java index 3d4ce0dfc6..213fad60c0 100644 --- a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckActivity.java +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckActivity.java @@ -53,7 +53,6 @@ public class CheckActivity extends AppCompatActivity { private static final String TAG = "CheckActivity"; private static RecyclerView mRecyclerView; private static CheckResultData sCheckResultData; - private static Context mContext; private static NetworkStatusUtil.NetWorkStatus sNetWorkStatus; private ImageView mImageView; //车模 @@ -85,7 +84,7 @@ public class CheckActivity extends AppCompatActivity { protected void onStart() { super.onStart(); animation(); - loadDetail(mContext, null); + loadDetail(this.getApplicationContext(), null); } /** * 列表View初始化 @@ -99,7 +98,6 @@ public class CheckActivity extends AppCompatActivity { scanTopImageView = findViewById(R.id.scan_car_top_image); tipsImageView = findViewById(R.id.scan_car_tips); mProgressBar = findViewById(R.id.check_progress); - mContext = mImageView.getContext(); mImageView.setOnClickListener(v -> { finish(); }); @@ -109,7 +107,7 @@ public class CheckActivity extends AppCompatActivity { new CheckLinearLayout(this, CheckLinearLayout.VERTICAL, false); mRecyclerView.addItemDecoration(new SpacesItemDecoration((int) getResources().getDimension(R.dimen.check_item_space_vr))); mRecyclerView.setLayoutManager(linearLayoutManager); - mCheckAdapter = new CheckAdapter(mContext, sCheckResultData); + mCheckAdapter = new CheckAdapter(this, sCheckResultData); mRecyclerView.setAdapter(mCheckAdapter); } @@ -118,20 +116,18 @@ public class CheckActivity extends AppCompatActivity { */ public static void checkMonitor(Context context, ICheckResultCallBack checkResultCallBack) { Log.d(TAG, "checkMonitor"); - mContext = context; - loadDetail(mContext, checkResultCallBack); + loadDetail(context.getApplicationContext(), checkResultCallBack); } //网络请求,获取自车检测结果(工控机上报云端) public static void loadDetail(Context context, ICheckResultCallBack checkResultCallBack) { - mContext = context; final Map params = ParamsBuilder.of(false) .append("sn", MoGoAiCloudClientConfig.getInstance().getSn()) .build(); CheckApiServiceFactory.getDataApiService(context).loadMonitorDetail(params) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) - .subscribe(new SubscribeImpl(RequestOptions.create(mContext)) { + .subscribe(new SubscribeImpl(RequestOptions.create(context)) { @Override public void onSuccess(CheckResultData o) { super.onSuccess(o); diff --git a/core/function-impl/mogo-core-function-check/src/main/res/drawable/check_item_left_shape.xml b/core/function-impl/mogo-core-function-check/src/main/res/drawable/check_item_left_shape.xml new file mode 100644 index 0000000000..6f9ebf6133 --- /dev/null +++ b/core/function-impl/mogo-core-function-check/src/main/res/drawable/check_item_left_shape.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-check/src/main/res/drawable/check_title_item_shape.xml b/core/function-impl/mogo-core-function-check/src/main/res/drawable/check_item_right_shape.xml similarity index 84% rename from core/function-impl/mogo-core-function-check/src/main/res/drawable/check_title_item_shape.xml rename to core/function-impl/mogo-core-function-check/src/main/res/drawable/check_item_right_shape.xml index 51beff11e5..0fb8e28c84 100644 --- a/core/function-impl/mogo-core-function-check/src/main/res/drawable/check_title_item_shape.xml +++ b/core/function-impl/mogo-core-function-check/src/main/res/drawable/check_item_right_shape.xml @@ -8,7 +8,8 @@ + android:top="@dimen/dp_3" + android:bottom="@dimen/dp_1"> diff --git a/core/function-impl/mogo-core-function-check/src/main/res/drawable/check_recycler_shape.xml b/core/function-impl/mogo-core-function-check/src/main/res/drawable/check_recycler_shape.xml index b46d99a0b8..5cc105603d 100644 --- a/core/function-impl/mogo-core-function-check/src/main/res/drawable/check_recycler_shape.xml +++ b/core/function-impl/mogo-core-function-check/src/main/res/drawable/check_recycler_shape.xml @@ -7,5 +7,5 @@ android:bottom="2px" android:left="2px" android:right="2px" - android:top="2px" /> + android:top="0px" /> \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-check/src/main/res/layout/check_info_title_item.xml b/core/function-impl/mogo-core-function-check/src/main/res/layout/check_info_title_item.xml index c987013736..eb90a08022 100644 --- a/core/function-impl/mogo-core-function-check/src/main/res/layout/check_info_title_item.xml +++ b/core/function-impl/mogo-core-function-check/src/main/res/layout/check_info_title_item.xml @@ -3,13 +3,13 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="@dimen/check_width" android:layout_height="@dimen/dp_127" - android:background="@drawable/check_title_item_shape" android:orientation="horizontal"> @drawable/check_progress - @drawable/check_title_item_shape + @drawable/check_item_left_shape \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/notification/WarningFloat.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/notification/WarningFloat.kt index 300711eb21..18a97b553a 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/notification/WarningFloat.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/notification/WarningFloat.kt @@ -4,7 +4,7 @@ import android.content.Context import android.view.View import com.mogo.eagle.core.function.hmi.notification.enums.SidePattern import com.mogo.eagle.core.function.hmi.notification.interfaces.OnFloatAnimator -import com.mogo.eagle.core.function.api.hmi.warning.WarningStatusListener +import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener import com.mogo.utils.WindowUtils import com.mogo.utils.logger.Logger @@ -138,12 +138,12 @@ class WarningFloat { /** * 设置视图状态监听;show,dismiss - * @param listener 设置视图状态监听 + * @param listenerIMoGo 设置视图状态监听 */ - fun addWarningStatusListener(listener: WarningStatusListener?) = + fun addWarningStatusListener(listenerIMoGo: IMoGoWarningStatusListener?) = apply { - if (listener != null) { - config.statusListenerMap.add(listener) + if (listenerIMoGo != null) { + config.statusListenerMapIMoGo.add(listenerIMoGo) } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/notification/WarningFloatWindowHelper.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/notification/WarningFloatWindowHelper.kt index cfb3bf6490..2054bfb153 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/notification/WarningFloatWindowHelper.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/notification/WarningFloatWindowHelper.kt @@ -134,7 +134,7 @@ internal class WarningFloatWindowHelper( * 入场动画 */ private fun enterAnim(floatingView: View) { - config.statusListenerMap.forEach { listener -> + config.statusListenerMapIMoGo.forEach { listener -> listener.onShow() } if (frameLayout == null || config.isAnim) return @@ -175,7 +175,7 @@ internal class WarningFloatWindowHelper( * 退出动画 */ fun exitAnim() { - config.statusListenerMap.forEach { listener -> + config.statusListenerMapIMoGo.forEach { listener -> listener.onDismiss() } if (frameLayout == null || (config.isAnim && enterAnimator == null)) return diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/notification/WarningNotificationConfig.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/notification/WarningNotificationConfig.kt index 392ca4f37a..edb0f3e1d1 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/notification/WarningNotificationConfig.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/notification/WarningNotificationConfig.kt @@ -6,7 +6,7 @@ import com.mogo.eagle.core.function.hmi.notification.enums.ShowPattern import com.mogo.eagle.core.function.hmi.notification.enums.SidePattern import com.mogo.eagle.core.function.hmi.notification.interfaces.OnFloatAnimator import com.mogo.eagle.core.function.hmi.notification.interfaces.OnFloatCallbacks -import com.mogo.eagle.core.function.api.hmi.warning.WarningStatusListener +import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener /** * @author xiaoyuzhou @@ -54,7 +54,7 @@ data class WarningNotificationConfig( var floatAnimator: OnFloatAnimator? = DefaultAnimator(), // 设置视图状态监听;show,dismiss - var statusListenerMap: ArrayList< WarningStatusListener> = ArrayList(), + var statusListenerMapIMoGo: ArrayList< IMoGoWarningStatusListener> = ArrayList(), // Callbacks var callbacks: OnFloatCallbacks? = null, diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt index a142edc84e..8282a2b0be 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt @@ -8,14 +8,15 @@ import android.view.WindowManager import android.view.animation.OvershootInterpolator import com.mogo.commons.mvp.MvpFragment import com.mogo.commons.voice.AIAssist -import com.mogo.module.common.enums.EventTypeEnum import com.mogo.eagle.core.data.enums.WarningDirectionEnum +import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener +import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.hmi.notification.WarningFloat import com.mogo.eagle.core.function.hmi.notification.anim.DefaultAnimator import com.mogo.eagle.core.function.hmi.notification.enums.SidePattern +import com.mogo.eagle.core.function.hmi.ui.setting.DebugSettingView import com.mogo.eagle.core.function.hmi.ui.widget.V2XNotificationView -import com.mogo.eagle.core.function.api.hmi.warning.WarningStatusListener -import com.mogo.eagle.core.function.hmi.R +import com.mogo.module.common.enums.EventTypeEnum import com.mogo.utils.logger.Logger import kotlinx.android.synthetic.main.fragment_hmi.* @@ -28,9 +29,48 @@ class MoGoHmiFragment : MvpFragment MoGoWarningContract.View { var mWarningFloat: WarningFloat.Builder? = null + var mDebugSettingViewFloat: WarningFloat.Builder? = null override fun initViews() { - autopilotStatus.visibility = View.VISIBLE + autopilotStatus.setOnLongClickListener { + activity?.let { + val debugSettingView = DebugSettingView(it) + + if (mDebugSettingViewFloat != null) { + WarningFloat.dismiss(mDebugSettingViewFloat!!.config.floatTag, false) + mDebugSettingViewFloat = null + } else { + mDebugSettingViewFloat = WarningFloat.with(it) + .setTag("DebugSettingView") + .setLayout(debugSettingView) + .setSidePattern(SidePattern.RIGHT) + .setGravity(Gravity.RIGHT, offsetY = 80) + .setImmersionStatusBar(true) + .setAnimator(object : DefaultAnimator() { + override fun enterAnim( + view: View, + params: WindowManager.LayoutParams, + windowManager: WindowManager, + sidePattern: SidePattern + ): Animator? = + super.enterAnim(view, params, windowManager, sidePattern)?.apply { + interpolator = OvershootInterpolator() + } + + override fun exitAnim( + view: View, + params: WindowManager.LayoutParams, + windowManager: WindowManager, + sidePattern: SidePattern + ): Animator? = + super.exitAnim(view, params, windowManager, sidePattern) + ?.setDuration(200) + }) + .show() + } + } + false + } } override fun getLayoutId(): Int { @@ -55,7 +95,7 @@ class MoGoHmiFragment : MvpFragment alertContent: String?, ttsContent: String?, tag: String?, - listener: WarningStatusListener? + listenerIMoGo: IMoGoWarningStatusListener? ) { activity?.let { @@ -80,8 +120,8 @@ class MoGoHmiFragment : MvpFragment .setCountDownTime(10000) .setGravity(Gravity.CENTER_HORIZONTAL, offsetY = 110) .setImmersionStatusBar(true) - .addWarningStatusListener(listener) - .addWarningStatusListener(object : WarningStatusListener { + .addWarningStatusListener(listenerIMoGo) + .addWarningStatusListener(object : IMoGoWarningStatusListener { override fun onShow() { // 创建弹窗成功才进行TTS播报 Logger.d( diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoWarningContract.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoWarningContract.kt index e3c853697d..509b63bfa2 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoWarningContract.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoWarningContract.kt @@ -2,7 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui import com.mogo.commons.mvp.IView import com.mogo.eagle.core.data.enums.WarningDirectionEnum -import com.mogo.eagle.core.function.api.hmi.warning.WarningStatusListener +import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener /** @@ -26,7 +26,7 @@ interface MoGoWarningContract { alertContent: String?, ttsContent: String?, tag: String?, - listener: WarningStatusListener? + listenerIMoGo: IMoGoWarningStatusListener? ) /** diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt new file mode 100644 index 0000000000..21458fc6fc --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -0,0 +1,52 @@ +package com.mogo.eagle.core.function.hmi.ui.setting + +import android.content.Context +import android.util.AttributeSet +import android.view.LayoutInflater +import androidx.constraintlayout.widget.ConstraintLayout +import com.mogo.eagle.core.data.obu.ObuStatusInfo +import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener +import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager +import com.mogo.eagle.core.function.hmi.R +import com.mogo.eagle.core.utilcode.util.GsonUtils +import kotlinx.android.synthetic.main.view_debug_setting.view.* + +/** + * @author xiaoyuzhou + * @date 2021/9/30 8:46 下午 + * 调试使用的设置页面,这里制作为调试使用 + * 展示 本机、网络、工控机、OBU等状态信息,支持设置IP,等参数进行调试 + */ +class DebugSettingView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0 +) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoObuStatusListener { + + private val TAG = "DebugSettingView" + + init { + LayoutInflater.from(context).inflate(R.layout.view_debug_setting, this, true) + initView() + } + + override fun onAttachedToWindow() { + super.onAttachedToWindow() + CallerObuListenerManager.addListener(TAG, this) + } + + override fun onDetachedFromWindow() { + super.onDetachedFromWindow() + CallerObuListenerManager.removeListener(TAG) + + } + + private fun initView() { + tvObuInfo.text = CallerObuListenerManager.getObuStatusInfo() + } + + override fun onObuStatusResponse(obuStatusInfo: ObuStatusInfo) { + tvObuInfo.text = GsonUtils.toJson(obuStatusInfo) + } + +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/warning/MoGoWarningProvider.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/warning/MoGoWarningProvider.kt index 02b48d0420..7ddbd06b90 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/warning/MoGoWarningProvider.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/warning/MoGoWarningProvider.kt @@ -8,7 +8,7 @@ import android.util.Log import androidx.fragment.app.Fragment import com.alibaba.android.arouter.facade.annotation.Route import com.mogo.eagle.core.function.hmi.WaringConst -import com.mogo.eagle.core.function.api.hmi.warning.WarningStatusListener +import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener import com.mogo.eagle.core.data.enums.WarningDirectionEnum import com.mogo.service.MogoServicePaths import com.mogo.utils.logger.Logger @@ -72,9 +72,9 @@ class MoGoWarningProvider : IMoGoWaringProvider { override fun showWarningV2X( v2xType: Int, alertContent: String?, ttsContent: String?, tag: String?, - listener: WarningStatusListener? + listenerIMoGo: IMoGoWarningStatusListener? ) { - mMoGoHmiFragment?.showWarningV2X(v2xType, alertContent, ttsContent, tag, listener) + mMoGoHmiFragment?.showWarningV2X(v2xType, alertContent, ttsContent, tag, listenerIMoGo) } override fun disableWarningV2X(tag: String?) { diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml index 555f7c0390..3aac290c0c 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml @@ -30,10 +30,8 @@ android:layout_height="@dimen/module_mogo_autopilot_status_bg_height" android:layout_marginTop="@dimen/module_mogo_autopilot_status_margin_top" android:elevation="@dimen/dp_10" - android:visibility="gone" app:layout_constraintLeft_toLeftOf="@+id/flSpeedChartView" - app:layout_constraintTop_toBottomOf="@+id/flSpeedChartView" - tools:visibility="visible" /> + app:layout_constraintTop_toBottomOf="@+id/flSpeedChartView" /> + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MoGoObuProvider.kt b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MoGoObuProvider.kt index 9bf6bf3bea..15f204cf51 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MoGoObuProvider.kt +++ b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MoGoObuProvider.kt @@ -2,9 +2,9 @@ package com.mogo.eagle.core.function.obu.mogo import android.content.Context import com.alibaba.android.arouter.facade.annotation.Route +import com.mogo.eagle.core.function.api.obu.IMoGoObuProvider import com.mogo.eagle.core.utilcode.util.LogUtils import com.mogo.service.MogoServicePaths -import com.mogo.eagle.core.function.api.obu.IMoGoObuProvider /** * @author xiaoyuzhou @@ -13,8 +13,9 @@ import com.mogo.eagle.core.function.api.obu.IMoGoObuProvider @Route(path = MogoServicePaths.PATH_V2X_OBU_MOGO) class MoGoObuProvider : IMoGoObuProvider { private val TAG = "MoGoObuProvider" + override fun init(context: Context) { - LogUtils.dTag(MogoObuConst.TAG_MOGO_OBU, "初始化蘑菇自研OBU……") + LogUtils.dTag(TAG, "初始化蘑菇自研OBU……") MogoPrivateObuManager.INSTANCE.init(context) } diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt index 7049052bf8..438087d866 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt +++ b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt @@ -3,8 +3,10 @@ package com.mogo.eagle.core.function.obu.mogo import android.content.Context import com.alibaba.android.arouter.launcher.ARouter import com.mogo.eagle.core.data.enums.WarningDirectionEnum -import com.mogo.eagle.core.function.api.hmi.warning.WarningStatusListener +import com.mogo.eagle.core.data.obu.ObuStatusInfo +import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener import com.mogo.eagle.core.function.call.hmi.CallerHmiManager +import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager import com.mogo.eagle.core.function.obu.mogo.utils.TrafficDataConvertUtils import com.mogo.eagle.core.utilcode.mogo.logger.Logger import com.mogo.module.common.datacenter.SnapshotLocationDataCenter @@ -22,10 +24,10 @@ import com.zhidao.support.obu.model.advance.Light import org.json.JSONObject /** - * @description * * @author lixiaopeng * @since 2021/8/8 + * @description OBU 管理 */ class MogoPrivateObuManager private constructor() { companion object { @@ -37,6 +39,7 @@ class MogoPrivateObuManager private constructor() { private var mMogoServiceApis: IMogoServiceApis? = null private var mIMogoMapService: IMogoMapService? = null private var mContext: Context? = null + private var mObuStatusInfo = ObuStatusInfo() fun init(context: Context?) { Logger.d(MogoObuConst.TAG_MOGO_OBU, "obuManager初始化--") @@ -46,7 +49,7 @@ class MogoPrivateObuManager private constructor() { mIMogoMapService = mMogoServiceApis!!.mapServiceApi //自研obu - MogoObuManager.getInstance().connect(context, "192.168.20.199") + MogoObuManager.getInstance().connect(context, mObuStatusInfo.connectIP) MogoObuManager.getInstance().registerListener(mogoObuListener) } @@ -54,12 +57,18 @@ class MogoPrivateObuManager private constructor() { // OBU连接成功 override fun onConnected() { Logger.d(MogoObuConst.TAG_MOGO_OBU, "onConnected ------> ") + mObuStatusInfo.obuStatus = true + CallerObuListenerManager.invokeListener(mObuStatusInfo) mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", true) } } // OBU连接失败 override fun onConnectFail(isNeedReconnect: Boolean) { Logger.d(MogoObuConst.TAG_MOGO_OBU, "onConnectFail ------> ") + mObuStatusInfo.obuStatus = false + mObuStatusInfo.obuHvStatus = false + mObuStatusInfo.obuRvStatus = false + CallerObuListenerManager.invokeListener(mObuStatusInfo) mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", false) } mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_HV", false) } mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_RV", false) } @@ -68,6 +77,10 @@ class MogoPrivateObuManager private constructor() { // OBU断开连接 override fun onDisconnect() { Logger.d(MogoObuConst.TAG_MOGO_OBU, "onDisconnect ------> ") + mObuStatusInfo.obuStatus = false + mObuStatusInfo.obuHvStatus = false + mObuStatusInfo.obuRvStatus = false + CallerObuListenerManager.invokeListener(mObuStatusInfo) mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", false) } mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_HV", false) } mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_RV", false) } @@ -90,11 +103,18 @@ class MogoPrivateObuManager private constructor() { override fun onCvxAppInitIndInfo(info: CvxAppInitIndInfo) { super.onCvxAppInitIndInfo(info) Logger.d(MogoObuConst.TAG_MOGO_OBU, "onCvxAppInitIndInfo ------> $info") + mObuStatusInfo.stackInfo = info.stack_info + mObuStatusInfo.appInfo = info.app_info + mObuStatusInfo.hliInfo = info.hli_info + mObuStatusInfo.otherInfo = info.other_info + CallerObuListenerManager.invokeListener(mObuStatusInfo) } // (2) 车辆信息:CVX_HV_INFO_IND override fun onCvxHvInfoIndInfo(info: CvxHvInfoIndInfo?) { mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_HV", true) } + mObuStatusInfo.obuHvStatus = true + CallerObuListenerManager.invokeListener(mObuStatusInfo) Logger.d(MogoObuConst.TAG_MOGO_OBU, "onCvxHvInfoIndInfo ------> $info") if (info != null && info.basic_info != null && info.basic_info.position != null) { val movingObjectInfo = info.basic_info @@ -143,6 +163,8 @@ class MogoPrivateObuManager private constructor() { // (3) 远车信息:CVX_RV_INFO_IND override fun onCvxRvInfoIndInfo(info: CvxRvInfoIndInfo) { Logger.d(MogoObuConst.TAG_MOGO_OBU, "onCvxRvInfoIndInfo ------> $info") + mObuStatusInfo.obuRvStatus = true + CallerObuListenerManager.invokeListener(mObuStatusInfo) mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_RV", true) } // 更新数据 TrafficDataConvertUtils.cvxRvInfoIndInfo2TrafficData(info)?.let { @@ -264,8 +286,8 @@ class MogoPrivateObuManager private constructor() { if (info.threat_info != null) { if (info.threat_info.distance.toInt() != 0) { ttsContent = String.format( - EventTypeEnum.getWarningTts(appId), - info.threat_info.distance.toInt() + EventTypeEnum.getWarningTts(appId), + info.threat_info.distance.toInt() ) } else { ttsContent = "前方道路拥堵,请减速慢行" @@ -287,7 +309,7 @@ class MogoPrivateObuManager private constructor() { alertContent, ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 (appId + direction.direction).toString(),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的 - object : WarningStatusListener { + object : IMoGoWarningStatusListener { override fun onDismiss() { // 关闭警告红边 CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) @@ -368,7 +390,7 @@ class MogoPrivateObuManager private constructor() { alertContent, ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 (v2xType + direction.direction).toString(),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的 - object : WarningStatusListener { + object : IMoGoWarningStatusListener { override fun onDismiss() { // 关闭警告红边 CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) @@ -755,7 +777,7 @@ class MogoPrivateObuManager private constructor() { alertContent, ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 (appId + direction.direction).toString(),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的 - object : WarningStatusListener { + object : IMoGoWarningStatusListener { override fun onDismiss() { // 关闭警告红边 CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) diff --git a/core/function-impl/mogo-core-function-smp/src/main/java/com/mogo/eagle/core/function/smp/SmallMapDirectionView.java b/core/function-impl/mogo-core-function-smp/src/main/java/com/mogo/eagle/core/function/smp/SmallMapDirectionView.java index cb8cdb1c3b..0148140f80 100644 --- a/core/function-impl/mogo-core-function-smp/src/main/java/com/mogo/eagle/core/function/smp/SmallMapDirectionView.java +++ b/core/function-impl/mogo-core-function-smp/src/main/java/com/mogo/eagle/core/function/smp/SmallMapDirectionView.java @@ -19,6 +19,7 @@ import com.amap.api.maps.CameraUpdateFactory; import com.amap.api.maps.TextureMapView; import com.amap.api.maps.UiSettings; import com.amap.api.maps.model.BitmapDescriptorFactory; +import com.amap.api.maps.model.CameraPosition; import com.amap.api.maps.model.CustomMapStyleOptions; import com.amap.api.maps.model.LatLng; import com.amap.api.maps.model.LatLngBounds; @@ -130,7 +131,6 @@ public class SmallMapDirectionView mAMap.setMapType(AMap.MAP_TYPE_NIGHT); // 关闭显示实时路况图层,aMap是地图控制器对象。 mAMap.setTrafficEnabled(false); - // 设置 锚点 图标 mCarMarker = mAMap.addMarker(new MarkerOptions() .icon(BitmapDescriptorFactory.fromResource(R.drawable.module_small_map_view_my_location_logo)) @@ -183,7 +183,7 @@ public class SmallMapDirectionView LatLng currentLatLng = new LatLng(latLng.getLatitude(), latLng.getLongitude()); if (mCarMarker != null) { - mCarMarker.setRotateAngle(360 - latLng.getBearing()); +// mCarMarker.setRotateAngle(360 - latLng.getBearing()); mCarMarker.setPosition(currentLatLng); mCarMarker.setToTop(); } @@ -219,6 +219,8 @@ public class SmallMapDirectionView //设置希望展示的地图缩放级别 mAMap.moveCamera(CameraUpdateFactory.newLatLngZoom(currentLatLng, zoomLevel)); } + CameraPosition cameraPosition = new CameraPosition.Builder().target(mCarMarker.getPosition()).bearing(latLng.getBearing()).tilt(0).zoom(zoomLevel).build(); + mAMap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)); } @Override diff --git a/core/function-impl/mogo-core-function-smp/src/main/java/com/mogo/eagle/core/function/smp/SmallMapProvider.java b/core/function-impl/mogo-core-function-smp/src/main/java/com/mogo/eagle/core/function/smp/SmallMapProvider.java index cc32402ad7..92e582064d 100644 --- a/core/function-impl/mogo-core-function-smp/src/main/java/com/mogo/eagle/core/function/smp/SmallMapProvider.java +++ b/core/function-impl/mogo-core-function-smp/src/main/java/com/mogo/eagle/core/function/smp/SmallMapProvider.java @@ -63,6 +63,7 @@ public class SmallMapProvider implements IMogoSmallMapProvider, IMogoStatusChang MogoServicePaths.PATH_SMALL_MAP, StatusDescriptor.MAIN_PAGE_RESUME, this); + MogoApisHandler.getInstance().getApis().getAdasControllerApi().addAdasAutopilotRouteCallBack(this); if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) { showPanel(); @@ -84,6 +85,7 @@ public class SmallMapProvider implements IMogoSmallMapProvider, IMogoStatusChang Log.d(TAG, "准备show fragment"); mActivity.getSupportFragmentManager().beginTransaction().show(mSmallMapFragment).commitAllowingStateLoss(); } catch (Exception e) { + Log.d(TAG, "add fragment 失败 ======"+e.getMessage()); e.printStackTrace(); } } diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/obu/ObuStatusInfo.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/obu/ObuStatusInfo.kt new file mode 100644 index 0000000000..e943763779 --- /dev/null +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/obu/ObuStatusInfo.kt @@ -0,0 +1,47 @@ +package com.mogo.eagle.core.data.obu + +/** + * @author xiaoyuzhou + * @date 2021/9/30 5:38 下午 + * OBU 相关的状态信息数据 + */ +class ObuStatusInfo { + // 当前链接的IP地址, 默认地址 192.168.1.199 + var connectIP: String = "192.168.1.199" + + /** + * false--没有链接,true--链接成功 + */ + var obuStatus = false + + /** + * false--没有链接,true--链接成功 + */ + var obuHvStatus = false + + /** + * false--没有链接,true--链接成功 + */ + var obuRvStatus = false + + /** + * Stack information + */ + var stackInfo: String = "v0.0" + + /** + * Usecase APP information + */ + var appInfo: String = "v0.0" + + /** + * HLI information + */ + var hliInfo: String = "v0.0" + + /** + * Other information + */ + var otherInfo: String = "v0.0" + +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWaringProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWaringProvider.kt index 166ad6435c..cb6578f0a5 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWaringProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWaringProvider.kt @@ -21,7 +21,7 @@ interface IMoGoWaringProvider : IMoGoFunctionProvider { alertContent: String?, ttsContent: String?, tag: String?, - listener: WarningStatusListener? + listenerIMoGo: IMoGoWarningStatusListener? ) /** diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/WarningStatusListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWarningStatusListener.kt similarity index 80% rename from core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/WarningStatusListener.kt rename to core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWarningStatusListener.kt index 970bc3d650..c53c3fb2c0 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/WarningStatusListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWarningStatusListener.kt @@ -4,7 +4,7 @@ package com.mogo.eagle.core.function.api.hmi.warning * @author xiaoyuzhou * @date 2021/9/13 4:41 下午 */ -interface WarningStatusListener { +interface IMoGoWarningStatusListener { fun onShow() {} fun onDismiss() {} } \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuProvider.java b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuProvider.java deleted file mode 100644 index 50628c05e5..0000000000 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuProvider.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.mogo.eagle.core.function.api.obu; - -import com.alibaba.android.arouter.facade.template.IProvider; - -/** - * @author xiaoyuzhou - * @date 2021/8/2 5:53 下午 - * 蘑菇OBU 功能提接口 - */ -public interface IMoGoObuProvider extends IProvider { - - - -} diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuProvider.kt new file mode 100644 index 0000000000..3d29270b93 --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuProvider.kt @@ -0,0 +1,13 @@ +package com.mogo.eagle.core.function.api.obu + +import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider + +/** + * @author xiaoyuzhou + * @date 2021/8/2 5:53 下午 + * 蘑菇OBU 功能提接口 + */ +interface IMoGoObuProvider : IMoGoFunctionServerProvider { + + +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuStatusListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuStatusListener.kt new file mode 100644 index 0000000000..042bf872e9 --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuStatusListener.kt @@ -0,0 +1,16 @@ +package com.mogo.eagle.core.function.api.obu + +import com.mogo.eagle.core.data.obu.ObuStatusInfo + +/** + * @author xiaoyuzhou + * @date 2021/9/30 5:53 下午 + * OBU 状态监听回调 + */ +interface IMoGoObuStatusListener { + /** + * 检查OBU连链接信息 + * @param obuStatusInfo OBU 状态信息 + */ + fun onObuStatusResponse(obuStatusInfo: ObuStatusInfo) +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiListenerManager.kt index 6ee5aebb34..80471e413a 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiListenerManager.kt @@ -14,8 +14,11 @@ object CallerHmiListenerManager : CallerBase() { private val TAG = "CallerHmiListenerManager" - private val checkAutoPilotBtnListeners: HashMap = - HashMap() + // 存储最后一次回调的数据,当有新当位置注册了监听将此数据回调过去,防止有些模块注册顺序问题导致无法获取最新状态 + private var mIsChecked: Boolean = false + + // 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步 + private val mAutoPilotBtnListeners: HashMap = HashMap() /** @@ -27,7 +30,8 @@ object CallerHmiListenerManager : CallerBase() { @Nullable tag: String, @Nullable listener: IMoGoCheckAutoPilotBtnListener ) { - checkAutoPilotBtnListeners[tag] = listener + mAutoPilotBtnListeners[tag] = listener + listener.onCheck(mIsChecked) } /** @@ -35,7 +39,7 @@ object CallerHmiListenerManager : CallerBase() { * @param tag 标记,用来注销监听使用 */ fun removeCheckAutoPilotBtnListener(@Nullable tag: String) { - checkAutoPilotBtnListeners.remove(tag) + mAutoPilotBtnListeners.remove(tag) } /** @@ -44,11 +48,12 @@ object CallerHmiListenerManager : CallerBase() { */ fun invokeCheckAutoPilotBtnListener(isChecked: Boolean) { LogUtils.dTag(TAG, "isChecked:$isChecked") - checkAutoPilotBtnListeners.forEach { + mIsChecked = isChecked + mAutoPilotBtnListeners.forEach { val tag = it.key val listener = it.value LogUtils.dTag(TAG, "tag:$tag listener:$listener") - listener.onCheck(isChecked) + listener.onCheck(mIsChecked) } } diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt index cd618ab7fa..d2124e78b4 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt @@ -2,9 +2,8 @@ package com.mogo.eagle.core.function.call.hmi import com.mogo.eagle.core.data.constants.MogoServicePaths import com.mogo.eagle.core.data.enums.WarningDirectionEnum -import com.mogo.eagle.core.function.api.hmi.autopilot.IMoGoCheckAutoPilotBtnListener import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWaringProvider -import com.mogo.eagle.core.function.api.hmi.warning.WarningStatusListener +import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener import com.mogo.eagle.core.function.call.base.CallerBase /** @@ -31,9 +30,9 @@ object CallerHmiManager : CallerBase() { alertContent: String?, ttsContent: String?, tag: String?, - listener: WarningStatusListener? + listenerIMoGo: IMoGoWarningStatusListener? ) { - waringProviderApi.showWarningV2X(v2xType, alertContent, ttsContent, tag, listener) + waringProviderApi.showWarningV2X(v2xType, alertContent, ttsContent, tag, listenerIMoGo) } /** diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuListenerManager.kt new file mode 100644 index 0000000000..a62f84a7d2 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuListenerManager.kt @@ -0,0 +1,79 @@ +package com.mogo.eagle.core.function.call.obu + +import androidx.annotation.Nullable +import com.mogo.eagle.core.data.obu.ObuStatusInfo +import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener +import com.mogo.eagle.core.function.call.base.CallerBase +import com.mogo.eagle.core.utilcode.util.GsonUtils +import com.mogo.eagle.core.utilcode.util.LogUtils + +/** + * @author xiaoyuzhou + * @date 2021/9/30 5:48 下午 + * OBU 监听管理 + */ +object CallerObuListenerManager : CallerBase() { + private val TAG = "CallerObuListenerManager" + + // 存储最后一次回调的数据,当有新当位置注册了监听将此数据回调过去,防止有些模块注册顺序问题导致无法获取最新状态 + private var mObuStatusInfo: ObuStatusInfo = ObuStatusInfo() + + // 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步 + private val mObuStatusListeners: HashMap = HashMap() + + /** + * 查询OBU状态 + */ + fun getObuStatusInfo(): String { + return GsonUtils.toJson(mObuStatusInfo) + } + + /** + * 添加自动驾驶按钮选中监听 + * @param tag 标记,用来注销监听使用 + * @param listener 监听回调 + */ + fun addListener( + @Nullable tag: String, + @Nullable listener: IMoGoObuStatusListener + ) { + mObuStatusListeners[tag] = listener + listener.onObuStatusResponse(mObuStatusInfo) + } + + /** + * 删除 监听 + * @param tag 标记,用来注销监听使用 + */ + fun removeListener(@Nullable tag: String) { + mObuStatusListeners.remove(tag) + } + + /** + * 删除自动驾驶按钮选中监听 + * @param listener 要删除的监听对象 + */ + fun removeListener(@Nullable listener: IMoGoObuStatusListener) { + mObuStatusListeners.forEach { + if (it.value == listener) { + mObuStatusListeners.remove(it.key) + } + } + } + + /** + * 触发自动驾驶按钮选中监听 + * @param obuStatusInfo 选中状态 + */ + fun invokeListener(obuStatusInfo: ObuStatusInfo) { + LogUtils.dTag(TAG, "isChecked:$obuStatusInfo") + mObuStatusInfo = obuStatusInfo + mObuStatusListeners.forEach { + val tag = it.key + val listener = it.value + LogUtils.dTag(TAG, "tag:$tag listener:$listener") + listener.onObuStatusResponse(mObuStatusInfo) + } + } + +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 0511e7b9b1..3c055bd598 100644 --- a/gradle.properties +++ b/gradle.properties @@ -141,9 +141,9 @@ MOGO_OCH_TAXI_VERSION=2.0.58 MOGO_AICLOUD_SERVICES_SDK_VERSION=2.0.58 ######## 外部依赖引用 # 车聊聊 -CARCHATTING_VERSION=2.2.337 +CARCHATTING_VERSION=2.3.5 # 车聊聊接口 -CARCHATTINGPROVIDER_VERSION=1.1.16 +CARCHATTINGPROVIDER_VERSION=1.1.20 # websocket WEBSOCKET_VERSION=1.1.7 # loglib @@ -166,7 +166,7 @@ MOGO_TRAFFICLIVE_VERSION=1.1.46 # 定位服务 MOGO_LOCATION_VERSION=1.1.46 # 自研地图 -MAP_SDK_VERSION=1.0.1-vr-1.0.9 +MAP_SDK_VERSION=1.0.1-vr-1.1.2 #################架构升级新的版本号 MOGO_CORE_FUNCTION_HMI_VERSION=1.0.0 ## 产品库必备配置,产品库自动对versionCode和versionName版本进行升级 diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/dispatch/DispatchAutoPilotManager.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/dispatch/DispatchAutoPilotManager.java index 09f4e7182a..f161bfe54a 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/dispatch/DispatchAutoPilotManager.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/dispatch/DispatchAutoPilotManager.java @@ -140,8 +140,10 @@ public class DispatchAutoPilotManager implements IMogoOnMessageListener wayLatLon = new ArrayList<>(); - for (MogoLatLng mogoLatLng : receiverBean.getStopsList()) { - wayLatLon.add(new RemoteControlAutoPilotParameters.AutoPilotLonLat(mogoLatLng.lat, mogoLatLng.lon)); + if (receiverBean!=null && receiverBean.getStopsList()!= null){ + for (MogoLatLng mogoLatLng : receiverBean.getStopsList()) { + wayLatLon.add(new RemoteControlAutoPilotParameters.AutoPilotLonLat(mogoLatLng.lat, mogoLatLng.lon)); + } } currentAutopilot.wayLatLons = wayLatLon; currentAutopilot.startLatLon = new RemoteControlAutoPilotParameters.AutoPilotLonLat(receiverBean.getStartLat(), receiverBean.getStartLon()); diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/routeoverlay/RouteOverlayDrawer.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/routeoverlay/RouteOverlayDrawer.java index a04e023e0f..c2664860ef 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/routeoverlay/RouteOverlayDrawer.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/routeoverlay/RouteOverlayDrawer.java @@ -79,16 +79,26 @@ public class RouteOverlayDrawer { public IMogoPolyline draw(MogoLocation carLocal, List routelist) { clearMogoRouteOverlay(); if (routelist != null) { - - // 将当前车辆位置放进去 - mPolylinePointList.add(new MogoLatLng(carLocal.getLatitude(), carLocal.getLongitude())); - // 过滤后台推送的推荐路线集合 - for (MogoLatLng polyline : routelist) { - //需要剔除已经行驶过的经纬度,这里需要比对推荐路线集合中的点是否在当前车辆行驶方向前面如果不在则抛弃 - if (LocationUtils.isPointOnCarFront(carLocal, polyline)) { + if (carLocal == null){ + for (MogoLatLng polyline : routelist) { +// Log.e("IMogoPolyline",polyline.getLat()+":"+polyline.lon); + //需要剔除已经行驶过的经纬度,这里需要比对推荐路线集合中的点是否在当前车辆行驶方向前面如果不在则抛弃 mPolylinePointList.add(polyline); } + }else { + // 将当前车辆位置放进去 + mPolylinePointList.add(new MogoLatLng(carLocal.getLatitude(), carLocal.getLongitude())); + for (MogoLatLng polyline : routelist) { +// Log.e("IMogoPolyline",polyline.getLat()+":"+polyline.lon); + //需要剔除已经行驶过的经纬度,这里需要比对推荐路线集合中的点是否在当前车辆行驶方向前面如果不在则抛弃 + if (LocationUtils.isPointOnCarFront(carLocal, polyline)) { + mPolylinePointList.add(polyline); + } + } } + + // 过滤后台推送的推荐路线集合 + mPolylineColors.addAll(ColorUtils.getGradientAlpha("#002965ED", "#FF2965ED", "#002965ED", mPolylinePointList.size())); // 替换路径集合 mPolylineOptions.points(mPolylinePointList); diff --git a/modules/mogo-module-service/src/main/res/layout/module_dialog_adas_dispatch_cars.xml b/modules/mogo-module-service/src/main/res/layout/module_dialog_adas_dispatch_cars.xml index 150d8f08f4..d2ae296977 100644 --- a/modules/mogo-module-service/src/main/res/layout/module_dialog_adas_dispatch_cars.xml +++ b/modules/mogo-module-service/src/main/res/layout/module_dialog_adas_dispatch_cars.xml @@ -75,7 +75,7 @@ app:layout_constraintLeft_toLeftOf="parent" /> 54px 251px 152px - 474.5px + 474px 20px 46px 24px diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_404000.kt b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_404000.kt index 40f54df0bb..29f371e622 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_404000.kt +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_404000.kt @@ -6,7 +6,7 @@ import com.mogo.service.cloud.socket.IMogoOnMessageListener import com.mogo.eagle.core.data.v2x.AdvanceWarningBean import com.mogo.module.v2x.V2XConst import com.mogo.eagle.core.function.call.hmi.CallerHmiManager -import com.mogo.eagle.core.function.api.hmi.warning.WarningStatusListener +import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener import com.mogo.module.common.drawer.TrafficMarkerDrawer import com.mogo.module.common.enums.EventTypeEnum import com.mogo.module.v2x.utils.V2XUtils @@ -74,7 +74,7 @@ class V2XMessageListener_404000 : IMogoOnMessageListener { } // 显示弹框,语音提示 CallerHmiManager.showWarningV2X(appId, content, tts, - "$appId", object : WarningStatusListener { + "$appId", object : IMoGoWarningStatusListener { override fun onShow() {} override fun onDismiss() { }