add devatools

This commit is contained in:
zhongchao
2021-12-22 19:21:53 +08:00
parent 311e5e0af1
commit a6cd4afc6e
14 changed files with 116 additions and 54 deletions

View File

@@ -18,11 +18,14 @@ import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.data.obu.ObuStatusInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.map.CallerHDMapManager
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
@@ -50,11 +53,11 @@ import kotlinx.android.synthetic.main.view_debug_setting.view.*
* 展示 本机、网络、工控机、OBU等状态信息支持设置IP等参数进行调试
*/
class DebugSettingView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoObuStatusListener,
IMoGoAutopilotStatusListener, IMoGoAutopilotCarStateListener, IMoGoMapLocationListener {
IMoGoAutopilotStatusListener, IMoGoAutopilotCarStateListener, IMoGoMapLocationListener {
private val TAG = "DebugSettingView"
@@ -133,7 +136,7 @@ class DebugSettingView @JvmOverloads constructor(
tvObuInfo.text = CallerObuListenerManager.getObuStatusInfoJsonString()
tvAutopilotInfo.text =
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfoJsonString()
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfoJsonString()
// 初始化App 配置信息
val appConfigInfo = AppConfigInfo()
@@ -151,7 +154,7 @@ class DebugSettingView @JvmOverloads constructor(
// 初始化OBU IP信息
val ipAddress =
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, "192.168.1.199")
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, "192.168.1.199")
etObuIP.setText(ipAddress)
etObuIP.text?.let { etObuIP.setSelection(it.length) }
@@ -191,18 +194,18 @@ class DebugSettingView @JvmOverloads constructor(
// 初始化 GSP数据源 数据
rgGpsProvider.check(
when (FunctionBuildConfig.gpsProvider) {
0 -> {
R.id.rbGpsProviderAndroid
}
1 -> {
R.id.rbGpsProviderRTK
}
2 -> {
R.id.rbGpsProviderOBU
}
else -> R.id.rbGpsProviderAndroid
when (FunctionBuildConfig.gpsProvider) {
0 -> {
R.id.rbGpsProviderAndroid
}
1 -> {
R.id.rbGpsProviderRTK
}
2 -> {
R.id.rbGpsProviderOBU
}
else -> R.id.rbGpsProviderAndroid
}
)
rgGpsProvider.setOnCheckedChangeListener { group, checkedId ->
when (checkedId) {
@@ -220,14 +223,14 @@ class DebugSettingView @JvmOverloads constructor(
// 初始化 感知数据是否绘制 选择情况
rgIsDrawIdentifyData.check(
when (FunctionBuildConfig.isDrawIdentifyData) {
true -> {
R.id.rbDraw
}
false -> {
R.id.rbDoNotDraw
}
when (FunctionBuildConfig.isDrawIdentifyData) {
true -> {
R.id.rbDraw
}
false -> {
R.id.rbDoNotDraw
}
}
)
rgIsDrawIdentifyData.setOnCheckedChangeListener { group, checkedId ->
when (checkedId) {
@@ -303,6 +306,21 @@ class DebugSettingView @JvmOverloads constructor(
CallerSmpManager.showPanel()
}
}
tbLogCatch.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
CallerDevaToolsManager.startCatchLog()
} else {
CallerDevaToolsManager.stopCatchLog()
}
}
CallerDevaToolsListenerManager.registerDevaToolsLogCatchListener(TAG,
object : IMoGoDevaToolsListener {
override fun onLogCatchClose() {
super.onLogCatchClose()
tbLogCatch.isChecked = false
}
})
}
/**

View File

@@ -242,6 +242,16 @@
android:textOn="打开「ADAS」Log"
android:textSize="@dimen/dp_34" />
<ToggleButton
android:id="@+id/tbLogCatch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:gravity="center"
android:textOff="开始抓取全量日志"
android:textOn="停止抓取全量日志"
android:textSize="@dimen/dp_34" />
</com.google.android.flexbox.FlexboxLayout>
</LinearLayout>
<!--地图呈现数据源控制-->