[fea]
[Vlm 接入]
This commit is contained in:
yangyakun
2025-06-20 11:24:27 +08:00
parent 05582f4415
commit 981d2e7f24
29 changed files with 514 additions and 179 deletions

View File

@@ -10,10 +10,14 @@ import com.mogo.eagle.core.utilcode.util.CoordinateUtils
import com.mogo.och.bridge.autopilot.location.OchLocationManager
import com.mogo.och.bridge.distance.TrajectoryAndDistanceManager
import com.mogo.och.bridge.bridge.OchBridgeManager
import com.mogo.och.bridge.bridge.OchVlmManager
import com.mogo.och.bridge.trajectory.TrajectoryManager
import com.mogo.och.common.module.biz.birdge.BridgeService
import com.mogo.och.common.module.biz.birdge.BridgeListener
import com.mogo.och.common.module.biz.birdge.data.RoadMsg
import com.mogo.och.common.module.biz.birdge.data.VlmData
import com.mogo.och.common.module.constant.OchCommonConst
import com.mogo.och.common.module.manager.EnvManager
/**
@@ -29,7 +33,16 @@ class BridgeProvider : BridgeService, CallerBase<BridgeListener>() {
override fun init(context: Context?) {
this.context = context
OchBridgeManager.load()
// 车前引导线+预测数据
if(EnvManager.isB2Passenger()||EnvManager.isT1T2Passenger()){
OchBridgeManager.load()
}
// if(EnvManager.isT1T2Passenger()){
OchVlmManager.load()
// }
TrajectoryManager.load()
}
@@ -92,5 +105,17 @@ class BridgeProvider : BridgeService, CallerBase<BridgeListener>() {
}
}
fun invokeVlmDataDispatch(vlmData:VlmData){
M_LISTENERS.forEach {
it.value.onVlmDataListener(vlmData)
}
}
fun inVokeNdeData(title: String, desc: String, sortedList: List<RoadMsg>) {
M_LISTENERS.forEach {
it.value.onNdeDataListener(title,desc,sortedList)
}
}
}

View File

@@ -3,13 +3,10 @@ package com.mogo.och.bridge
import android.annotation.SuppressLint
import com.alibaba.android.arouter.launcher.ARouter
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OCHCOMMON
import com.mogo.och.common.module.biz.birdge.data.RoadMsg
import com.mogo.och.common.module.biz.birdge.data.VlmData
import com.mogo.och.common.module.constant.OchCommonConst
import com.mogo.och.common.module.manager.loop.BizLoopManager
import com.mogo.och.common.module.manager.loop.LoopInfo
import io.reactivex.schedulers.Schedulers
import kotlin.properties.Delegates
object BridgeServiceManager {
@@ -19,52 +16,12 @@ object BridgeServiceManager {
private var bridgeService: BridgeProvider? =
ARouter.getInstance().build(OchCommonConst.BIZ_Bridge).navigation() as BridgeProvider
private var trajectoryTime = 0L
private var predictionTime = 0L
init {
BizLoopManager.setLoopFunction(TAG,
LoopInfo(2, ::checkTimeout, immediately = false, scheduler = Schedulers.io())
)
}
// 是否有车前引导线
private var haveTrajectoryInfo: Boolean by Delegates.observable(false) { _, oldValue, newValue ->
if (oldValue != newValue) {
bridgeService?.invokeTrajectoryHaveDataListener(newValue)
CallerLogger.d(TAG,"haveTrajectoryInfo 发生变化:${newValue}")
}
trajectoryTime = System.currentTimeMillis()
}
// 是否有预测数据
private var havePredictionInfo: Boolean by Delegates.observable(false) { _, oldValue, newValue ->
if (oldValue != newValue) {
bridgeService?.invokePredictionHavaData(newValue)
CallerLogger.d(TAG,"havePredictionInfo 发生变化:${newValue}")
}
predictionTime = System.currentTimeMillis()
}
fun checkTimeout(){
if(System.currentTimeMillis() - trajectoryTime>2_000){
haveTrajectoryInfo = false
CallerLogger.d(TAG,"超时设置为falsehaveTrajectoryInfo ${haveTrajectoryInfo}")
}
if(System.currentTimeMillis() - predictionTime>2_000){
havePredictionInfo = false
CallerLogger.d(TAG,"超时设置为falsehavePredictionInfo ${havePredictionInfo}")
}
}
fun invokePlanningListener(haveTrajectoryInfos:Boolean){
this.haveTrajectoryInfo = haveTrajectoryInfos
bridgeService?.invokeTrajectoryHaveDataListener(haveTrajectoryInfos)
}
fun invokePredictionHaveData(havePredictionInfos:Boolean){
this.havePredictionInfo = havePredictionInfos
bridgeService?.invokePredictionHavaData(havePredictionInfos)
}
fun invokeTrajectoryPoints(trajectoryList: MutableList<MogoLocation>){
@@ -78,4 +35,15 @@ object BridgeServiceManager {
this.bridgeService?.invokeTrajectoryPointAndDistance(trajectoryList, distance)
}
/**
* 分发vmData
*/
fun invokeVlmData(vlmData: VlmData){
this.bridgeService?.invokeVlmDataDispatch(vlmData)
}
fun invokeNdeData(title: String, desc: String, sortedList: List<RoadMsg>) {
this.bridgeService?.inVokeNdeData(title,desc,sortedList)
}
}

View File

