2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -16,7 +16,7 @@
|
||||
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml" value="0.33" />
|
||||
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_autopilot_status.xml" value="0.25833333333333336" />
|
||||
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_check_status.xml" value="1.0" />
|
||||
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml" value="0.8466666666666667" />
|
||||
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml" value="0.5" />
|
||||
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_traffic_light_vr.xml" value="1.0" />
|
||||
<entry key="modules/mogo-module-adas/src/main/res/drawable/module_adas_left_corner_bg.xml" value="0.22125" />
|
||||
<entry key="modules/mogo-module-adas/src/main/res/layout/dialog_adas_dispatch_remind.xml" value="0.22658490296325878" />
|
||||
|
||||
@@ -44,7 +44,7 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
.setTag("DebugSettingView")
|
||||
.setLayout(debugSettingView)
|
||||
.setSidePattern(SidePattern.RIGHT)
|
||||
.setGravity(Gravity.RIGHT, offsetY = 80)
|
||||
.setGravity(Gravity.RIGHT, offsetY = 70)
|
||||
.setImmersionStatusBar(true)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
|
||||
@@ -4,14 +4,19 @@ import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.constants.MoGoOBUConfig
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig
|
||||
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.CallerOBUManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.map.MogoMap
|
||||
import com.mogo.utils.network.utils.GsonUtil
|
||||
import com.mogo.utils.storage.SharedPrefsMgr
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
||||
|
||||
@@ -47,6 +52,26 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
private fun initView() {
|
||||
tvObuInfo.text = CallerObuListenerManager.getObuStatusInfo()
|
||||
|
||||
// 初始化App 配置信息
|
||||
val appConfigInfo = AppConfigInfo()
|
||||
appConfigInfo.appName = AppUtils.getAppName()
|
||||
appConfigInfo.appVersionCode = AppUtils.getAppVersionCode()
|
||||
appConfigInfo.appVersionName = AppUtils.getAppVersionName()
|
||||
appConfigInfo.appPackageName = AppUtils.getAppPackageName()
|
||||
appConfigInfo.devicesSN = MoGoAiCloudClient.getInstance().aiCloudClientConfig.sn
|
||||
appConfigInfo.mapVersion = MogoMap.getInstance().mogoMap.mapVersion
|
||||
|
||||
// 将数据绘制
|
||||
tvAppInfo.text = GsonUtil.jsonFromObject(appConfigInfo)
|
||||
|
||||
// 初始化OBU IP信息
|
||||
val ipAddress =
|
||||
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, "192.168.1.199")
|
||||
|
||||
etObuIP.setText(ipAddress)
|
||||
etObuIP.text?.let { etObuIP.setSelection(it.length) }
|
||||
|
||||
btnSetObuIP.setOnClickListener {
|
||||
val obuIP = etObuIP.text.toString()
|
||||
if (obuIP.isNotEmpty()) {
|
||||
@@ -57,10 +82,11 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* OBU状态回调
|
||||
*/
|
||||
override fun onObuStatusResponse(obuStatusInfo: ObuStatusInfo) {
|
||||
tvObuInfo.text = GsonUtils.toJson(obuStatusInfo)
|
||||
etObuIP.setText(obuStatusInfo.connectIP)
|
||||
etObuIP.text?.let { etObuIP.setSelection(it.length) }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
<?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:layout_width="@dimen/dp_1000"
|
||||
android:layout_height="@dimen/dp_700"
|
||||
android:background="#FFFFFF">
|
||||
|
||||
<ScrollView
|
||||
@@ -13,46 +12,79 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitleObu"
|
||||
<!--鹰眼应用配置信息-->
|
||||
<LinearLayout
|
||||
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" />
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/etObuIP"
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="鹰眼应用配置信息"
|
||||
android:textColor="#000"
|
||||
android:textSize="@dimen/dp_34"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAppInfo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#000"
|
||||
android:textSize="@dimen/dp_34" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!--OBU 配置信息-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#32009688"
|
||||
android:gravity="center"
|
||||
android:inputType="number"
|
||||
android:padding="@dimen/dp_5"
|
||||
android:text="192.168.1.199"
|
||||
android:textSize="@dimen/dp_34" />
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSetObuIP"
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="OBU 配置信息"
|
||||
android:textColor="#000"
|
||||
android:textSize="@dimen/dp_34"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/etObuIP"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#32009688"
|
||||
android:gravity="center"
|
||||
android:inputType="number"
|
||||
android:padding="@dimen/dp_5"
|
||||
android:text="192.168.1.199"
|
||||
android:textSize="@dimen/dp_34" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSetObuIP"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:padding="@dimen/dp_5"
|
||||
android:text="设置IP"
|
||||
android:textSize="@dimen/dp_34" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvObuInfo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#000"
|
||||
android:textSize="@dimen/dp_34" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!--域控制器(工控机)配置信息-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:padding="@dimen/dp_5"
|
||||
android:text="设置IP"
|
||||
android:textSize="@dimen/dp_34" />
|
||||
|
||||
<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" />
|
||||
android:orientation="vertical">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ 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.data.constants.MoGoOBUConfig
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuProvider
|
||||
import com.mogo.eagle.core.utilcode.util.LogUtils
|
||||
import com.mogo.service.MogoServicePaths
|
||||
@@ -22,14 +22,14 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
LogUtils.dTag(TAG, "初始化蘑菇自研OBU……")
|
||||
mContext = context
|
||||
val ipAddress =
|
||||
SharedPrefsMgr.getInstance(context).getString(MoGoOBUConfig.OBU_IP, "192.168.1.199")
|
||||
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, "192.168.1.199")
|
||||
MogoPrivateObuManager.INSTANCE.init(context, ipAddress)
|
||||
}
|
||||
|
||||
override fun connect(ipAddress: String) {
|
||||
mContext?.let {
|
||||
// 保存本地OBU IP地址
|
||||
SharedPrefsMgr.getInstance(it).putString(MoGoOBUConfig.OBU_IP, ipAddress)
|
||||
SharedPrefsMgr.getInstance(it).putString(MoGoConfig.OBU_IP, ipAddress)
|
||||
MogoPrivateObuManager.INSTANCE.connectObu(it, ipAddress)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.mogo.eagle.core.data.app
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/10/12 2:46 下午
|
||||
* 当前应用的配置信息
|
||||
*/
|
||||
class AppConfigInfo {
|
||||
|
||||
/*应用基本信息*/
|
||||
var appName: String? = null
|
||||
var appVersionCode = 0
|
||||
var appVersionName: String? = null
|
||||
var appPackageName: String? = null
|
||||
var devicesSN: String? = null
|
||||
|
||||
/*依赖的SDK版本信息*/
|
||||
var mapVersion: String? = null
|
||||
|
||||
/*应用配置信息,这里的配置将影响功能,用来替换productFlavors配置的那种编译渠道*/
|
||||
// GPS数据提供源: 0-Android系统,1-工控机,2-OBU
|
||||
var GPS_PROVIDER = 1
|
||||
|
||||
// 是否在地图上绘制感知元素
|
||||
// 网络下发 false--不绘制,true--绘制
|
||||
var TRAFFIC_PROVIDER_NET_STATUS = false
|
||||
|
||||
// 域控制器 false--不绘制,true--绘制
|
||||
var TRAFFIC_PROVIDER_AUTOPILOT_STATUS = true
|
||||
|
||||
// OBU false--不绘制,true--绘制
|
||||
var TRAFFIC_PROVIDER_OBU_STATUS = false
|
||||
|
||||
// 进入应用的地图模式。0-2D模式,1-VR模式
|
||||
var MAP_STYLE_MODE = 1
|
||||
|
||||
}
|
||||
@@ -5,6 +5,11 @@ package com.mogo.eagle.core.data.constants
|
||||
* @date 2021/10/11 8:24 下午
|
||||
* OBU 配置常量
|
||||
*/
|
||||
object MoGoOBUConfig {
|
||||
object MoGoConfig {
|
||||
// 自研OBU IP地址
|
||||
const val OBU_IP = "OBU_IP"
|
||||
|
||||
// 域控制器 IP地址
|
||||
const val AUTOPILOT_IP = "AUTOPILOT_IP"
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user