Merge branch 'dev_robotaxi-d_250603_8.1.0' of gitlab.zhidaoauto.com:SCA/L4HA/AndroidApp/MoGoEagleEye into dev_robotaxi-d_250603_8.1.0
This commit is contained in:
@@ -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.autopilot.location.OchLocationManager
|
||||||
import com.mogo.och.bridge.distance.TrajectoryAndDistanceManager
|
import com.mogo.och.bridge.distance.TrajectoryAndDistanceManager
|
||||||
import com.mogo.och.bridge.bridge.OchBridgeManager
|
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.bridge.trajectory.TrajectoryManager
|
||||||
import com.mogo.och.common.module.biz.birdge.BridgeService
|
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.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.constant.OchCommonConst
|
||||||
|
import com.mogo.och.common.module.manager.EnvManager
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -29,7 +33,16 @@ class BridgeProvider : BridgeService, CallerBase<BridgeListener>() {
|
|||||||
|
|
||||||
override fun init(context: Context?) {
|
override fun init(context: Context?) {
|
||||||
this.context = context
|
this.context = context
|
||||||
OchBridgeManager.load()
|
|
||||||
|
// 车前引导线+预测数据
|
||||||
|
if(EnvManager.isB2Passenger()||EnvManager.isT1T2Passenger()){
|
||||||
|
OchBridgeManager.load()
|
||||||
|
}
|
||||||
|
|
||||||
|
// if(EnvManager.isT1T2Passenger()){
|
||||||
|
OchVlmManager.load()
|
||||||
|
// }
|
||||||
|
|
||||||
TrajectoryManager.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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3,13 +3,10 @@ package com.mogo.och.bridge
|
|||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import com.alibaba.android.arouter.launcher.ARouter
|
import com.alibaba.android.arouter.launcher.ARouter
|
||||||
import com.mogo.eagle.core.data.map.MogoLocation
|
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.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.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 {
|
object BridgeServiceManager {
|
||||||
|
|
||||||
@@ -19,52 +16,12 @@ object BridgeServiceManager {
|
|||||||
private var bridgeService: BridgeProvider? =
|
private var bridgeService: BridgeProvider? =
|
||||||
ARouter.getInstance().build(OchCommonConst.BIZ_Bridge).navigation() as 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,"超时设置为false:haveTrajectoryInfo ${haveTrajectoryInfo}")
|
|
||||||
}
|
|
||||||
if(System.currentTimeMillis() - predictionTime>2_000){
|
|
||||||
havePredictionInfo = false
|
|
||||||
CallerLogger.d(TAG,"超时设置为false:havePredictionInfo ${havePredictionInfo}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
fun invokePlanningListener(haveTrajectoryInfos:Boolean){
|
fun invokePlanningListener(haveTrajectoryInfos:Boolean){
|
||||||
this.haveTrajectoryInfo = haveTrajectoryInfos
|
bridgeService?.invokeTrajectoryHaveDataListener(haveTrajectoryInfos)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun invokePredictionHaveData(havePredictionInfos:Boolean){
|
fun invokePredictionHaveData(havePredictionInfos:Boolean){
|
||||||
this.havePredictionInfo = havePredictionInfos
|
bridgeService?.invokePredictionHavaData(havePredictionInfos)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun invokeTrajectoryPoints(trajectoryList: MutableList<MogoLocation>){
|
fun invokeTrajectoryPoints(trajectoryList: MutableList<MogoLocation>){
|
||||||
@@ -78,4 +35,15 @@ object BridgeServiceManager {
|
|||||||
this.bridgeService?.invokeTrajectoryPointAndDistance(trajectoryList, distance)
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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.api.autopilot.IMoGoPlanningTrajectoryListener
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
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.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.CallerLogger
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OCHCOMMON
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OCHCOMMON
|
||||||
import com.mogo.och.bridge.BridgeServiceManager
|
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 prediction2025.Prediction2025
|
||||||
import mogo.telematics.pad.MessagePad
|
import mogo.telematics.pad.MessagePad
|
||||||
|
import kotlin.properties.Delegates
|
||||||
|
|
||||||
object OchBridgeManager: CallerBase<IMoGoPlanningTrajectoryListener>(),
|
object OchBridgeManager: IMoGoPlanningTrajectoryListener, IMoGoAutopilotIdentifyListener {
|
||||||
IMoGoPlanningTrajectoryListener, IMoGoAutopilotIdentifyListener {
|
|
||||||
private val TAG = "${M_OCHCOMMON}OchPlanningListenerManager"
|
private val TAG = "${M_OCHCOMMON}OchPlanningListenerManager"
|
||||||
|
|
||||||
|
|
||||||
|
private var trajectoryTime = 0L
|
||||||
|
private var predictionTime = 0L
|
||||||
|
|
||||||
fun load(){
|
fun load(){
|
||||||
CallerPlanningTrajectoryListenerManager.addListener(TAG,this)
|
CallerPlanningTrajectoryListenerManager.addListener(TAG,this)
|
||||||
CallerAutopilotIdentifyListenerManager.addListener(TAG,this)
|
CallerAutopilotIdentifyListenerManager.addListener(TAG,this)
|
||||||
|
BizLoopManager.setLoopFunction(TAG, LoopInfo(2, ::checkTimeout, immediately = false, scheduler = Schedulers.io()))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun release(){
|
fun release(){
|
||||||
CallerPlanningTrajectoryListenerManager.removeListener(TAG)
|
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,"超时设置为false:haveTrajectoryInfo $haveTrajectoryInfo")
|
||||||
|
}
|
||||||
|
if(System.currentTimeMillis() - predictionTime>2_000){
|
||||||
|
havePredictionInfo = false
|
||||||
|
CallerLogger.d(TAG,"超时设置为false:havePredictionInfo $havePredictionInfo")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -29,17 +67,20 @@ object OchBridgeManager: CallerBase<IMoGoPlanningTrajectoryListener>(),
|
|||||||
*/
|
*/
|
||||||
override fun onAutopilotTrajectory(trajectoryInfos: MutableList<MessagePad.TrajectoryPoint>) {
|
override fun onAutopilotTrajectory(trajectoryInfos: MutableList<MessagePad.TrajectoryPoint>) {
|
||||||
if(trajectoryInfos.isEmpty()){
|
if(trajectoryInfos.isEmpty()){
|
||||||
BridgeServiceManager.invokePlanningListener(false)
|
haveTrajectoryInfo = false
|
||||||
}else{
|
}else{
|
||||||
BridgeServiceManager.invokePlanningListener(true)
|
haveTrajectoryInfo = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预测信息
|
||||||
|
*/
|
||||||
override fun onPredictionObstacleTrajectory(predictionObjects: Prediction2025.mPredictionObjects) {
|
override fun onPredictionObstacleTrajectory(predictionObjects: Prediction2025.mPredictionObjects) {
|
||||||
if (predictionObjects.objsAppList==null) {
|
if (predictionObjects.objsAppList==null) {
|
||||||
BridgeServiceManager.invokePredictionHaveData(false)
|
havePredictionInfo = false
|
||||||
}else{
|
}else{
|
||||||
BridgeServiceManager.invokePredictionHaveData(true)
|
havePredictionInfo = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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.api.autopilot.IMoGoAutopilotIdentifyListener
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
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
|
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||||
|
|
||||||
class NDEViewModel: ViewModel(), IMoGoAutopilotIdentifyListener {
|
object OchNdeManager : IMoGoAutopilotIdentifyListener {
|
||||||
|
private val TAG = "${M_OCHCOMMON}OchVlmManager"
|
||||||
|
|
||||||
companion object{
|
fun load(){
|
||||||
private const val TAG = "NDEViewModel"
|
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun release(){
|
||||||
|
CallerVlmManager.removeListener(TAG)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var lastMap2 = HashMap<Int, String>()
|
private var lastMap2 = HashMap<Int, String>()
|
||||||
private var lastTime = 0L
|
private var lastTime = 0L
|
||||||
|
|
||||||
fun init(){
|
|
||||||
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onAutopilotIdentifyDataUpdate(trafficData: List<TrackedObject>?){
|
override fun onAutopilotIdentifyDataUpdate(trafficData: List<TrackedObject>?){
|
||||||
super.onAutopilotIdentifyDataUpdate(trafficData)
|
super.onAutopilotIdentifyDataUpdate(trafficData)
|
||||||
handleCheLong(trafficData)
|
handleCheLong(trafficData)
|
||||||
@@ -27,7 +31,7 @@ class NDEViewModel: ViewModel(), IMoGoAutopilotIdentifyListener {
|
|||||||
private fun handleCheLong(trafficData: List<TrackedObject>?) {
|
private fun handleCheLong(trafficData: List<TrackedObject>?) {
|
||||||
var hasCheLong = false
|
var hasCheLong = false
|
||||||
var isNewData = false
|
var isNewData = false
|
||||||
val roadMsgList = ArrayList<AIMessage.RoadMsg>()
|
val roadMsgList = ArrayList<RoadMsg>()
|
||||||
val curMap = HashMap<Int, String>()
|
val curMap = HashMap<Int, String>()
|
||||||
if (lastTime > 0 && System.currentTimeMillis() - lastTime > 60000) {
|
if (lastTime > 0 && System.currentTimeMillis() - lastTime > 60000) {
|
||||||
lastMap2.clear()// 清除上次车龙事件的缓存
|
lastMap2.clear()// 清除上次车龙事件的缓存
|
||||||
@@ -55,8 +59,7 @@ class NDEViewModel: ViewModel(), IMoGoAutopilotIdentifyListener {
|
|||||||
curMap[obj.laneNum] = "0"
|
curMap[obj.laneNum] = "0"
|
||||||
}
|
}
|
||||||
// 保存所有车道信息
|
// 保存所有车道信息
|
||||||
roadMsgList.add(
|
roadMsgList.add(RoadMsg(
|
||||||
AIMessage.RoadMsg(
|
|
||||||
obj.arrowType,
|
obj.arrowType,
|
||||||
laneNum = obj.laneNum,
|
laneNum = obj.laneNum,
|
||||||
isRecommend = obj.suggestedLanes,
|
isRecommend = obj.suggestedLanes,
|
||||||
@@ -74,10 +77,8 @@ class NDEViewModel: ViewModel(), IMoGoAutopilotIdentifyListener {
|
|||||||
lastTime = System.currentTimeMillis()
|
lastTime = System.currentTimeMillis()
|
||||||
|
|
||||||
val sortedList = roadMsgList.sortedWith(compareByDescending { it.laneNum })
|
val sortedList = roadMsgList.sortedWith(compareByDescending { it.laneNum })
|
||||||
val ndeEvent = AIMessage.NDEData(System.currentTimeMillis().toString(),"路口车龙","前方路口有车龙",sortedList)
|
BridgeServiceManager.invokeNdeData("路口车龙","前方路口有车龙",sortedList)
|
||||||
AIMessageManager.post(ndeEvent)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -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)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.mogo.och.common.module.debug
|
package com.mogo.och.common.module.debug
|
||||||
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import android.graphics.Bitmap
|
||||||
|
import android.graphics.BitmapFactory
|
||||||
import android.os.Environment
|
import android.os.Environment
|
||||||
import android.os.SystemClock
|
import android.os.SystemClock
|
||||||
import chassis.Chassis
|
import chassis.Chassis
|
||||||
@@ -8,6 +10,7 @@ import chassis.Chassis.DoorNumber
|
|||||||
import chassis.VehicleStateOuterClass
|
import chassis.VehicleStateOuterClass
|
||||||
import com.amap.api.maps.model.LatLng
|
import com.amap.api.maps.model.LatLng
|
||||||
import com.google.gson.reflect.TypeToken
|
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.DataSourceType
|
||||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||||
import com.mogo.eagle.core.data.map.MogoLocation
|
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.CallerChassisStatesListenerManager
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager
|
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.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.devatools.CallerDevaToolsManager
|
||||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener
|
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.ActivityUtils
|
||||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
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.birdge.BridgeManager
|
||||||
import com.mogo.och.common.module.biz.order.OrderManager
|
import com.mogo.och.common.module.biz.order.OrderManager
|
||||||
import com.mogo.och.common.module.debug.location.MogoLocationExit
|
import com.mogo.och.common.module.debug.location.MogoLocationExit
|
||||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
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.view.DebugFloatWindow
|
||||||
import com.mogo.och.common.module.wigets.media.MediaBeanManager
|
import com.mogo.och.common.module.wigets.media.MediaBeanManager
|
||||||
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics
|
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics
|
||||||
import mogo.telematics.pad.MessagePad
|
import mogo.telematics.pad.MessagePad
|
||||||
import mogo_msg.MogoReportMsg
|
import mogo_msg.MogoReportMsg
|
||||||
|
import vllm.Vlm
|
||||||
import java.io.BufferedReader
|
import java.io.BufferedReader
|
||||||
|
import java.io.ByteArrayOutputStream
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.FileInputStream
|
import java.io.FileInputStream
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.io.InputStreamReader
|
import java.io.InputStreamReader
|
||||||
|
|
||||||
|
|
||||||
object DebugDataDispatch {
|
object DebugDataDispatch {
|
||||||
|
|
||||||
const val TAG = "DebugDataDispatch"
|
const val TAG = "DebugDataDispatch"
|
||||||
@@ -73,6 +78,8 @@ object DebugDataDispatch {
|
|||||||
const val ota = "ota"
|
const val ota = "ota"
|
||||||
const val video = "video"
|
const val video = "video"
|
||||||
const val mediaMusic = "mediaAndMusic"
|
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 "location" --es path "1111/11111"
|
||||||
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "globalPath" --es path "sy73.json"
|
// 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 "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 "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 "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 =
|
val ROOT_PATH =
|
||||||
@@ -102,6 +110,25 @@ object DebugDataDispatch {
|
|||||||
|
|
||||||
}
|
}
|
||||||
when (type) {
|
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 -> {
|
mediaMusic -> {
|
||||||
val musicList = MediaBeanManager.getMusicList()
|
val musicList = MediaBeanManager.getMusicList()
|
||||||
val mediaList = MediaBeanManager.getMediaList()
|
val mediaList = MediaBeanManager.getMediaList()
|
||||||
|
|||||||
BIN
OCH/common/common/src/debug/res/drawable/common_debug.webp
Normal file
BIN
OCH/common/common/src/debug/res/drawable/common_debug.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 182 KiB |
@@ -1,6 +1,8 @@
|
|||||||
package com.mogo.och.common.module.biz.birdge
|
package com.mogo.och.common.module.biz.birdge
|
||||||
|
|
||||||
import com.mogo.eagle.core.data.map.MogoLocation
|
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 {
|
interface BridgeListener {
|
||||||
/**
|
/**
|
||||||
@@ -15,4 +17,9 @@ interface BridgeListener {
|
|||||||
fun onTrajectoryDistanceListener(distance: Double){}
|
fun onTrajectoryDistanceListener(distance: Double){}
|
||||||
|
|
||||||
fun onTrajectoryPointsAndDistanceListener(trajectoryList: MutableList<MogoLocation>,distance: Double){}
|
fun onTrajectoryPointsAndDistanceListener(trajectoryList: MutableList<MogoLocation>,distance: Double){}
|
||||||
|
|
||||||
|
|
||||||
|
fun onVlmDataListener(vlmData: VlmData){}
|
||||||
|
|
||||||
|
fun onNdeDataListener(title: String, desc: String, sortedList: List<RoadMsg>) {}
|
||||||
}
|
}
|
||||||
@@ -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// 是否有车龙,代表拥堵、行驶缓慢
|
||||||
|
)
|
||||||
@@ -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)"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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.kotlin.onClick
|
||||||
import com.mogo.eagle.core.utilcode.util.AppUtils
|
import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||||
import com.mogo.eagle.core.utilcode.util.UriUtils
|
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.biz.media.MediaManager
|
||||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||||
import com.mogo.och.common.module.manager.transform.OchTransform
|
import com.mogo.och.common.module.manager.transform.OchTransform
|
||||||
@@ -126,11 +127,11 @@ class PM2BaseFragment :
|
|||||||
CallerMapRoadListenerManager.invokeCrossDevice(true)
|
CallerMapRoadListenerManager.invokeCrossDevice(true)
|
||||||
}
|
}
|
||||||
test3.onClick {
|
test3.onClick {
|
||||||
val one = AIMessage.RoadMsg(201,1,true,false)
|
val one = RoadMsg(201,1,true,false)
|
||||||
val two = AIMessage.RoadMsg(202,2,false,false)
|
val two = RoadMsg(202,2,false,false)
|
||||||
val three = AIMessage.RoadMsg(203,3,false,true)
|
val three = RoadMsg(203,3,false,true)
|
||||||
|
|
||||||
val sortedList = ArrayList<AIMessage.RoadMsg>()
|
val sortedList = ArrayList<RoadMsg>()
|
||||||
sortedList.add(one)
|
sortedList.add(one)
|
||||||
sortedList.add(two)
|
sortedList.add(two)
|
||||||
sortedList.add(three)
|
sortedList.add(three)
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ import android.widget.TextView
|
|||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
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.R
|
||||||
import com.mogo.och.shuttle.weaknet.passenger.ui.mind.bean.AIMessage
|
|
||||||
|
|
||||||
class AINDERoadAdapter(private val context: Context): RecyclerView.Adapter<AINDERoadAdapter.AIRoadHolder>() {
|
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
|
roadList = list
|
||||||
notifyDataSetChanged()
|
notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.mogo.och.shuttle.weaknet.passenger.ui.mind.bean
|
|||||||
import android.os.CountDownTimer
|
import android.os.CountDownTimer
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import com.mogo.eagle.core.data.v2x.RoadV2NEventType
|
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
|
import kotlin.math.floor
|
||||||
|
|
||||||
|
|
||||||
@@ -175,11 +177,11 @@ sealed class AIMessage(
|
|||||||
var roadList: List<RoadMsg>
|
var roadList: List<RoadMsg>
|
||||||
): AIMessage(id,title)
|
): AIMessage(id,title)
|
||||||
|
|
||||||
data class RoadMsg(
|
data class AiVlmData(
|
||||||
var arrowType: Int, // 车道类型,如直行201(详情参考文件:message_pad.proto)
|
override val id: String,
|
||||||
var laneNum: Int,// 车道号
|
override val title: String,
|
||||||
var isRecommend: Boolean,// 是否是推荐车道
|
var desc: String,
|
||||||
var isCheLong: Boolean// 是否有车龙,代表拥堵、行驶缓慢
|
var vlmData: VlmData
|
||||||
)
|
):AIMessage(id,title)
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3,85 +3,33 @@ package com.mogo.och.shuttle.weaknet.passenger.ui.mind.data
|
|||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
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.AIMessageManager
|
||||||
import com.mogo.och.shuttle.weaknet.passenger.ui.mind.bean.AIMessage
|
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{
|
companion object{
|
||||||
private const val TAG = "NDEViewModel"
|
private const val TAG = "NDEViewModel"
|
||||||
}
|
}
|
||||||
|
|
||||||
private var lastMap2 = HashMap<Int, String>()
|
|
||||||
private var lastTime = 0L
|
|
||||||
|
|
||||||
fun init(){
|
fun init(){
|
||||||
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
|
BridgeManager.addBridgeListener(TAG,this)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onAutopilotIdentifyDataUpdate(trafficData: List<TrackedObject>?){
|
override fun onCleared() {
|
||||||
super.onAutopilotIdentifyDataUpdate(trafficData)
|
super.onCleared()
|
||||||
handleCheLong(trafficData)
|
BridgeManager.removeBridgeListener(TAG)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleCheLong(trafficData: List<TrackedObject>?) {
|
override fun onNdeDataListener(title: String, desc: String, sortedList: List<RoadMsg>) {
|
||||||
var hasCheLong = false
|
val ndeEvent = AIMessage.NDEData(System.currentTimeMillis().toString(),title,desc,sortedList)
|
||||||
var isNewData = false
|
AIMessageManager.post(ndeEvent)
|
||||||
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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -45,6 +45,7 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.BusPassengerMsgBoxBubbleView
|
<com.mogo.eagle.core.function.hmi.ui.msgbox.BusPassengerMsgBoxBubbleView
|
||||||
|
android:id="@+id/bpmsgBubble"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
@@ -61,6 +62,16 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.v2n.RoadV2NEventWindowView
|
||||||
|
android:id="@+id/roadV2NEventWindowView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="-70dp"
|
||||||
|
android:layout_marginRight="14dp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/bpmsgBubble"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<com.mogo.och.common.module.wigets.LoadingMapStatusView
|
<com.mogo.och.common.module.wigets.LoadingMapStatusView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"/>
|
android:layout_height="match_parent"/>
|
||||||
|
|||||||
@@ -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.OnItemClickListener
|
||||||
import com.mogo.och.unmanned.passenger.ui.aiview.adapter.PaddingItemDecoration
|
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.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 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.aiMotionLayout
|
||||||
import kotlinx.android.synthetic.main.taxt_p_ai.view.ivIcon
|
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 viewModel:AIViewModel?=null
|
||||||
// private var pncActionsModel:PNCActionsViewModel ?= null
|
private var roadV2NEventModel: RoadV2NEventViewModel?= null
|
||||||
private var roadV2NEventModel:RoadV2NEventViewModel ?= null
|
private var roadCrossRoamModel: RoadCrossRoamViewModel?= null
|
||||||
private var roadCrossRoamModel:RoadCrossRoamViewModel ?= null
|
private var automaticExplorationModel: AutomaticExplorationViewModel?= null
|
||||||
private var automaticExplorationModel:AutomaticExplorationViewModel ?= null
|
private var ndeViewModel: NDEViewModel?= null
|
||||||
private var ndeViewModel: NDEViewModel ?= null
|
|
||||||
|
|
||||||
private var aiAnimator: BigFrameAnimatorContainer?=null
|
private var aiAnimator: BigFrameAnimatorContainer?=null
|
||||||
private var aiAnimatorBg: BigFrameAnimatorContainer?=null
|
private var aiAnimatorBg: BigFrameAnimatorContainer?=null
|
||||||
@@ -105,7 +108,6 @@ class AiView @JvmOverloads constructor(
|
|||||||
if(aiAnimator==null) {
|
if(aiAnimator==null) {
|
||||||
aiAnimator = BigFrameAnimatorContainer(R.array.ai_animator, 31, ivIcon)
|
aiAnimator = BigFrameAnimatorContainer(R.array.ai_animator, 31, ivIcon)
|
||||||
}
|
}
|
||||||
// aiAnimator?.start()
|
|
||||||
|
|
||||||
ivIcon.onClick {
|
ivIcon.onClick {
|
||||||
viewModel?.onWakeUp()
|
viewModel?.onWakeUp()
|
||||||
|
|||||||
@@ -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_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_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_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")
|
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.AutomaticExploration -> AIMessage.TYPE_AUTOMATIC_EXPLORATION
|
||||||
is AIMessage.EvaluateData -> AIMessage.TYPE_EVALUATE
|
is AIMessage.EvaluateData -> AIMessage.TYPE_EVALUATE
|
||||||
is AIMessage.NDEData -> AIMessage.TYPE_NDE
|
is AIMessage.NDEData -> AIMessage.TYPE_NDE
|
||||||
|
is AIMessage.AiVlmData -> AIMessage.TYPE_VLM
|
||||||
else -> AIMessage.TYPE_EVENT
|
else -> AIMessage.TYPE_EVENT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import android.animation.ObjectAnimator
|
|||||||
import android.animation.ValueAnimator
|
import android.animation.ValueAnimator
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Rect
|
import android.graphics.Rect
|
||||||
import android.text.TextUtils
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.animation.LinearInterpolator
|
import android.view.animation.LinearInterpolator
|
||||||
@@ -14,6 +13,7 @@ import android.widget.FrameLayout
|
|||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
|
import androidx.appcompat.widget.AppCompatImageView
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.graphics.toColorInt
|
import androidx.core.graphics.toColorInt
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
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.MapRoamView
|
||||||
import com.mogo.eagle.core.function.view.RoadCrossRoamListAdapter
|
import com.mogo.eagle.core.function.view.RoadCrossRoamListAdapter
|
||||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
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.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.mogo.imageloader.MogoImageView
|
||||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils
|
import com.mogo.eagle.core.utilcode.util.DateTimeUtils
|
||||||
import com.mogo.och.common.module.utils.FrameAnimatorContainer
|
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.Banner
|
||||||
import com.youth.banner.indicator.CircleIndicator
|
import com.youth.banner.indicator.CircleIndicator
|
||||||
import com.youth.banner.transformer.ScaleInTransformer
|
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.text.SimpleDateFormat
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
@@ -85,6 +85,23 @@ abstract class MessageViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
|||||||
.placeholder(R.drawable.icon_pic_holder)
|
.placeholder(R.drawable.icon_pic_holder)
|
||||||
.error(R.drawable.icon_pic_error)
|
.error(R.drawable.icon_pic_error)
|
||||||
// .error(R.drawable.icon_marker_window_place_holder)
|
// .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)
|
// .placeholder(R.drawable.icon_marker_window_place_holder)
|
||||||
.into(this)
|
.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) {
|
private class NoScrollLayoutManager(context: Context?) : LinearLayoutManager(context) {
|
||||||
override fun canScrollVertically(): Boolean {
|
override fun canScrollVertically(): Boolean {
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ import android.widget.TextView
|
|||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
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
|
import com.mogo.och.unmanned.taxi.passenger.R
|
||||||
|
|
||||||
class AINDERoadAdapter(private val context: Context): RecyclerView.Adapter<AINDERoadAdapter.AIRoadHolder>() {
|
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
|
roadList = list
|
||||||
notifyDataSetChanged()
|
notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.mogo.och.unmanned.passenger.ui.aiview.bean
|
|||||||
import android.os.CountDownTimer
|
import android.os.CountDownTimer
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import com.mogo.eagle.core.data.v2x.RoadV2NEventType
|
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
|
import kotlin.math.floor
|
||||||
|
|
||||||
|
|
||||||
@@ -27,6 +29,7 @@ sealed class AIMessage(
|
|||||||
const val TYPE_AUTOMATIC_EXPLORATION = 9
|
const val TYPE_AUTOMATIC_EXPLORATION = 9
|
||||||
const val TYPE_EVALUATE = 10
|
const val TYPE_EVALUATE = 10
|
||||||
const val TYPE_NDE = 11
|
const val TYPE_NDE = 11
|
||||||
|
const val TYPE_VLM = 12
|
||||||
}
|
}
|
||||||
|
|
||||||
data class Scan(
|
data class Scan(
|
||||||
@@ -177,11 +180,11 @@ sealed class AIMessage(
|
|||||||
var roadList: List<RoadMsg>
|
var roadList: List<RoadMsg>
|
||||||
):AIMessage(id,title)
|
):AIMessage(id,title)
|
||||||
|
|
||||||
data class RoadMsg(
|
data class AiVlmData(
|
||||||
var arrowType: Int, // 车道类型,如直行201(详情参考文件:message_pad.proto)
|
override val id: String,
|
||||||
var laneNum: Int,// 车道号
|
override val title: String,
|
||||||
var isRecommend: Boolean,// 是否是推荐车道
|
var desc: String,
|
||||||
var isCheLong: Boolean// 是否有车龙,代表拥堵、行驶缓慢
|
var vlmData: VlmData
|
||||||
)
|
):AIMessage(id,title)
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -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 android.os.CountDownTimer
|
||||||
import androidx.lifecycle.ViewModel
|
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.function.call.msgbox.CallerMsgBoxListenerManager
|
||||||
import com.mogo.eagle.core.utilcode.util.StringUtils
|
import com.mogo.eagle.core.utilcode.util.StringUtils
|
||||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
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.IDistanceListener
|
||||||
import com.mogo.och.bridge.distance.TrajectoryAndDistanceManager
|
import com.mogo.och.bridge.distance.TrajectoryAndDistanceManager
|
||||||
import com.mogo.och.data.taxi.BaseOrderBean
|
import com.mogo.och.data.taxi.BaseOrderBean
|
||||||
import com.mogo.och.data.taxi.TaxiOrderStatusEnum
|
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.passenger.ui.aiview.bean.AIMessage
|
||||||
import com.mogo.och.unmanned.taxi.utils.order.OrderListener
|
import com.mogo.och.unmanned.taxi.utils.order.OrderListener
|
||||||
import com.mogo.och.unmanned.taxi.utils.order.OrderModel
|
import com.mogo.och.unmanned.taxi.utils.order.OrderModel
|
||||||
@@ -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)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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 androidx.lifecycle.ViewModel
|
||||||
import com.mogo.eagle.core.data.autopilot.pnc.PncActionsHelper
|
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.api.autopilot.IMoGoAutopilotStatusListener
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager
|
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.common.module.manager.loop.BizLoopManager
|
||||||
import com.mogo.och.unmanned.passenger.model.TaxiPassengerModel
|
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 com.mogo.och.unmanned.passenger.ui.aiview.bean.AIMessage
|
||||||
import mogo.telematics.pad.MessagePad
|
import mogo.telematics.pad.MessagePad
|
||||||
|
|
||||||
@@ -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.content.Context
|
||||||
import android.view.View
|
|
||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import com.mogo.commons.voice.AIAssist
|
import com.mogo.commons.voice.AIAssist
|
||||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
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.AppIdentityModeUtils
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
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
|
import com.mogo.och.unmanned.passenger.ui.aiview.bean.AIMessage
|
||||||
|
|
||||||
class RoadCrossRoamViewModel: ViewModel(), IMoGoMapRoadListener {
|
class RoadCrossRoamViewModel: ViewModel(), IMoGoMapRoadListener {
|
||||||
@@ -67,7 +67,7 @@ class RoadCrossRoamViewModel: ViewModel(), IMoGoMapRoadListener {
|
|||||||
AIAssist.getInstance(mContext).speakTTSVoiceWithLevel(disStr, AIAssist.NEW_LEVEL_2)
|
AIAssist.getInstance(mContext).speakTTSVoiceWithLevel(disStr, AIAssist.NEW_LEVEL_2)
|
||||||
}
|
}
|
||||||
CallerServicesEventManager.updateServicesNum(CallerServicesEventManager.ServiceType.ROAD)
|
CallerServicesEventManager.updateServicesNum(CallerServicesEventManager.ServiceType.ROAD)
|
||||||
AIMessageManager.post(AIMessage.RoadCrossRoam(System.currentTimeMillis().toString(),""))
|
AIMessageManager.post(AIMessage.RoadCrossRoam(System.currentTimeMillis().toString(), ""))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -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.ProcessLifecycleOwner
|
||||||
import androidx.lifecycle.ViewModel
|
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.call.hmi.CallerRoadV2NEventWindowListenerManager
|
||||||
import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog
|
import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
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 com.mogo.och.unmanned.passenger.ui.aiview.bean.AIMessage
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
@@ -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>
|
||||||
@@ -88,5 +88,7 @@ dependencies {
|
|||||||
implementation("org.connectbot:jbcrypt:1.0.2")
|
implementation("org.connectbot:jbcrypt:1.0.2")
|
||||||
//----------------SSH end---------------------
|
//----------------SSH end---------------------
|
||||||
implementation 'org.conscrypt:conscrypt-android:2.5.2'
|
implementation 'org.conscrypt:conscrypt-android:2.5.2'
|
||||||
|
|
||||||
|
implementation 'com.belerweb:pinyin4j:2.5.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,16 @@
|
|||||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
|
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".ui.activity.AutopilotCheckAct"
|
||||||
|
android:configChanges="orientation|screenSize|keyboardHidden"
|
||||||
|
android:exported="true"
|
||||||
|
android:label="自动驾驶检测"
|
||||||
|
android:launchMode="singleTop"
|
||||||
|
android:screenOrientation="landscape"
|
||||||
|
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
|
||||||
<!-- 故障码数据库更新服务 -->
|
<!-- 故障码数据库更新服务 -->
|
||||||
<service android:name=".service.FmCodeUpdateService" />
|
<service android:name=".service.FmCodeUpdateService" />
|
||||||
<service android:name=".service.FaultManagementDiagnosisService" />
|
<service android:name=".service.FaultManagementDiagnosisService" />
|
||||||
|
|||||||
@@ -75,8 +75,8 @@ class SelectAutopilotLineDialog(context: Context) : Dialog(context), LifecycleOw
|
|||||||
val divider = DividerItemDecoration(context, linearLayoutManager.orientation)
|
val divider = DividerItemDecoration(context, linearLayoutManager.orientation)
|
||||||
rvLineList.addItemDecoration(divider)
|
rvLineList.addItemDecoration(divider)
|
||||||
val params: WindowManager.LayoutParams = window!!.attributes
|
val params: WindowManager.LayoutParams = window!!.attributes
|
||||||
params.width = WindowUtils.dip2px(context,context.resources.getDimension(R.dimen.dp_280))
|
params.width = WindowUtils.dip2px(context,context.resources.getDimension(R.dimen.dp_1200))
|
||||||
params.height = WindowUtils.dip2px(context,context.resources.getDimension(R.dimen.dp_250))
|
params.height = WindowUtils.dip2px(context,context.resources.getDimension(R.dimen.dp_1000))
|
||||||
window?.attributes = params
|
window?.attributes = params
|
||||||
window?.setBackgroundDrawable(null)
|
window?.setBackgroundDrawable(null)
|
||||||
initEvent()
|
initEvent()
|
||||||
@@ -108,28 +108,28 @@ class SelectAutopilotLineDialog(context: Context) : Dialog(context), LifecycleOw
|
|||||||
|
|
||||||
// 处理Taxi
|
// 处理Taxi
|
||||||
// 处理BUS包含:JV、KW、FT、SW
|
// 处理BUS包含:JV、KW、FT、SW
|
||||||
// CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().cityCode?.let {
|
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().cityCode?.let {
|
||||||
// TrajectoryApiClient.queryTrajectoryList(
|
TrajectoryApiClient.queryTrajectoryList(
|
||||||
// this,
|
this,
|
||||||
// VehicleConfigData.getCarType().name,
|
VehicleConfigData.getCarType().name,
|
||||||
// it,
|
it,
|
||||||
// object :
|
object :
|
||||||
// NetworkCallback<ArrayList<TrajectoryListInfo>> {
|
NetworkCallback<ArrayList<TrajectoryListInfo>> {
|
||||||
// override fun onSuccess(data: ArrayList<TrajectoryListInfo>) {
|
override fun onSuccess(data: ArrayList<TrajectoryListInfo>) {
|
||||||
// setSelectLineData(data)
|
setSelectLineData(data)
|
||||||
// tvLoading.hide()
|
tvLoading.hide()
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// override fun onError(msg: String) {
|
override fun onError(msg: String) {
|
||||||
// ToastUtils.showLong("获取 Bus 站点列表异常,异常原因:${msg}")
|
ToastUtils.showLong("获取 Bus 站点列表异常,异常原因:${msg}")
|
||||||
// tvLoading.show("获取 Bus 站点列表异常")
|
tvLoading.show("获取 Bus 站点列表异常")
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// )
|
)
|
||||||
// } ?: let {
|
} ?: let {
|
||||||
// ToastUtils.showLong("获取 Bus 站点列表异常,获取当前未知失败,请开启定位权限")
|
ToastUtils.showLong("获取 Bus 站点列表异常,获取当前未知失败,请开启定位权限")
|
||||||
// tvLoading.show("获取 Bus 站点列表异常,请开启定位权限")
|
tvLoading.show("获取 Bus 站点列表异常,请开启定位权限")
|
||||||
// }
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//取消
|
//取消
|
||||||
@@ -186,6 +186,7 @@ class SelectAutopilotLineDialog(context: Context) : Dialog(context), LifecycleOw
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun dismiss() {
|
override fun dismiss() {
|
||||||
|
mLifecycleRegistry.currentState = Lifecycle.State.DESTROYED
|
||||||
scopeQueryTrajectoryList.cancel()
|
scopeQueryTrajectoryList.cancel()
|
||||||
mActivity = null
|
mActivity = null
|
||||||
super.dismiss()
|
super.dismiss()
|
||||||
@@ -198,7 +199,7 @@ class SelectAutopilotLineDialog(context: Context) : Dialog(context), LifecycleOw
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun getLifecycle(): Lifecycle {
|
override fun getLifecycle(): Lifecycle {
|
||||||
return lifecycle
|
return mLifecycleRegistry
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import com.mogo.eagle.core.data.EnvConfig
|
|||||||
|
|
||||||
object MisHost {
|
object MisHost {
|
||||||
private const val HOST_QA = "https://eagle-qa.zhidaozhixing.com/"
|
private const val HOST_QA = "https://eagle-qa.zhidaozhixing.com/"
|
||||||
private const val HOST_RELEASE = "https://eagle-mis-v6.zhidaozhixing.com/"
|
private const val HOST_RELEASE = "https://eagle-mis.zhidaozhixing.com/"
|
||||||
|
|
||||||
private const val LOGIN_HOST_QA =
|
private const val LOGIN_HOST_QA =
|
||||||
"https://carlife-test.zhidaohulian.com/qa/eagle/login/index.html?deviceId="
|
"https://carlife-test.zhidaohulian.com/qa/eagle/login/index.html?deviceId="
|
||||||
|
|||||||
@@ -17,119 +17,119 @@ object TrajectoryApiClient {
|
|||||||
private val apiService: TrajectoryApiService =
|
private val apiService: TrajectoryApiService =
|
||||||
NetworkManager.getInstance().createService(TrajectoryApiService::class.java, baseUrl)
|
NetworkManager.getInstance().createService(TrajectoryApiService::class.java, baseUrl)
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * 查询 Bus&Taxi 有轨迹的QA线路列表
|
* 查询 Bus&Taxi 有轨迹的QA线路列表
|
||||||
// */
|
*/
|
||||||
// fun queryTrajectoryList(
|
fun queryTrajectoryList(
|
||||||
// owner: LifecycleOwner,
|
owner: LifecycleOwner,
|
||||||
// carType: String,
|
carType: String,
|
||||||
// cityCode: String,
|
cityCode: String,
|
||||||
// callback: NetworkCallback<ArrayList<TrajectoryListInfo>>
|
callback: NetworkCallback<ArrayList<TrajectoryListInfo>>
|
||||||
// ) {
|
) {
|
||||||
// val reqBody = TrajectoryLisReq()
|
val reqBody = TrajectoryLisReq()
|
||||||
// reqBody.page = 1
|
reqBody.page = 1
|
||||||
// reqBody.pageSize = 1000
|
reqBody.pageSize = 1000
|
||||||
// reqBody.cityCode = cityCode
|
reqBody.cityCode = cityCode
|
||||||
//
|
|
||||||
// val observable = if (carType == "TAXI") {
|
val observable = if (carType == "TAXI") {
|
||||||
// apiService.queryTaxiTrajectoryList(reqBody)
|
apiService.queryTaxiTrajectoryList(reqBody)
|
||||||
// } else {
|
} else {
|
||||||
// apiService.queryBusTrajectoryList(reqBody)
|
apiService.queryBusTrajectoryList(reqBody)
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// NetworkManager.getInstance()
|
NetworkManager.getInstance()
|
||||||
// .sendRequest(
|
.sendRequest(
|
||||||
// observable,
|
observable,
|
||||||
// owner,
|
owner,
|
||||||
// object :
|
object :
|
||||||
// NetworkManager.NetworkCallback<BaseResponse<ArrayList<TrajectoryListInfo>>> {
|
NetworkManager.NetworkCallback<BaseResponse<ArrayList<TrajectoryListInfo>>> {
|
||||||
// override fun onSuccess(response: BaseResponse<ArrayList<TrajectoryListInfo>>?) {
|
override fun onSuccess(response: BaseResponse<ArrayList<TrajectoryListInfo>>?) {
|
||||||
// Log.d(TAG, "查询 $carType 有轨迹的QA线路列表:$response")
|
Log.d(TAG, "查询 $carType 有轨迹的QA线路列表:$response")
|
||||||
// // 处理网络请求成功的响应
|
// 处理网络请求成功的响应
|
||||||
// response?.result?.let { callback.onSuccess(it) }
|
response?.result?.let { callback.onSuccess(it) }
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// override fun onError(throwable: String) {
|
override fun onError(throwable: String) {
|
||||||
// Log.e(TAG, "查询 $carType 有轨迹的QA线路列表:$throwable")
|
Log.e(TAG, "查询 $carType 有轨迹的QA线路列表:$throwable")
|
||||||
// // 处理网络请求失败的情况
|
// 处理网络请求失败的情况
|
||||||
// callback.onError(throwable)
|
callback.onError(throwable)
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// )
|
)
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * 查询 Bus&Taxi 线路对应的站点
|
* 查询 Bus&Taxi 线路对应的站点
|
||||||
// */
|
*/
|
||||||
// fun querySiteList(
|
fun querySiteList(
|
||||||
// owner: LifecycleOwner,
|
owner: LifecycleOwner,
|
||||||
// carType: String,
|
carType: String,
|
||||||
// lineId: Int,
|
lineId: Int,
|
||||||
// callback: NetworkCallback<ArrayList<TrajectorySiteInfo>>
|
callback: NetworkCallback<ArrayList<TrajectorySiteInfo>>
|
||||||
// ) {
|
) {
|
||||||
// val observable = if (carType == "TAXI") {
|
val observable = if (carType == "TAXI") {
|
||||||
// apiService.queryTaxiSiteList(lineId)
|
apiService.queryTaxiSiteList(lineId)
|
||||||
// } else {
|
} else {
|
||||||
// apiService.queryBusSiteList(lineId)
|
apiService.queryBusSiteList(lineId)
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// NetworkManager.getInstance()
|
NetworkManager.getInstance()
|
||||||
// .sendRequest(
|
.sendRequest(
|
||||||
// observable,
|
observable,
|
||||||
// owner,
|
owner,
|
||||||
// object :
|
object :
|
||||||
// NetworkManager.NetworkCallback<BaseResponse<ArrayList<TrajectorySiteInfo>>> {
|
NetworkManager.NetworkCallback<BaseResponse<ArrayList<TrajectorySiteInfo>>> {
|
||||||
// override fun onSuccess(response: BaseResponse<ArrayList<TrajectorySiteInfo>>?) {
|
override fun onSuccess(response: BaseResponse<ArrayList<TrajectorySiteInfo>>?) {
|
||||||
// Log.d(TAG, "查询 $carType 线路对应的站点:$response")
|
Log.d(TAG, "查询 $carType 线路对应的站点:$response")
|
||||||
// // 处理网络请求成功的响应
|
// 处理网络请求成功的响应
|
||||||
// response?.result?.let { callback.onSuccess(it) }
|
response?.result?.let { callback.onSuccess(it) }
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// override fun onError(throwable: String) {
|
override fun onError(throwable: String) {
|
||||||
// Log.e(TAG, "查询 $carType 线路对应的站点:$throwable")
|
Log.e(TAG, "查询 $carType 线路对应的站点:$throwable")
|
||||||
// // 处理网络请求失败的情况
|
// 处理网络请求失败的情况
|
||||||
// callback.onError(throwable)
|
callback.onError(throwable)
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// )
|
)
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * 查询 Bus&Taxi 线路对应的轨迹
|
* 查询 Bus&Taxi 线路对应的轨迹
|
||||||
// */
|
*/
|
||||||
// fun queryTrajectoryInfo(
|
fun queryTrajectoryInfo(
|
||||||
// owner: LifecycleOwner,
|
owner: LifecycleOwner,
|
||||||
// carType: String,
|
carType: String,
|
||||||
// reqBody: TrajectoryInfoReq,
|
reqBody: TrajectoryInfoReq,
|
||||||
// callback: NetworkCallback<TrajectoryInfo>
|
callback: NetworkCallback<TrajectoryInfo>
|
||||||
// ) {
|
) {
|
||||||
//
|
|
||||||
// val observable = if (carType == "TAXI") {
|
val observable = if (carType == "TAXI") {
|
||||||
// apiService.queryTaxiTrajectoryInfo(reqBody)
|
apiService.queryTaxiTrajectoryInfo(reqBody)
|
||||||
// } else {
|
} else {
|
||||||
// apiService.queryBusTrajectoryInfo(reqBody)
|
apiService.queryBusTrajectoryInfo(reqBody)
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// NetworkManager.getInstance()
|
NetworkManager.getInstance()
|
||||||
// .sendRequest(
|
.sendRequest(
|
||||||
// observable,
|
observable,
|
||||||
// owner,
|
owner,
|
||||||
// object :
|
object :
|
||||||
// NetworkManager.NetworkCallback<BaseResponse<TrajectoryInfo>> {
|
NetworkManager.NetworkCallback<BaseResponse<TrajectoryInfo>> {
|
||||||
// override fun onSuccess(response: BaseResponse<TrajectoryInfo>?) {
|
override fun onSuccess(response: BaseResponse<TrajectoryInfo>?) {
|
||||||
// Log.d(TAG, "查询 $carType 线路对应的轨迹:$response")
|
Log.d(TAG, "查询 $carType 线路对应的轨迹:$response")
|
||||||
// // 处理网络请求成功的响应
|
// 处理网络请求成功的响应
|
||||||
// response?.result?.let { callback.onSuccess(it) }
|
response?.result?.let { callback.onSuccess(it) }
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// override fun onError(throwable: String) {
|
override fun onError(throwable: String) {
|
||||||
// Log.e(TAG, "查询 $carType 线路对应的轨迹:$throwable")
|
Log.e(TAG, "查询 $carType 线路对应的轨迹:$throwable")
|
||||||
// // 处理网络请求失败的情况
|
// 处理网络请求失败的情况
|
||||||
// callback.onError(throwable)
|
callback.onError(throwable)
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// )
|
)
|
||||||
// }
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
package com.mogo.module.common.net.mis.trajectory.net
|
package com.mogo.module.common.net.mis.trajectory.net
|
||||||
|
|
||||||
|
|
||||||
import com.mogo.eagle.core.data.BaseResponse
|
|
||||||
import com.zhjt.mogo_core_function_devatools.rviz.bean.TrajectoryInfo
|
import com.zhjt.mogo_core_function_devatools.rviz.bean.TrajectoryInfo
|
||||||
import com.zhjt.mogo_core_function_devatools.rviz.bean.TrajectoryInfoReq
|
import com.zhjt.mogo_core_function_devatools.rviz.bean.TrajectoryInfoReq
|
||||||
import com.zhjt.mogo_core_function_devatools.rviz.bean.TrajectoryLisReq
|
import com.zhjt.mogo_core_function_devatools.rviz.bean.TrajectoryLisReq
|
||||||
import com.zhjt.mogo_core_function_devatools.rviz.bean.TrajectoryListInfo
|
import com.zhjt.mogo_core_function_devatools.rviz.bean.TrajectoryListInfo
|
||||||
import com.zhjt.mogo_core_function_devatools.rviz.bean.TrajectorySiteInfo
|
import com.zhjt.mogo_core_function_devatools.rviz.bean.TrajectorySiteInfo
|
||||||
|
import com.zhjt.mogo_core_function_devatools.rviz.net.BaseResponse
|
||||||
import io.reactivex.Observable
|
import io.reactivex.Observable
|
||||||
import retrofit2.http.Body
|
import retrofit2.http.Body
|
||||||
import retrofit2.http.GET
|
import retrofit2.http.GET
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.zhjt.mogo_core_function_devatools.rviz.ui.activity
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import com.zhjt.mogo_core_function_devatools.rviz.R
|
||||||
|
import com.zhjt.mogo_core_function_devatools.rviz.common.base.BaseActivity
|
||||||
|
import kotlinx.android.synthetic.main.layout_autopilot_check.viewCheckAutopilot
|
||||||
|
|
||||||
|
class AutopilotCheckAct: BaseActivity() {
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?){
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
setContentView(R.layout.layout_autopilot_check)
|
||||||
|
viewCheckAutopilot.setActivity(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,31 @@
|
|||||||
|
package com.zhjt.mogo_core_function_devatools.rviz.utils;
|
||||||
|
|
||||||
|
import net.sourceforge.pinyin4j.PinyinHelper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: wangmingjun
|
||||||
|
* @date: 2021/11/26
|
||||||
|
*/
|
||||||
|
public class PinYinUtil {
|
||||||
|
/**
|
||||||
|
* 得到中文字符串首字母
|
||||||
|
* @param str 需要转化的中文字符串
|
||||||
|
* @return 大写首字母缩写的字符串
|
||||||
|
*/
|
||||||
|
public static String getPinYinHeadChar(String str) {
|
||||||
|
str = str.replaceAll("[\\p{P}‘’“”|+=¥$<>^~~]", "");
|
||||||
|
StringBuilder convert = new StringBuilder();
|
||||||
|
for (int j = 0; j < str.length(); j++) {
|
||||||
|
char word = str.charAt(j);
|
||||||
|
String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(word);
|
||||||
|
if (pinyinArray != null) {
|
||||||
|
convert.append(pinyinArray[0].charAt(0));
|
||||||
|
} else {
|
||||||
|
if (!"".equals(String.valueOf(word).trim())){
|
||||||
|
convert.append(word);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return convert.toString().trim().toUpperCase();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,10 +9,10 @@
|
|||||||
android:id="@+id/tvSelectLineTitle"
|
android:id="@+id/tvSelectLineTitle"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="@dimen/dp_15"
|
android:layout_margin="@dimen/dp_30"
|
||||||
android:text="请选择自动驾驶路线"
|
android:text="请选择自动驾驶路线"
|
||||||
android:textColor="#FFFFFFFF"
|
android:textColor="#FFFFFFFF"
|
||||||
android:textSize="@dimen/sp_18"
|
android:textSize="@dimen/sp_36"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -33,8 +33,8 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ivSearch"
|
android:id="@+id/ivSearch"
|
||||||
android:layout_width="@dimen/dp_25"
|
android:layout_width="@dimen/dp_50"
|
||||||
android:layout_height="@dimen/dp_25"
|
android:layout_height="@dimen/dp_50"
|
||||||
android:layout_marginEnd="@dimen/dp_15"
|
android:layout_marginEnd="@dimen/dp_15"
|
||||||
android:src="@drawable/icon_line_search"
|
android:src="@drawable/icon_line_search"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
android:hint="自动驾驶路线搜索"
|
android:hint="自动驾驶路线搜索"
|
||||||
android:textColor="#FFFFFFFF"
|
android:textColor="#FFFFFFFF"
|
||||||
android:textColorHint="#B3FFFFFF"
|
android:textColorHint="#B3FFFFFF"
|
||||||
android:textSize="@dimen/sp_16"
|
android:textSize="@dimen/sp_32"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintRight_toLeftOf="@id/ivSearch"
|
app:layout_constraintRight_toLeftOf="@id/ivSearch"
|
||||||
@@ -91,10 +91,10 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:padding="@dimen/dp_15"
|
android:padding="@dimen/dp_30"
|
||||||
android:text="取消"
|
android:text="取消"
|
||||||
android:textColor="#FFFFFFFF"
|
android:textColor="#FFFFFFFF"
|
||||||
android:textSize="@dimen/sp_18"
|
android:textSize="@dimen/sp_36"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintRight_toRightOf="parent" />
|
app:layout_constraintRight_toRightOf="parent" />
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="@dimen/sp_16"
|
android:textSize="@dimen/sp_32"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
android:padding="@dimen/dp_10"
|
android:padding="@dimen/dp_10"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -14,13 +14,13 @@
|
|||||||
android:layout_marginEnd="@dimen/dp_5"
|
android:layout_marginEnd="@dimen/dp_5"
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="@dimen/sp_12"
|
android:textSize="@dimen/sp_30"
|
||||||
tools:text="ReportMsg" />
|
tools:text="ReportMsg" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dp_1"
|
android:layout_height="@dimen/dp_1"
|
||||||
android:layout_marginStart="@dimen/dp_5"
|
android:layout_marginStart="@dimen/dp_15"
|
||||||
android:layout_marginEnd="@dimen/dp_5"
|
android:layout_marginEnd="@dimen/dp_15"
|
||||||
android:background="@color/white" />
|
android:background="@color/white" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.zhjt.mogo_core_function_devatools.rviz.ui.views.CheckAutopilotView
|
||||||
|
android:id="@+id/viewCheckAutopilot"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -17,12 +17,12 @@
|
|||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintBottom_toTopOf="@id/ivSpeedReduce"
|
app:layout_constraintBottom_toTopOf="@id/ivSpeedReduce"
|
||||||
android:text="请选择自动驾驶路线"
|
android:text="请选择自动驾驶路线"
|
||||||
android:padding="@dimen/dp_5"
|
android:padding="@dimen/dp_10"
|
||||||
android:textSize="@dimen/sp_18"
|
android:textSize="@dimen/sp_36"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
|
|
||||||
android:layout_margin="@dimen/dp_10"
|
android:layout_margin="@dimen/dp_20"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="车 速 设 置:"
|
android:text="车 速 设 置:"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="@dimen/sp_18"
|
android:textSize="@dimen/sp_36"
|
||||||
app:layout_constraintStart_toStartOf="@id/tvAutoDriveLineSelect"
|
app:layout_constraintStart_toStartOf="@id/tvAutoDriveLineSelect"
|
||||||
app:layout_constraintTop_toTopOf="@id/ivSpeedReduce"
|
app:layout_constraintTop_toTopOf="@id/ivSpeedReduce"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/ivSpeedReduce"
|
app:layout_constraintBottom_toBottomOf="@id/ivSpeedReduce"
|
||||||
@@ -39,8 +39,8 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ivSpeedReduce"
|
android:id="@+id/ivSpeedReduce"
|
||||||
android:layout_width="@dimen/dp_28"
|
android:layout_width="@dimen/dp_105"
|
||||||
android:layout_height="@dimen/dp_35"
|
android:layout_height="@dimen/dp_140"
|
||||||
android:layout_marginTop="@dimen/dp_10"
|
android:layout_marginTop="@dimen/dp_10"
|
||||||
android:src="@drawable/icon_speed_reduce"
|
android:src="@drawable/icon_speed_reduce"
|
||||||
app:layout_constraintStart_toEndOf="@id/tvSpeedTitle"
|
app:layout_constraintStart_toEndOf="@id/tvSpeedTitle"
|
||||||
@@ -51,14 +51,14 @@
|
|||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatEditText
|
<androidx.appcompat.widget.AppCompatEditText
|
||||||
android:id="@+id/etInputSpeed"
|
android:id="@+id/etInputSpeed"
|
||||||
android:layout_width="@dimen/dp_60"
|
android:layout_width="@dimen/dp_200"
|
||||||
android:layout_height="@dimen/dp_35"
|
android:layout_height="@dimen/dp_140"
|
||||||
app:layout_constraintTop_toTopOf="@id/ivSpeedReduce"
|
app:layout_constraintTop_toTopOf="@id/ivSpeedReduce"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/ivSpeedReduce"
|
app:layout_constraintBottom_toBottomOf="@id/ivSpeedReduce"
|
||||||
app:layout_constraintLeft_toRightOf="@id/ivSpeedReduce"
|
app:layout_constraintLeft_toRightOf="@id/ivSpeedReduce"
|
||||||
android:background="#1E3062"
|
android:background="#1E3062"
|
||||||
android:textColor="#FFFFFFFF"
|
android:textColor="#FFFFFFFF"
|
||||||
android:textSize="@dimen/sp_16"
|
android:textSize="@dimen/sp_32"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
tools:ignore="SpeakableTextPresentCheck"
|
tools:ignore="SpeakableTextPresentCheck"
|
||||||
android:focusableInTouchMode="false"
|
android:focusableInTouchMode="false"
|
||||||
@@ -66,8 +66,8 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ivSpeedAdd"
|
android:id="@+id/ivSpeedAdd"
|
||||||
android:layout_width="@dimen/dp_28"
|
android:layout_width="@dimen/dp_105"
|
||||||
android:layout_height="@dimen/dp_35"
|
android:layout_height="@dimen/dp_140"
|
||||||
app:layout_constraintTop_toTopOf="@id/etInputSpeed"
|
app:layout_constraintTop_toTopOf="@id/etInputSpeed"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/etInputSpeed"
|
app:layout_constraintBottom_toBottomOf="@id/etInputSpeed"
|
||||||
app:layout_constraintLeft_toRightOf="@id/etInputSpeed"
|
app:layout_constraintLeft_toRightOf="@id/etInputSpeed"
|
||||||
@@ -81,11 +81,11 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="km/h"
|
android:text="km/h"
|
||||||
android:textColor="#FFFFFFFF"
|
android:textColor="#FFFFFFFF"
|
||||||
android:textSize="@dimen/sp_18"
|
android:textSize="@dimen/sp_36"
|
||||||
app:layout_constraintTop_toTopOf="@id/ivSpeedAdd"
|
app:layout_constraintTop_toTopOf="@id/ivSpeedAdd"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/ivSpeedAdd"
|
app:layout_constraintBottom_toBottomOf="@id/ivSpeedAdd"
|
||||||
app:layout_constraintLeft_toRightOf="@id/ivSpeedAdd"
|
app:layout_constraintLeft_toRightOf="@id/ivSpeedAdd"
|
||||||
android:layout_marginStart="@dimen/dp_10" />
|
android:layout_marginStart="@dimen/dp_20" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/tvSureModify"
|
android:id="@+id/tvSureModify"
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="确定"
|
android:text="确定"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="@dimen/sp_18"
|
android:textSize="@dimen/sp_36"
|
||||||
android:paddingTop="@dimen/dp_5"
|
android:paddingTop="@dimen/dp_5"
|
||||||
android:paddingBottom="@dimen/dp_5"
|
android:paddingBottom="@dimen/dp_5"
|
||||||
android:paddingStart="@dimen/dp_20"
|
android:paddingStart="@dimen/dp_20"
|
||||||
@@ -116,9 +116,9 @@
|
|||||||
android:text="P"
|
android:text="P"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="@color/p_default_txt_color"
|
android:textColor="@color/p_default_txt_color"
|
||||||
android:textSize="@dimen/sp_20"
|
android:textSize="@dimen/sp_40"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:layout_marginStart="@dimen/dp_10"
|
android:layout_marginStart="@dimen/dp_20"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -131,9 +131,9 @@
|
|||||||
android:text="R"
|
android:text="R"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="@color/p_default_txt_color"
|
android:textColor="@color/p_default_txt_color"
|
||||||
android:textSize="@dimen/sp_20"
|
android:textSize="@dimen/sp_40"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:layout_marginStart="@dimen/dp_5"
|
android:layout_marginStart="@dimen/dp_20"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -146,9 +146,9 @@
|
|||||||
android:text="N"
|
android:text="N"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="@color/p_default_txt_color"
|
android:textColor="@color/p_default_txt_color"
|
||||||
android:textSize="@dimen/sp_20"
|
android:textSize="@dimen/sp_40"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:layout_marginStart="@dimen/dp_5"
|
android:layout_marginStart="@dimen/dp_20"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -161,40 +161,41 @@
|
|||||||
android:text="D"
|
android:text="D"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="@color/p_default_txt_color"
|
android:textColor="@color/p_default_txt_color"
|
||||||
android:textSize="@dimen/sp_20"
|
android:textSize="@dimen/sp_40"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:layout_marginStart="@dimen/dp_5"
|
android:layout_marginStart="@dimen/dp_20"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btnAutoPilotStatus"
|
android:id="@+id/btnAutoPilotStatus"
|
||||||
android:layout_width="@dimen/dp_120"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="@dimen/dp_35"
|
android:layout_height="wrap_content"
|
||||||
|
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
app:layout_constraintLeft_toRightOf="@id/tvGearD"
|
app:layout_constraintLeft_toRightOf="@id/tvGearD"
|
||||||
app:layout_constraintRight_toLeftOf="@id/btnControlAutoPilot"
|
app:layout_constraintRight_toLeftOf="@id/btnControlAutoPilot"
|
||||||
app:layout_constraintTop_toTopOf="@id/btnControlAutoPilot"
|
app:layout_constraintTop_toTopOf="@id/btnControlAutoPilot"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/btnControlAutoPilot"
|
app:layout_constraintBottom_toBottomOf="@id/btnControlAutoPilot"
|
||||||
android:layout_marginStart="@dimen/dp_15"
|
android:layout_marginStart="@dimen/dp_30"
|
||||||
android:layout_marginEnd="@dimen/dp_15"
|
android:layout_marginEnd="@dimen/dp_30"
|
||||||
android:textSize="@dimen/sp_18"
|
android:paddingStart="@dimen/dp_30"
|
||||||
|
android:paddingEnd="@dimen/dp_30"
|
||||||
|
android:textSize="@dimen/sp_36"
|
||||||
android:text="自驾状态"
|
android:text="自驾状态"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ToggleButton
|
<ToggleButton
|
||||||
android:id="@+id/btnControlAutoPilot"
|
android:id="@+id/btnControlAutoPilot"
|
||||||
android:layout_width="@dimen/dp_0"
|
android:layout_width="@dimen/dp_0"
|
||||||
android:layout_height="@dimen/dp_35"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_10"
|
android:layout_marginTop="@dimen/dp_20"
|
||||||
android:layout_marginEnd="@dimen/dp_10"
|
android:layout_marginEnd="@dimen/dp_20"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:paddingStart="@dimen/dp_20"
|
android:paddingStart="@dimen/dp_20"
|
||||||
android:paddingEnd="@dimen/dp_20"
|
android:paddingEnd="@dimen/dp_20"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textOff="启动自动驾驶"
|
android:textOff="启动自动驾驶"
|
||||||
android:textOn="退出自动驾驶"
|
android:textOn="退出自动驾驶"
|
||||||
android:textSize="@dimen/sp_18"
|
android:textSize="@dimen/sp_36"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/ivSpeedReduce"
|
app:layout_constraintTop_toBottomOf="@+id/ivSpeedReduce"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintLeft_toRightOf="@id/btnAutoPilotStatus"
|
app:layout_constraintLeft_toRightOf="@id/btnAutoPilotStatus"
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ import com.mogo.tts.base.IMogoTTSCallback
|
|||||||
import com.zhjt.mogo.adas.data.AdasConstants
|
import com.zhjt.mogo.adas.data.AdasConstants
|
||||||
import com.zhjt.mogo_core_function_devatools.rviz.common.config.SSHAccountConfig
|
import com.zhjt.mogo_core_function_devatools.rviz.common.config.SSHAccountConfig
|
||||||
import com.zhjt.mogo_core_function_devatools.rviz.dialog.ChangeDefaultConfigDialog
|
import com.zhjt.mogo_core_function_devatools.rviz.dialog.ChangeDefaultConfigDialog
|
||||||
|
import com.zhjt.mogo_core_function_devatools.rviz.ui.activity.AutopilotCheckAct
|
||||||
import com.zhjt.mogo_core_function_devatools.rviz.ui.activity.FmdAct
|
import com.zhjt.mogo_core_function_devatools.rviz.ui.activity.FmdAct
|
||||||
import com.zhjt.service.chain.ChainLog
|
import com.zhjt.service.chain.ChainLog
|
||||||
import kotlinx.android.synthetic.main.view_debug_setting.view.appVersionInfoLayout
|
import kotlinx.android.synthetic.main.view_debug_setting.view.appVersionInfoLayout
|
||||||
@@ -840,7 +841,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
|||||||
* 自动驾驶检测
|
* 自动驾驶检测
|
||||||
*/
|
*/
|
||||||
btnAutoCheck.onClick {
|
btnAutoCheck.onClick {
|
||||||
ToastUtils.showShort("自动驾驶检测")
|
ActivityUtils.startActivity(AutopilotCheckAct::class.java)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1566,7 +1567,9 @@ internal class DebugSettingView @JvmOverloads constructor(
|
|||||||
*/
|
*/
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
private fun setDomainControllerCheckedChangeListener() {
|
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) }
|
etAutopilotIP.text?.let { etAutopilotIP.setSelection(it.length) }
|
||||||
//设置工控机IP
|
//设置工控机IP
|
||||||
btnSetAutopilotIP.setOnClickListener {
|
btnSetAutopilotIP.setOnClickListener {
|
||||||
@@ -1574,6 +1577,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
|||||||
if (autoPilotIp.isNotEmpty()) {
|
if (autoPilotIp.isNotEmpty()) {
|
||||||
SSHAccountConfig.setRosMasterIp(autoPilotIp.split(":", ":").first())
|
SSHAccountConfig.setRosMasterIp(autoPilotIp.split(":", ":").first())
|
||||||
CallerAutoPilotControlManager.resetIpAddress(autoPilotIp)
|
CallerAutoPilotControlManager.resetIpAddress(autoPilotIp)
|
||||||
|
SharedPrefsMgr.getInstance().putString(SharedPrefsConstants.inputIpDomainController,autoPilotIp)
|
||||||
} else {
|
} else {
|
||||||
ToastUtils.showShort("请输入正确的IP地址")
|
ToastUtils.showShort("请输入正确的IP地址")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,8 +75,8 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
|
|||||||
AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
|
AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
|
||||||
}
|
}
|
||||||
|
|
||||||
private val isB2 by lazy {
|
private val isB1 by lazy {
|
||||||
AppIdentityModeUtils.isB2(FunctionBuildConfig.appIdentityMode)
|
AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var currentEventUUID: String = ""
|
private var currentEventUUID: String = ""
|
||||||
@@ -93,7 +93,7 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
|
|||||||
|
|
||||||
private fun initView() {
|
private fun initView() {
|
||||||
if (isPassengerScreen) {
|
if (isPassengerScreen) {
|
||||||
if (isB2) {
|
if (isB1) {
|
||||||
setB2PassengerScreenView()
|
setB2PassengerScreenView()
|
||||||
} else {
|
} else {
|
||||||
setTaxiPassengerScreenView()
|
setTaxiPassengerScreenView()
|
||||||
|
|||||||
@@ -21,84 +21,104 @@
|
|||||||
android:layout_marginTop="@dimen/dp_82"
|
android:layout_marginTop="@dimen/dp_82"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ImageView
|
<ScrollView
|
||||||
android:layout_width="@dimen/dp_18"
|
android:layout_width="@dimen/dp_0"
|
||||||
android:layout_height="@dimen/dp_18"
|
android:layout_height="@dimen/dp_0"
|
||||||
android:src="@drawable/icon_ota_upgrade_tip"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:layout_marginTop="@dimen/dp_222"
|
android:layout_marginTop="@dimen/dp_200"
|
||||||
android:layout_marginStart="@dimen/dp_65"
|
android:layout_marginBottom="@dimen/dp_200"
|
||||||
android:contentDescription="@string/ota_upgrade_tip_one"
|
>
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/tvUpgradeContent"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="@dimen/dp_0"
|
android:layout_height="wrap_content">
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textSize="@dimen/sp_36"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
|
||||||
android:layout_marginTop="@dimen/dp_206"
|
|
||||||
android:layout_marginStart="@dimen/dp_103"
|
|
||||||
android:layout_marginEnd="@dimen/dp_66"
|
|
||||||
android:text="@string/ota_upgrade_tip_one"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ivTipLogoTwo"
|
android:layout_width="@dimen/dp_18"
|
||||||
android:layout_width="@dimen/dp_18"
|
android:layout_height="@dimen/dp_18"
|
||||||
android:layout_height="@dimen/dp_18"
|
android:src="@drawable/icon_ota_upgrade_tip"
|
||||||
android:src="@drawable/icon_ota_upgrade_tip"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/tvUpgradeContent"
|
android:layout_marginTop="@dimen/dp_22"
|
||||||
android:layout_marginStart="@dimen/dp_65"
|
android:layout_marginStart="@dimen/dp_65"
|
||||||
android:contentDescription="@string/ota_upgrade_tip_two"
|
android:contentDescription="@string/ota_upgrade_tip_one"
|
||||||
android:layout_marginTop="@dimen/dp_30"
|
/>
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvTipContentTwo"
|
android:id="@+id/tvUpgradeContent"
|
||||||
android:layout_width="@dimen/dp_0"
|
android:layout_width="@dimen/dp_0"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/ota_upgrade_tip_two"
|
android:textSize="@dimen/sp_36"
|
||||||
android:textSize="@dimen/sp_36"
|
android:textColor="@color/white"
|
||||||
android:textColor="@color/white"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@id/ivTipLogoTwo"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
android:layout_marginTop="@dimen/dp_6"
|
||||||
android:layout_marginStart="@dimen/dp_103"
|
android:layout_marginStart="@dimen/dp_103"
|
||||||
android:layout_marginEnd="@dimen/dp_66"
|
android:layout_marginEnd="@dimen/dp_66"
|
||||||
android:layout_marginTop="@dimen/dp_m_17"
|
android:text="@string/ota_upgrade_tip_one"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ivTipLogoThree"
|
android:id="@+id/ivTipLogoTwo"
|
||||||
android:layout_width="@dimen/dp_18"
|
android:layout_width="@dimen/dp_18"
|
||||||
android:layout_height="@dimen/dp_18"
|
android:layout_height="@dimen/dp_18"
|
||||||
android:src="@drawable/icon_ota_upgrade_tip"
|
android:src="@drawable/icon_ota_upgrade_tip"
|
||||||
app:layout_constraintTop_toBottomOf="@id/tvTipContentTwo"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintTop_toBottomOf="@id/tvUpgradeContent"
|
||||||
android:layout_marginTop="@dimen/dp_30"
|
android:layout_marginStart="@dimen/dp_65"
|
||||||
android:layout_marginStart="@dimen/dp_65"
|
android:contentDescription="@string/ota_upgrade_tip_two"
|
||||||
android:contentDescription="@string/ota_upgrade_tip_three"
|
android:layout_marginTop="@dimen/dp_30"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvTipContentTwo"
|
||||||
|
android:layout_width="@dimen/dp_0"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/ota_upgrade_tip_two"
|
||||||
|
android:textSize="@dimen/sp_36"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/ivTipLogoTwo"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
android:layout_marginStart="@dimen/dp_103"
|
||||||
|
android:layout_marginEnd="@dimen/dp_66"
|
||||||
|
android:layout_marginTop="@dimen/dp_m_17"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ivTipLogoThree"
|
||||||
|
android:layout_width="@dimen/dp_18"
|
||||||
|
android:layout_height="@dimen/dp_18"
|
||||||
|
android:src="@drawable/icon_ota_upgrade_tip"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tvTipContentTwo"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
android:layout_marginTop="@dimen/dp_30"
|
||||||
|
android:layout_marginStart="@dimen/dp_65"
|
||||||
|
android:contentDescription="@string/ota_upgrade_tip_three"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="@dimen/dp_0"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/ota_upgrade_tip_three"
|
||||||
|
android:textSize="@dimen/sp_36"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/ivTipLogoThree"
|
||||||
|
android:layout_marginStart="@dimen/dp_103"
|
||||||
|
android:layout_marginEnd="@dimen/dp_66"
|
||||||
|
android:layout_marginTop="@dimen/dp_m_17"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="@dimen/dp_0"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/ota_upgrade_tip_three"
|
|
||||||
android:textSize="@dimen/sp_36"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/ivTipLogoThree"
|
|
||||||
android:layout_marginStart="@dimen/dp_103"
|
|
||||||
android:layout_marginEnd="@dimen/dp_66"
|
|
||||||
android:layout_marginTop="@dimen/dp_m_17"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_upgrade_now"
|
android:id="@+id/tv_upgrade_now"
|
||||||
|
|||||||
@@ -2197,6 +2197,7 @@
|
|||||||
android:padding="@dimen/dp_20"
|
android:padding="@dimen/dp_20"
|
||||||
android:text="自动驾驶检测"
|
android:text="自动驾驶检测"
|
||||||
android:textSize="@dimen/dp_24"
|
android:textSize="@dimen/dp_24"
|
||||||
|
android:visibility="invisible"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<ToggleButton
|
<ToggleButton
|
||||||
|
|||||||
@@ -18,4 +18,6 @@ public class SharedPrefsConstants {
|
|||||||
public static final String APP_UPGRADE_CONTENT = "app_upgrade_content";
|
public static final String APP_UPGRADE_CONTENT = "app_upgrade_content";
|
||||||
|
|
||||||
public static final String APP_MAC = "app_mac";
|
public static final String APP_MAC = "app_mac";
|
||||||
|
|
||||||
|
public static final String inputIpDomainController = "InputIpDomainController";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user