@@ -0,0 +1,42 @@
package com.mogo.och.bridge.bridge
data class VlmImageData(val imageSourceTimestamp: Double ,var image: ByteArray?) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as VlmImageData
return imageSourceTimestamp == other.imageSourceTimestamp
}
override fun hashCode(): Int {
return imageSourceTimestamp.hashCode()
}
override fun toString(): String {
return "VlmImageData(imageSourceTimestamp=$imageSourceTimestamp)"
}
}
data class VlmMessageData(val messageSourceTimestamp: Double ,val id:Int?,val message:String?){
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as VlmMessageData
// if (messageSourceTimestamp != other.messageSourceTimestamp) return false
if (id != other.id) return false
return true
}
override fun hashCode(): Int {
var result = messageSourceTimestamp.hashCode()
result = 31 * result + (id ?: 0)
return result
}
}

View File

@@ -4,24 +4,62 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningTrajectoryListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningTrajectoryListenerManager
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OCHCOMMON
import com.mogo.och.bridge.BridgeServiceManager
import com.mogo.och.common.module.manager.loop.BizLoopManager
import com.mogo.och.common.module.manager.loop.LoopInfo
import io.reactivex.schedulers.Schedulers
import prediction2025.Prediction2025
import mogo.telematics.pad.MessagePad
import kotlin.properties.Delegates
object OchBridgeManager: CallerBase<IMoGoPlanningTrajectoryListener>(),
IMoGoPlanningTrajectoryListener, IMoGoAutopilotIdentifyListener {
object OchBridgeManager: IMoGoPlanningTrajectoryListener, IMoGoAutopilotIdentifyListener {
private val TAG = "${M_OCHCOMMON}OchPlanningListenerManager"
private var trajectoryTime = 0L
private var predictionTime = 0L
fun load(){
CallerPlanningTrajectoryListenerManager.addListener(TAG,this)
CallerAutopilotIdentifyListenerManager.addListener(TAG,this)
BizLoopManager.setLoopFunction(TAG, LoopInfo(2, ::checkTimeout, immediately = false, scheduler = Schedulers.io()))
}
fun release(){
CallerPlanningTrajectoryListenerManager.removeListener(TAG)
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
}
// 是否有车前引导线
private var haveTrajectoryInfo: Boolean by Delegates.observable(false) { _, oldValue, newValue ->
if (oldValue != newValue) {
BridgeServiceManager.invokePlanningListener(newValue)
CallerLogger.d(TAG,"haveTrajectoryInfo 发生变化:${newValue}")
}
trajectoryTime = System.currentTimeMillis()
}
// 是否有预测数据
private var havePredictionInfo: Boolean by Delegates.observable(false) { _, oldValue, newValue ->
if (oldValue != newValue) {
BridgeServiceManager.invokePredictionHaveData(newValue)
CallerLogger.d(TAG,"havePredictionInfo 发生变化:${newValue}")
}
predictionTime = System.currentTimeMillis()
}
fun checkTimeout(){
if(System.currentTimeMillis() - trajectoryTime>2_000){
haveTrajectoryInfo = false
CallerLogger.d(TAG,"超时设置为falsehaveTrajectoryInfo $haveTrajectoryInfo")
}
if(System.currentTimeMillis() - predictionTime>2_000){
havePredictionInfo = false
CallerLogger.d(TAG,"超时设置为falsehavePredictionInfo $havePredictionInfo")
}
}
/**
@@ -29,17 +67,20 @@ object OchBridgeManager: CallerBase<IMoGoPlanningTrajectoryListener>(),
*/
override fun onAutopilotTrajectory(trajectoryInfos: MutableList<MessagePad.TrajectoryPoint>) {
if(trajectoryInfos.isEmpty()){
BridgeServiceManager.invokePlanningListener(false)
haveTrajectoryInfo = false
}else{
BridgeServiceManager.invokePlanningListener(true)
haveTrajectoryInfo = true
}
}
/**
* 预测信息
*/
override fun onPredictionObstacleTrajectory(predictionObjects: Prediction2025.mPredictionObjects) {
if (predictionObjects.objsAppList==null) {
BridgeServiceManager.invokePredictionHaveData(false)
havePredictionInfo = false
}else{
BridgeServiceManager.invokePredictionHaveData(true)
havePredictionInfo = true
}
}

View File

@@ -1,24 +1,28 @@
package com.mogo.och.unmanned.passenger.ui.aiview
package com.mogo.och.bridge.bridge
import androidx.lifecycle.ViewModel
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.och.unmanned.passenger.ui.aiview.bean.AIMessage
import com.mogo.eagle.core.function.call.autopilot.CallerVlmManager
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OCHCOMMON
import com.mogo.och.bridge.BridgeServiceManager
import com.mogo.och.common.module.biz.birdge.data.RoadMsg
import mogo.telematics.pad.MessagePad.TrackedObject
class NDEViewModel: ViewModel(), IMoGoAutopilotIdentifyListener {
object OchNdeManager : IMoGoAutopilotIdentifyListener {
private val TAG = "${M_OCHCOMMON}OchVlmManager"
companion object{
private const val TAG = "NDEViewModel"
fun load(){
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
}
fun release(){
CallerVlmManager.removeListener(TAG)
}
private var lastMap2 = HashMap<Int, String>()
private var lastTime = 0L
fun init(){
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
}
override fun onAutopilotIdentifyDataUpdate(trafficData: List<TrackedObject>?){
super.onAutopilotIdentifyDataUpdate(trafficData)
handleCheLong(trafficData)
@@ -27,7 +31,7 @@ class NDEViewModel: ViewModel(), IMoGoAutopilotIdentifyListener {
private fun handleCheLong(trafficData: List<TrackedObject>?) {
var hasCheLong = false
var isNewData = false
val roadMsgList = ArrayList<AIMessage.RoadMsg>()
val roadMsgList = ArrayList<RoadMsg>()
val curMap = HashMap<Int, String>()
if (lastTime > 0 && System.currentTimeMillis() - lastTime > 60000) {
lastMap2.clear()// 清除上次车龙事件的缓存
@@ -55,8 +59,7 @@ class NDEViewModel: ViewModel(), IMoGoAutopilotIdentifyListener {
curMap[obj.laneNum] = "0"
}
// 保存所有车道信息
roadMsgList.add(
AIMessage.RoadMsg(
roadMsgList.add(RoadMsg(
obj.arrowType,
laneNum = obj.laneNum,
isRecommend = obj.suggestedLanes,
@@ -74,10 +77,8 @@ class NDEViewModel: ViewModel(), IMoGoAutopilotIdentifyListener {
lastTime = System.currentTimeMillis()
val sortedList = roadMsgList.sortedWith(compareByDescending { it.laneNum })
val ndeEvent = AIMessage.NDEData(System.currentTimeMillis().toString(),"路口车龙","前方路口有车龙",sortedList)
AIMessageManager.post(ndeEvent)
BridgeServiceManager.invokeNdeData("路口车龙","前方路口有车龙",sortedList)
}
}
}
}

View File

@@ -0,0 +1,58 @@
package com.mogo.och.bridge.bridge
import com.mogo.eagle.core.function.api.autopilot.IVlmListener
import com.mogo.eagle.core.function.call.autopilot.CallerVlmManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OCHCOMMON
import com.mogo.och.bridge.BridgeServiceManager
import com.mogo.och.common.module.biz.birdge.data.VlmData
import vllm.Vlm
import kotlin.properties.Delegates
object OchVlmManager : IVlmListener {
private val TAG = "${M_OCHCOMMON}OchVlmManager"
fun load(){
CallerVlmManager.addListener(TAG,this)
}
fun release(){
CallerVlmManager.removeListener(TAG)
}
//
private var vllmImageData: VlmImageData by Delegates.observable(VlmImageData(0.0,null)) { _, oldValue, newValue ->
if (oldValue != newValue) {
if(newValue.imageSourceTimestamp == vllmData.messageSourceTimestamp){
CallerLogger.d(TAG," message先来 图片后来 发送message和图片 ${newValue.imageSourceTimestamp}---${vllmData.messageSourceTimestamp}")
BridgeServiceManager.invokeVlmData(VlmData(vllmData.id,vllmData.message,newValue.image))
}
}
}
private var vllmData: VlmMessageData by Delegates.observable(VlmMessageData(0.0,0,"")) { _, oldValue, newValue ->
if (oldValue != newValue) {
if(newValue.messageSourceTimestamp== vllmImageData.imageSourceTimestamp){
// 图片先来 发送message和图片
BridgeServiceManager.invokeVlmData(VlmData(newValue.id,newValue.message,
vllmImageData.image)
)
CallerLogger.d(TAG,"messsage后来 图片先来 发送message和图片 ${newValue.message}----${newValue.messageSourceTimestamp}---${newValue.id}")
}else{
// message 先来 单独发送message 图片来了后 再次发送出去
BridgeServiceManager.invokeVlmData(VlmData(newValue.id,newValue.message,null))
CallerLogger.d(TAG,"message先来 图片后来 发送message ${newValue.message}---${newValue.messageSourceTimestamp}---${newValue.id}")
}
}
}
override fun onVllm(sourceTimestamp: Double, vllm: Vlm.VLLMObject) {
if(this.vllmData.id!=vllm.workZone.id){
this.vllmData = VlmMessageData(sourceTimestamp,vllm.workZone.id,vllm.workZone.sceneExplantion)
}
}
override fun onVllmImage(sourceTimestamp: Double, image: ByteArray) {
this.vllmImageData = VlmImageData(sourceTimestamp,image)
}
}

View File

@@ -1,6 +1,8 @@
package com.mogo.och.common.module.debug
import android.content.Intent
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.os.Environment
import android.os.SystemClock
import chassis.Chassis
@@ -8,6 +10,7 @@ import chassis.Chassis.DoorNumber
import chassis.VehicleStateOuterClass
import com.amap.api.maps.model.LatLng
import com.google.gson.reflect.TypeToken
import com.mogo.commons.AbsMogoApplication
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.map.MogoLocation
@@ -24,6 +27,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02Lis
import com.mogo.eagle.core.function.call.autopilot.CallerChassisStatesListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerVlmManager
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.CallerMapRomaListener
@@ -34,24 +38,25 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.ActivityUtils
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.och.common.module.R
import com.mogo.och.common.module.biz.birdge.BridgeManager
import com.mogo.och.common.module.biz.order.OrderManager
import com.mogo.och.common.module.debug.location.MogoLocationExit
import com.mogo.och.common.module.manager.loop.BizLoopManager
//import com.mogo.och.bridge.distance.TrajectoryAndDistanceManager
//import com.mogo.och.bridge.utils.CoordinateCalculateRouteUtil
//import com.mogo.och.bridge.utils.CoordinateCalculateRouteUtil
import com.mogo.och.common.module.view.DebugFloatWindow
import com.mogo.och.common.module.wigets.media.MediaBeanManager
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics
import mogo.telematics.pad.MessagePad
import mogo_msg.MogoReportMsg
import vllm.Vlm
import java.io.BufferedReader
import java.io.ByteArrayOutputStream
import java.io.File
import java.io.FileInputStream
import java.io.IOException
import java.io.InputStreamReader
object DebugDataDispatch {
const val TAG = "DebugDataDispatch"
@@ -73,6 +78,8 @@ object DebugDataDispatch {
const val ota = "ota"
const val video = "video"
const val mediaMusic = "mediaAndMusic"
const val vlmMessage = "vlmMessage"
const val vlmImage = "vlmImage"
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "location" --es path "1111/11111"
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "globalPath" --es path "sy73.json"
@@ -89,7 +96,8 @@ object DebugDataDispatch {
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "showDebugView"
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "scanner" --es qrInfo ""
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "ota" --ei "ota" 1
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "video" --ei "video" 1 --es url "rtmp://video.zhidaozhixing.com/live/861130041693196C_2"
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "vlmMessage" --es message "前方100米有道路施工施工长度100米影响第1、2车道通行。" --ei id 128 --ef time 1880.0
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "vlmImage" --ef time 1880.0
val ROOT_PATH =
@@ -102,6 +110,25 @@ object DebugDataDispatch {
}
when (type) {
vlmMessage -> {
val time = intent.getFloatExtra("time",0f)
val id = intent.getIntExtra("id",0)
val message = intent.getStringExtra("message")
val newBuilder = Vlm.VLLMObject.newBuilder()
val build = newBuilder.workZoneBuilder.setId(id).setSceneExplantion(message).build()
newBuilder.workZone = build
CallerVlmManager.invokeVllm(time.toDouble(),newBuilder.build())
}
vlmImage -> {
val time = intent.getFloatExtra("time",0f)
BizLoopManager.runInIoThread{
val bitmap = BitmapFactory.decodeResource(AbsMogoApplication.getApp().resources, R.drawable.common_debug)
val stream = ByteArrayOutputStream()
bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream)
val byteArray = stream.toByteArray()
CallerVlmManager.invokeVllmImage(time.toDouble(),byteArray)
}
}
mediaMusic -> {
val musicList = MediaBeanManager.getMusicList()
val mediaList = MediaBeanManager.getMediaList()

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

View File

@@ -1,6 +1,8 @@
package com.mogo.och.common.module.biz.birdge
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.och.common.module.biz.birdge.data.RoadMsg
import com.mogo.och.common.module.biz.birdge.data.VlmData
interface BridgeListener {
/**
@@ -15,4 +17,9 @@ interface BridgeListener {
fun onTrajectoryDistanceListener(distance: Double){}
fun onTrajectoryPointsAndDistanceListener(trajectoryList: MutableList<MogoLocation>,distance: Double){}
fun onVlmDataListener(vlmData: VlmData){}
fun onNdeDataListener(title: String, desc: String, sortedList: List<RoadMsg>) {}
}

View File

@@ -0,0 +1,8 @@
package com.mogo.och.common.module.biz.birdge.data
data class RoadMsg(
var arrowType: Int, // 车道类型如直行201(详情参考文件message_pad.proto)
var laneNum: Int,// 车道号
var isRecommend: Boolean,// 是否是推荐车道
var isCheLong: Boolean// 是否有车龙,代表拥堵、行驶缓慢
)

View File

@@ -0,0 +1,28 @@
package com.mogo.och.common.module.biz.birdge.data
data class VlmData(val id:Int?,val message:String?,var image: ByteArray?) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as VlmData
if (id != other.id) return false
if (message != other.message) return false
if (image != null) {
if (other.image == null) return false
if (!image.contentEquals(other.image)) return false
} else if (other.image != null) return false
return true
}
override fun hashCode(): Int {
return id ?: 0
}
override fun toString(): String {
return "VlmData(id=$id, message=$message)"
}
}

View File

@@ -0,0 +1,45 @@
package com.mogo.och.common.module.manager
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
object EnvManager {
fun isB1(): Boolean {
return AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)
}
fun isB1Driver(): Boolean {
return isB1() && AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
}
fun isB1Passenger(): Boolean {
return isB1() && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
}
fun isB2(): Boolean {
return AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)
}
fun isB2Driver(): Boolean {
return isB2() && AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
}
fun isB2Passenger(): Boolean {
return isB2() && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
}
fun isT1T2(): Boolean {
return AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)
}
fun isT1T2Driver(): Boolean {
return isT1T2() && AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
}
fun isT1T2Passenger(): Boolean {
return isT1T2() && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
}
}

View File

@@ -10,6 +10,7 @@ import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager
import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.eagle.core.utilcode.util.AppUtils
import com.mogo.eagle.core.utilcode.util.UriUtils
import com.mogo.och.common.module.biz.birdge.data.RoadMsg
import com.mogo.och.common.module.biz.media.MediaManager
import com.mogo.och.common.module.manager.loop.BizLoopManager
import com.mogo.och.common.module.manager.transform.OchTransform
@@ -126,11 +127,11 @@ class PM2BaseFragment :
CallerMapRoadListenerManager.invokeCrossDevice(true)
}
test3.onClick {
val one = AIMessage.RoadMsg(201,1,true,false)
val two = AIMessage.RoadMsg(202,2,false,false)
val three = AIMessage.RoadMsg(203,3,false,true)
val one = RoadMsg(201,1,true,false)
val two = RoadMsg(202,2,false,false)
val three = RoadMsg(203,3,false,true)
val sortedList = ArrayList<AIMessage.RoadMsg>()
val sortedList = ArrayList<RoadMsg>()
sortedList.add(one)
sortedList.add(two)
sortedList.add(three)

View File

@@ -10,14 +10,14 @@ import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import com.mogo.och.common.module.biz.birdge.data.RoadMsg
import com.mogo.och.shuttle.weaknet.passenger.R
import com.mogo.och.shuttle.weaknet.passenger.ui.mind.bean.AIMessage
class AINDERoadAdapter(private val context: Context): RecyclerView.Adapter<AINDERoadAdapter.AIRoadHolder>() {
private var roadList: List<AIMessage.RoadMsg>?= null
private var roadList: List<RoadMsg>?= null
fun setData(list: List<AIMessage.RoadMsg>){
fun setData(list: List<RoadMsg>){
roadList = list
notifyDataSetChanged()
}

View File

@@ -3,6 +3,8 @@ package com.mogo.och.shuttle.weaknet.passenger.ui.mind.bean
import android.os.CountDownTimer
import android.util.Log
import com.mogo.eagle.core.data.v2x.RoadV2NEventType
import com.mogo.och.common.module.biz.birdge.data.RoadMsg
import com.mogo.och.common.module.biz.birdge.data.VlmData
import kotlin.math.floor
@@ -175,11 +177,11 @@ sealed class AIMessage(
var roadList: List<RoadMsg>
): AIMessage(id,title)
data class RoadMsg(
var arrowType: Int, // 车道类型如直行201(详情参考文件message_pad.proto)
var laneNum: Int,// 车道号
var isRecommend: Boolean,// 是否是推荐车道
var isCheLong: Boolean// 是否有车龙,代表拥堵、行驶缓慢
)
data class AiVlmData(
override val id: String,
override val title: String,
var desc: String,
var vlmData: VlmData
):AIMessage(id,title)
}

View File

@@ -3,85 +3,33 @@ package com.mogo.och.shuttle.weaknet.passenger.ui.mind.data
import androidx.lifecycle.ViewModel
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.och.common.module.biz.birdge.BridgeListener
import com.mogo.och.common.module.biz.birdge.BridgeManager
import com.mogo.och.common.module.biz.birdge.data.RoadMsg
import com.mogo.och.shuttle.weaknet.passenger.ui.mind.AIMessageManager
import com.mogo.och.shuttle.weaknet.passenger.ui.mind.bean.AIMessage
import mogo.telematics.pad.MessagePad.TrackedObject
/**
* 车龙信息
*/
class NDEViewModel: ViewModel(), IMoGoAutopilotIdentifyListener {
class NDEViewModel: ViewModel(), BridgeListener {
companion object{
private const val TAG = "NDEViewModel"
}
private var lastMap2 = HashMap<Int, String>()
private var lastTime = 0L
fun init(){
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
BridgeManager.addBridgeListener(TAG,this)
}
override fun onAutopilotIdentifyDataUpdate(trafficData: List<TrackedObject>?){
super.onAutopilotIdentifyDataUpdate(trafficData)
handleCheLong(trafficData)
override fun onCleared() {
super.onCleared()
BridgeManager.removeBridgeListener(TAG)
}
private fun handleCheLong(trafficData: List<TrackedObject>?) {
var hasCheLong = false
var isNewData = false
val roadMsgList = ArrayList<AIMessage.RoadMsg>()
val curMap = HashMap<Int, String>()
if (lastTime > 0 && System.currentTimeMillis() - lastTime > 60000) {
lastMap2.clear()// 清除上次车龙事件的缓存
}
var lastLocStr: String? = ""
trafficData?.forEach { obj ->
if (obj.type == 707) {// 当前方向所有车道
if (obj.polygonCount > 1) {// 当次数据有车龙事件
lastLocStr = lastMap2[obj.laneNum]
// 1. 上次无车龙但此次有车龙,认为是新车龙事件
// 2. 两次都有车龙,则判断车龙的长度是否相同
if (lastLocStr == null || lastLocStr == "0" || lastLocStr != "${obj.polygonList[0]}-${obj.polygonList[obj.polygonCount - 1]}") {
isNewData = true
}
hasCheLong = true
// key: 车道号value: 非0代表有车龙且首、尾两个点可计算车龙长度
curMap[obj.laneNum] =
"${obj.polygonList[0]}-${obj.polygonList[obj.polygonCount - 1]}"
} else {// 当次没有车龙
if (lastMap2[obj.laneNum] != null && lastMap2[obj.laneNum] != "0") {// 3. 上次有车龙,这次无车龙
isNewData = true
}
// key: 车道号value: 0代表无车龙
curMap[obj.laneNum] = "0"
}
// 保存所有车道信息
roadMsgList.add(
AIMessage.RoadMsg(
obj.arrowType,
laneNum = obj.laneNum,
isRecommend = obj.suggestedLanes,
isCheLong = obj.polygonCount > 1
)
)
}
}
if (isNewData) {
// 清除上次车道信息
lastMap2.clear()
if (hasCheLong) {
// 缓存当次车龙事件所有车道信息
lastMap2.putAll(curMap)
lastTime = System.currentTimeMillis()
val sortedList = roadMsgList.sortedWith(compareByDescending { it.laneNum })
val ndeEvent = AIMessage.NDEData(System.currentTimeMillis().toString(),"路口车龙","前方路口有车龙",sortedList)
AIMessageManager.post(ndeEvent)
}
}
override fun onNdeDataListener(title: String, desc: String, sortedList: List<RoadMsg>) {
val ndeEvent = AIMessage.NDEData(System.currentTimeMillis().toString(),title,desc,sortedList)
AIMessageManager.post(ndeEvent)
}
}

View File

@@ -26,6 +26,10 @@ import com.mogo.och.unmanned.passenger.ui.aiview.adapter.AIMessageAdapter
import com.mogo.och.unmanned.passenger.ui.aiview.adapter.OnItemClickListener
import com.mogo.och.unmanned.passenger.ui.aiview.adapter.PaddingItemDecoration
import com.mogo.och.unmanned.passenger.ui.aiview.bean.AIMessage
import com.mogo.och.unmanned.passenger.ui.aiview.data.AutomaticExplorationViewModel
import com.mogo.och.unmanned.passenger.ui.aiview.data.NDEViewModel
import com.mogo.och.unmanned.passenger.ui.aiview.data.RoadCrossRoamViewModel
import com.mogo.och.unmanned.passenger.ui.aiview.data.RoadV2NEventViewModel
import com.mogo.och.unmanned.taxi.passenger.R
import kotlinx.android.synthetic.main.taxt_p_ai.view.aiMotionLayout
import kotlinx.android.synthetic.main.taxt_p_ai.view.ivIcon
@@ -47,11 +51,10 @@ class AiView @JvmOverloads constructor(
private var viewModel:AIViewModel?=null
// private var pncActionsModel:PNCActionsViewModel ?= null
private var roadV2NEventModel:RoadV2NEventViewModel ?= null
private var roadCrossRoamModel:RoadCrossRoamViewModel ?= null
private var automaticExplorationModel:AutomaticExplorationViewModel ?= null
private var ndeViewModel: NDEViewModel ?= null
private var roadV2NEventModel: RoadV2NEventViewModel?= null
private var roadCrossRoamModel: RoadCrossRoamViewModel?= null
private var automaticExplorationModel: AutomaticExplorationViewModel?= null
private var ndeViewModel: NDEViewModel?= null
private var aiAnimator: BigFrameAnimatorContainer?=null
private var aiAnimatorBg: BigFrameAnimatorContainer?=null
@@ -105,7 +108,6 @@ class AiView @JvmOverloads constructor(
if(aiAnimator==null) {
aiAnimator = BigFrameAnimatorContainer(R.array.ai_animator, 31, ivIcon)
}
// aiAnimator?.start()
ivIcon.onClick {
viewModel?.onWakeUp()

View File

@@ -26,6 +26,7 @@ class AIMessageAdapter : ListAdapter<AIMessage, MessageViewHolder>(MessageDiffCa
AIMessage.TYPE_AUTOMATIC_EXPLORATION -> AutomaticExplorationViewHolder(inflater.inflate(R.layout.item_ai_automatic_exploration,parent,false))
AIMessage.TYPE_EVALUATE -> EvaluateViewViewHolder(inflater.inflate(R.layout.taxi_p_evaluate,parent,false))
AIMessage.TYPE_NDE -> NDEViewHolder(inflater.inflate(R.layout.item_ai_nde_event,parent,false))
AIMessage.TYPE_VLM -> VlmViewHolder(inflater.inflate(R.layout.item_ai_vlm_action,parent,false))
else -> throw IllegalArgumentException("Invalid view type")
}
}
@@ -44,6 +45,7 @@ class AIMessageAdapter : ListAdapter<AIMessage, MessageViewHolder>(MessageDiffCa
is AIMessage.AutomaticExploration -> AIMessage.TYPE_AUTOMATIC_EXPLORATION
is AIMessage.EvaluateData -> AIMessage.TYPE_EVALUATE
is AIMessage.NDEData -> AIMessage.TYPE_NDE
is AIMessage.AiVlmData -> AIMessage.TYPE_VLM
else -> AIMessage.TYPE_EVENT
}
}

View File

@@ -6,7 +6,6 @@ import android.animation.ObjectAnimator
import android.animation.ValueAnimator
import android.content.Context
import android.graphics.Rect
import android.text.TextUtils
import android.util.Log
import android.view.View
import android.view.animation.LinearInterpolator
@@ -14,6 +13,7 @@ import android.widget.FrameLayout
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import androidx.appcompat.widget.AppCompatImageView
import androidx.core.content.ContextCompat
import androidx.core.graphics.toColorInt
import androidx.recyclerview.widget.LinearLayoutManager
@@ -28,7 +28,9 @@ import com.mogo.eagle.core.function.hmi.ui.v2n.RoadV2NEventLivePlayView
import com.mogo.eagle.core.function.view.MapRoamView
import com.mogo.eagle.core.function.view.RoadCrossRoamListAdapter
import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
import com.mogo.eagle.core.utilcode.mogo.glide.GlideImageLoader
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
import com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
import com.mogo.eagle.core.utilcode.util.DateTimeUtils
import com.mogo.och.common.module.utils.FrameAnimatorContainer
@@ -38,8 +40,6 @@ import com.mogo.och.unmanned.taxi.passenger.R
import com.youth.banner.Banner
import com.youth.banner.indicator.CircleIndicator
import com.youth.banner.transformer.ScaleInTransformer
import kotlinx.android.synthetic.main.taxi_p_evaluate.view.iv_evaluate_great
import kotlinx.android.synthetic.main.taxi_p_evaluate.view.iv_evaluate_low
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
@@ -85,6 +85,23 @@ abstract class MessageViewHolder(view: View) : RecyclerView.ViewHolder(view) {
.placeholder(R.drawable.icon_pic_holder)
.error(R.drawable.icon_pic_error)
// .error(R.drawable.icon_marker_window_place_holder)
// .placeholder(R.drawable.icon_marker_window_place_holder)
.into(this)
}
}
fun ImageView.showOrHideWithByteArray(image: ByteArray?) {
if (image==null) {
visibility = View.GONE
} else {
visibility = View.VISIBLE
//optionalTransform(new GlideRoundedCornersTransform(30f, GlideRoundedCornersTransform.CornerType.LEFT))
Glide.with(this)
.load(image)
.optionalTransform(GlideRoundedCornersTransform(18f, GlideRoundedCornersTransform.CornerType.ALL))
.placeholder(R.drawable.icon_pic_holder)
.error(R.drawable.icon_pic_error)
// .error(R.drawable.icon_marker_window_place_holder)
// .placeholder(R.drawable.icon_marker_window_place_holder)
.into(this)
@@ -434,6 +451,21 @@ class NDEViewHolder(binding: View) : MessageViewHolder(binding){
}
class VlmViewHolder(binding: View) : MessageViewHolder(binding){
private var tvNdeTitle: TextView = binding.findViewById(R.id.tvVlmMessage)
private var acivVlmImage: AppCompatImageView = binding.findViewById(R.id.acivVlmImage)
override fun bind(item: AIMessage, onItemClickListener: OnItemClickListener?) {
if(item is AIMessage.AiVlmData){
tvNdeTitle.text = item.vlmData.message
acivVlmImage.showOrHideWithByteArray(item.vlmData.image)
}
}
}
private class NoScrollLayoutManager(context: Context?) : LinearLayoutManager(context) {
override fun canScrollVertically(): Boolean {
return false

View File

@@ -10,14 +10,14 @@ import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import com.mogo.och.unmanned.passenger.ui.aiview.bean.AIMessage
import com.mogo.och.common.module.biz.birdge.data.RoadMsg
import com.mogo.och.unmanned.taxi.passenger.R
class AINDERoadAdapter(private val context: Context): RecyclerView.Adapter<AINDERoadAdapter.AIRoadHolder>() {
private var roadList: List<AIMessage.RoadMsg>?= null
private var roadList: List<RoadMsg>?= null
fun setData(list: List<AIMessage.RoadMsg>){
fun setData(list: List<RoadMsg>){
roadList = list
notifyDataSetChanged()
}

View File

@@ -3,6 +3,8 @@ package com.mogo.och.unmanned.passenger.ui.aiview.bean
import android.os.CountDownTimer
import android.util.Log
import com.mogo.eagle.core.data.v2x.RoadV2NEventType
import com.mogo.och.common.module.biz.birdge.data.RoadMsg
import com.mogo.och.common.module.biz.birdge.data.VlmData
import kotlin.math.floor
@@ -27,6 +29,7 @@ sealed class AIMessage(
const val TYPE_AUTOMATIC_EXPLORATION = 9
const val TYPE_EVALUATE = 10
const val TYPE_NDE = 11
const val TYPE_VLM = 12
}
data class Scan(
@@ -177,11 +180,11 @@ sealed class AIMessage(
var roadList: List<RoadMsg>
):AIMessage(id,title)
data class RoadMsg(
var arrowType: Int, // 车道类型如直行201(详情参考文件message_pad.proto)
var laneNum: Int,// 车道号
var isRecommend: Boolean,// 是否是推荐车道
var isCheLong: Boolean// 是否有车龙,代表拥堵、行驶缓慢
)
data class AiVlmData(
override val id: String,
override val title: String,
var desc: String,
var vlmData: VlmData
):AIMessage(id,title)
}

View File

@@ -1,4 +1,4 @@
package com.mogo.och.unmanned.passenger.ui.aiview
package com.mogo.och.unmanned.passenger.ui.aiview.data
import android.os.CountDownTimer
import androidx.lifecycle.ViewModel
@@ -10,11 +10,11 @@ import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
import com.mogo.eagle.core.utilcode.util.StringUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.bridge.distance.IDistanceListener
import com.mogo.och.bridge.distance.TrajectoryAndDistanceManager
import com.mogo.och.data.taxi.BaseOrderBean
import com.mogo.och.data.taxi.TaxiOrderStatusEnum
import com.mogo.och.unmanned.passenger.ui.aiview.AIMessageManager
import com.mogo.och.unmanned.passenger.ui.aiview.bean.AIMessage
import com.mogo.och.unmanned.taxi.utils.order.OrderListener
import com.mogo.och.unmanned.taxi.utils.order.OrderModel

View File

@@ -0,0 +1,39 @@
package com.mogo.och.unmanned.passenger.ui.aiview.data
import androidx.lifecycle.ViewModel
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.och.common.module.biz.birdge.BridgeListener
import com.mogo.och.common.module.biz.birdge.BridgeManager
import com.mogo.och.common.module.biz.birdge.data.RoadMsg
import com.mogo.och.common.module.biz.birdge.data.VlmData
import com.mogo.och.unmanned.passenger.ui.aiview.AIMessageManager
import com.mogo.och.unmanned.passenger.ui.aiview.bean.AIMessage
class NDEViewModel: ViewModel(), BridgeListener {
companion object{
private const val TAG = "NDEViewModel"
}
fun init(){
BridgeManager.addBridgeListener(TAG,this)
}
override fun onCleared() {
super.onCleared()
BridgeManager.removeBridgeListener(TAG)
}
override fun onVlmDataListener(vlmData: VlmData){
val ndeEvent = AIMessage.AiVlmData(vlmData.id.toString(),"","",vlmData)
AIMessageManager.post(ndeEvent)
}
override fun onNdeDataListener(title: String, desc: String, sortedList: List<RoadMsg>) {
val ndeEvent = AIMessage.NDEData(System.currentTimeMillis().toString(),title,desc,sortedList)
AIMessageManager.post(ndeEvent)
}
}

View File

@@ -1,4 +1,4 @@
package com.mogo.och.unmanned.passenger.ui.aiview
package com.mogo.och.unmanned.passenger.ui.aiview.data
import androidx.lifecycle.ViewModel
import com.mogo.eagle.core.data.autopilot.pnc.PncActionsHelper
@@ -6,10 +6,9 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningActionsL
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.common.module.manager.loop.BizLoopManager
import com.mogo.och.unmanned.passenger.model.TaxiPassengerModel
import com.mogo.och.unmanned.passenger.ui.aiview.AIMessageManager
import com.mogo.och.unmanned.passenger.ui.aiview.bean.AIMessage
import mogo.telematics.pad.MessagePad

View File

@@ -1,7 +1,6 @@
package com.mogo.och.unmanned.passenger.ui.aiview
package com.mogo.och.unmanned.passenger.ui.aiview.data
import android.content.Context
import android.view.View
import androidx.lifecycle.ViewModel
import com.mogo.commons.voice.AIAssist
import com.mogo.eagle.core.data.config.FunctionBuildConfig
@@ -14,6 +13,7 @@ import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.unmanned.passenger.ui.aiview.AIMessageManager
import com.mogo.och.unmanned.passenger.ui.aiview.bean.AIMessage
class RoadCrossRoamViewModel: ViewModel(), IMoGoMapRoadListener {
@@ -67,7 +67,7 @@ class RoadCrossRoamViewModel: ViewModel(), IMoGoMapRoadListener {
AIAssist.getInstance(mContext).speakTTSVoiceWithLevel(disStr, AIAssist.NEW_LEVEL_2)
}
CallerServicesEventManager.updateServicesNum(CallerServicesEventManager.ServiceType.ROAD)
AIMessageManager.post(AIMessage.RoadCrossRoam(System.currentTimeMillis().toString(),""))
AIMessageManager.post(AIMessage.RoadCrossRoam(System.currentTimeMillis().toString(), ""))
}
}

View File

@@ -1,4 +1,4 @@
package com.mogo.och.unmanned.passenger.ui.aiview
package com.mogo.och.unmanned.passenger.ui.aiview.data
import androidx.lifecycle.ProcessLifecycleOwner
import androidx.lifecycle.ViewModel
@@ -11,6 +11,7 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerRoadV2NEventWindowListenerManager
import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.och.unmanned.passenger.ui.aiview.AIMessageManager
import com.mogo.och.unmanned.passenger.ui.aiview.bean.AIMessage
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch

View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="@dimen/dp_799"
android:layout_height="wrap_content"
app:shadowRadius="@dimen/dp_20"
app:shadowColor="#26666666"
app:xOffset="0dp"
app:yOffset="0dp"
app:blurRadius="@dimen/dp_26">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="@dimen/dp_747"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tvVlmMessage"
android:layout_width="@dimen/dp_0"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@+id/acivVlmImage"
android:textSize="@dimen/dp_33"
android:textColor="@color/taxi_cp_394047"
android:layout_marginStart="@dimen/dp_30"
android:layout_marginEnd="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_27"
android:layout_marginBottom="@dimen/dp_20"
tools:text="前方100米有道路施工施工长度100米影响第1、2车道通行。"
/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/acivVlmImage"
app:layout_constraintTop_toBottomOf="@+id/tvVlmMessage"
android:layout_marginStart="@dimen/dp_30"
android:layout_marginEnd="@dimen/dp_30"
android:layout_marginBottom="@dimen/dp_27"
android:scaleType="fitXY"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:src="@drawable/icon_image_holder"
tools:background="@color/taxi_cp_394047"
android:layout_width="@dimen/dp_0"
android:layout_height="@dimen/dp_440"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.mogo.och.common.module.wigets.OCHBorderShadowLayout>

View File

@@ -1567,7 +1567,9 @@ internal class DebugSettingView @JvmOverloads constructor(
*/
@SuppressLint("SetTextI18n")
private fun setDomainControllerCheckedChangeListener() {
etAutopilotIP.setText("192.168.1.")
val string = SharedPrefsMgr.getInstance()
.getString(SharedPrefsConstants.inputIpDomainController, "192.168.1.")
etAutopilotIP.setText(string)
etAutopilotIP.text?.let { etAutopilotIP.setSelection(it.length) }
//设置工控机IP
btnSetAutopilotIP.setOnClickListener {
@@ -1575,6 +1577,7 @@ internal class DebugSettingView @JvmOverloads constructor(
if (autoPilotIp.isNotEmpty()) {
SSHAccountConfig.setRosMasterIp(autoPilotIp.split(":", "").first())
CallerAutoPilotControlManager.resetIpAddress(autoPilotIp)
SharedPrefsMgr.getInstance().putString(SharedPrefsConstants.inputIpDomainController,autoPilotIp)
} else {
ToastUtils.showShort("请输入正确的IP地址")
}

View File

@@ -18,4 +18,6 @@ public class SharedPrefsConstants {
public static final String APP_UPGRADE_CONTENT = "app_upgrade_content";
public static final String APP_MAC = "app_mac";
public static final String inputIpDomainController = "InputIpDomainController";
}