Merge branch 'dev/dev_eagle_architecture_upgrade' into dev/dev_eagle_wuhan_sikua_obu

# Conflicts:
#	core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt
This commit is contained in:
董宏宇
2021-10-09 14:26:38 +08:00
34 changed files with 423 additions and 91 deletions

View File

@@ -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<String, Object> params = ParamsBuilder.of(false)
.append("sn", MoGoAiCloudClientConfig.getInstance().getSn())
.build();
CheckApiServiceFactory.getDataApiService(context).loadMonitorDetail(params)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new SubscribeImpl<CheckResultData>(RequestOptions.create(mContext)) {
.subscribe(new SubscribeImpl<CheckResultData>(RequestOptions.create(context)) {
@Override
public void onSuccess(CheckResultData o) {
super.onSuccess(o);

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="@color/check_info_position_line_color" />
</shape>
</item>
<item
android:left="@dimen/dp_3"
android:right="0px"
android:top="@dimen/dp_3"
android:bottom="@dimen/dp_1">
<shape>
<solid android:color="@color/check_info_title_back" />
</shape>
</item>
</layer-list>

View File

@@ -8,7 +8,8 @@
<item
android:left="@dimen/dp_3"
android:right="@dimen/dp_3"
android:top="@dimen/dp_3"><!--设置只有顶部和左右边有边框-->
android:top="@dimen/dp_3"
android:bottom="@dimen/dp_1">
<shape>
<solid android:color="@color/check_info_title_back" />
</shape>

View File

@@ -7,5 +7,5 @@
android:bottom="2px"
android:left="2px"
android:right="2px"
android:top="2px" />
android:top="0px" />
</shape>

View File

@@ -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">
<TextView
android:id="@+id/title_one"
android:layout_width="0px"
android:layout_height="match_parent"
android:background="@drawable/check_item_left_shape"
android:gravity="center"
android:text="模块名称"
android:textSize="@dimen/dp_38"
@@ -23,6 +23,7 @@
android:id="@+id/title_two"
android:layout_width="0px"
android:layout_height="match_parent"
android:background="@drawable/check_item_left_shape"
android:gravity="center"
android:text="运行状态"
android:textSize="@dimen/dp_38"
@@ -36,19 +37,21 @@
android:id="@+id/title_thr"
android:layout_width="0px"
android:layout_height="match_parent"
android:background="@drawable/check_item_left_shape"
android:gravity="center"
android:text="模块名称"
android:textSize="@dimen/dp_38"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintRight_toLeftOf="@+id/title_for"
app:layout_constraintLeft_toRightOf="@+id/title_two"
app:layout_constraintRight_toLeftOf="@+id/title_for"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/title_for"
android:layout_width="0px"
android:layout_height="match_parent"
android:background="@drawable/check_item_right_shape"
android:gravity="center"
android:text="运行状态"
android:textSize="@dimen/dp_38"

View File

@@ -6,6 +6,6 @@
@android:drawable/progress_indeterminate_horizontal
</item>
<item name="android:progressDrawable">@drawable/check_progress</item>
<item name="android:listDivider">@drawable/check_title_item_shape</item>
<item name="android:listDivider">@drawable/check_item_left_shape</item>
</style>
</resources>

View File

@@ -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 {
/**
* 设置视图状态监听showdismiss
* @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)
}
}

View File

@@ -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

View File

@@ -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(),
// 设置视图状态监听showdismiss
var statusListenerMap: ArrayList< WarningStatusListener> = ArrayList(),
var statusListenerMapIMoGo: ArrayList< IMoGoWarningStatusListener> = ArrayList(),
// Callbacks
var callbacks: OnFloatCallbacks? = null,

View File

@@ -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?, WaringPresenter?>
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<MoGoWarningContract.View?, WaringPresenter?>
alertContent: String?,
ttsContent: String?,
tag: String?,
listener: WarningStatusListener?
listenerIMoGo: IMoGoWarningStatusListener?
) {
activity?.let {
@@ -80,8 +120,8 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
.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(

View File

@@ -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?
)
/**

View File

@@ -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)
}
}

View File

@@ -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?) {

View File

@@ -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" />
<com.mogo.eagle.core.function.hmi.ui.widget.TrafficLightView
android:id="@+id/viewTrafficLightVr"

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/dp_600"
android:layout_height="@dimen/dp_600"
android:background="#FFFFFF">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/tvTitleObu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="OBU状态"
android:textColor="#000"
android:textSize="@dimen/dp_30"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvObuInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="@+id/tvTitleObu"
app:layout_constraintStart_toStartOf="@+id/tvTitleObu"
app:layout_constraintTop_toBottomOf="@+id/tvTitleObu" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -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)
}

View File

@@ -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)

View File

@@ -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

View File

@@ -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();
}
}

View File

@@ -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"
}

View File

@@ -21,7 +21,7 @@ interface IMoGoWaringProvider : IMoGoFunctionProvider {
alertContent: String?,
ttsContent: String?,
tag: String?,
listener: WarningStatusListener?
listenerIMoGo: IMoGoWarningStatusListener?
)
/**

View File

@@ -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() {}
}

View File

@@ -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 {
}

View File

@@ -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 {
}

View File

@@ -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)
}

View File

@@ -14,8 +14,11 @@ object CallerHmiListenerManager : CallerBase() {
private val TAG = "CallerHmiListenerManager"
private val checkAutoPilotBtnListeners: HashMap<String, IMoGoCheckAutoPilotBtnListener> =
HashMap()
// 存储最后一次回调的数据,当有新当位置注册了监听将此数据回调过去,防止有些模块注册顺序问题导致无法获取最新状态
private var mIsChecked: Boolean = false
// 存储所有注册了监听的对象invokeXXXX进行遍历回调将信息同步
private val mAutoPilotBtnListeners: HashMap<String, IMoGoCheckAutoPilotBtnListener> = 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)
}
}

View File

@@ -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)
}
/**

View File

@@ -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<String, IMoGoObuStatusListener> = 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)
}
}
}

View File

@@ -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版本进行升级

View File

@@ -140,8 +140,10 @@ public class DispatchAutoPilotManager implements IMogoOnMessageListener<Dispatch
RemoteControlAutoPilotParameters currentAutopilot = new RemoteControlAutoPilotParameters();
currentAutopilot.isSpeakVoice = false;
List<RemoteControlAutoPilotParameters.AutoPilotLonLat> 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());

View File

@@ -79,16 +79,26 @@ public class RouteOverlayDrawer {
public IMogoPolyline draw(MogoLocation carLocal, List<MogoLatLng> 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);

View File

@@ -75,7 +75,7 @@
app:layout_constraintLeft_toLeftOf="parent" />
<View
android:layout_width="1px"
android:layout_width="2px"
android:layout_height="@dimen/module_services_dispatch_cars_dialog_line_margin_bottom"
android:layout_marginStart="@dimen/module_services_dispatch_cars_dialog_btn_width"
android:background="@color/module_services_dispatch_cars_line"

View File

@@ -33,7 +33,7 @@
<dimen name="module_services_dispatch_cars_dialog_loc_size">54px</dimen>
<dimen name="module_services_dispatch_cars_dialog_loc_margin_top">251px</dimen>
<dimen name="module_services_dispatch_cars_dialog_line_margin_bottom">152px</dimen>
<dimen name="module_services_dispatch_cars_dialog_btn_width">474.5px</dimen>
<dimen name="module_services_dispatch_cars_dialog_btn_width">474px</dimen>
<dimen name="module_services_dispatch_cars_dialog_timer_margin">20px</dimen>
<dimen name="module_services_dispatch_cars_dialog_timer_size">46px</dimen>
<dimen name="module_services_dispatch_cars_dialog_timer_txt_size">24px</dimen>

View File

@@ -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<AdvanceWarningBean> {
}
// 显示弹框,语音提示
CallerHmiManager.showWarningV2X(appId, content, tts,
"$appId", object : WarningStatusListener {
"$appId", object : IMoGoWarningStatusListener {
override fun onShow() {}
override fun onDismiss() {
}