[dev_minibus-d_230425_3.2.0]漫游更改为司乘屏独立漫游
This commit is contained in:
@@ -305,22 +305,6 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_badcase_rl"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_mogo_och_ai_collet_rl"
|
||||
android:layout_width="@dimen/dp_172"
|
||||
android:layout_height="@dimen/dp_172"
|
||||
android:background="@drawable/bus_operation_status_bg_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_badcase_rl">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/icon_ai_collect" />
|
||||
</RelativeLayout>
|
||||
|
||||
<com.mogo.och.bus.view.SlidePanelView
|
||||
android:id="@+id/module_mogo_och_slide_panel"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -138,7 +138,7 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
clickListener?.showBadCaseManagerView()
|
||||
}
|
||||
//BadCase上报
|
||||
CallerDevaToolsManager.initBadCase(badCaseLayout)
|
||||
CallerDevaToolsManager.initAiCollect(badCaseLayout)
|
||||
ivDebugPanel.setOnClickListener {
|
||||
clickListener?.showDebugPanelView()
|
||||
}
|
||||
|
||||
@@ -4,19 +4,16 @@ import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.multidisplay.TelematicConstant
|
||||
import com.mogo.eagle.core.function.api.map.roma.IMoGoRomaListener
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager.romaTrigger
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
|
||||
class RomaPassengerView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IReceivedMsgListener, IMoGoRomaListener {
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoRomaListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "RomaPassengerView"
|
||||
@@ -44,35 +41,15 @@ class RomaPassengerView @JvmOverloads constructor(
|
||||
}
|
||||
click = false
|
||||
romaMode = !romaMode
|
||||
romaTrigger(romaMode) { mode ->
|
||||
click = true
|
||||
romaMode = mode
|
||||
}
|
||||
|
||||
romaTrigger(romaMode)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerTelematicListenerManager.addListener(TAG, this)
|
||||
CallerMapRomaListener.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onReceivedMsg(type: Int, byteArray: ByteArray) {
|
||||
when (type) {
|
||||
TelematicConstant.OPEN_ROMA_STATUS -> {
|
||||
when (String(byteArray)) {
|
||||
"0" -> {
|
||||
romaStatus(true)
|
||||
}
|
||||
"1" -> {
|
||||
romaStatus(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun romaStatus(status: Boolean) {
|
||||
click = true
|
||||
if (status) {
|
||||
@@ -90,7 +67,6 @@ class RomaPassengerView @JvmOverloads constructor(
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerTelematicListenerManager.removeListener(TAG)
|
||||
CallerMapRomaListener.removeListener(TAG)
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,9 @@ import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.multidisplay.TelematicConstant
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.function.api.map.roma.IMoGoRomaListener
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager.romaTrigger
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import kotlinx.android.synthetic.main.view_roma_bg.view.*
|
||||
|
||||
@@ -15,7 +14,7 @@ class RomaView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IReceivedMsgListener {
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoRomaListener {
|
||||
|
||||
companion object{
|
||||
private const val TAG = "RomaView"
|
||||
@@ -25,7 +24,7 @@ class RomaView @JvmOverloads constructor(
|
||||
private var romaMode = false
|
||||
|
||||
@Volatile
|
||||
private var click = false
|
||||
private var click = true
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_roma_bg, this, true)
|
||||
@@ -35,51 +34,33 @@ class RomaView @JvmOverloads constructor(
|
||||
}
|
||||
click = false
|
||||
romaMode = !romaMode
|
||||
// 司机屏发送事件给乘客屏
|
||||
if (romaMode) {
|
||||
CallerTelematicManager.sendMsgToAllClients(
|
||||
TelematicConstant.OPEN_ROMA_STATUS,
|
||||
"0".toByteArray()
|
||||
)
|
||||
} else {
|
||||
CallerTelematicManager.sendMsgToAllClients(
|
||||
TelematicConstant.OPEN_ROMA_STATUS,
|
||||
"1".toByteArray()
|
||||
)
|
||||
}
|
||||
//司机屏不控制乘客屏漫游,独自漫游
|
||||
romaTrigger(romaMode)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun romaStatus(status: Boolean) {
|
||||
click = true
|
||||
if (status) {
|
||||
romaMode = true
|
||||
ll_roma_bg.setBackgroundResource(R.drawable.romabg_press_select_bg)
|
||||
ivRomaView.setBackgroundResource(R.drawable.roma_press_select_bg)
|
||||
} else {
|
||||
romaMode = false
|
||||
ll_roma_bg.setBackgroundResource(R.drawable.roma_bg_selector)
|
||||
ivRomaView.setBackgroundResource(R.drawable.romafront_select_bg)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerTelematicListenerManager.addListener(TAG,this)
|
||||
}
|
||||
|
||||
override fun onReceivedMsg(type: Int, byteArray: ByteArray) {
|
||||
click = true
|
||||
when(type){
|
||||
TelematicConstant.OPEN_ROMA_STATUS -> {
|
||||
when (String(byteArray)) {
|
||||
// 乘客端开启漫游
|
||||
"3" -> {
|
||||
romaMode = true
|
||||
ll_roma_bg.setBackgroundResource(R.drawable.romabg_press_select_bg)
|
||||
ivRomaView.setBackgroundResource(R.drawable.roma_press_select_bg)
|
||||
}
|
||||
// 乘客端关闭漫游
|
||||
"4" -> {
|
||||
romaMode = false
|
||||
ll_roma_bg.setBackgroundResource(R.drawable.roma_bg_selector)
|
||||
ivRomaView.setBackgroundResource(R.drawable.romafront_select_bg)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
CallerMapRomaListener.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerTelematicListenerManager.removeListener(TAG)
|
||||
CallerMapRomaListener.removeListener(TAG)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,8 +26,8 @@ class MapBizProvider :IMoGoFunctionServerProvider, IMogoRoma {
|
||||
aiCloudIdentifyDataManager.initServer(AbsMogoApplication.getApp())
|
||||
}
|
||||
|
||||
override fun trigger(romaStatus: Boolean,connectError:((Boolean) -> Unit)?) {
|
||||
aiCloudIdentifyDataManager.trigger(romaStatus,connectError)
|
||||
override fun trigger(romaStatus: Boolean,requestSuccess:((Boolean) -> Unit)?) {
|
||||
aiCloudIdentifyDataManager.trigger(romaStatus,requestSuccess)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
||||
@@ -9,7 +9,6 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.data.multidisplay.TelematicConstant
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
|
||||
import com.mogo.eagle.core.function.business.ai.net.AiCloudIdentifyNetWorkModel.Companion.aiCloudIdentifyNetWorkModel
|
||||
import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
@@ -18,11 +17,9 @@ import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListener
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.updateLongSightLevel
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager.sendMsgToServer
|
||||
import com.mogo.eagle.core.function.utils.MapBizTrace
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.map.MogoMapUIController
|
||||
import com.mogo.map.listener.IMogoMapListener
|
||||
@@ -34,7 +31,7 @@ import mogo.telematics.pad.MessagePad
|
||||
import mogo.yycp.api.proto.SocketDownData
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
|
||||
class AiCloudIdentifyDataManager : IMogoMapListener, IReceivedMsgListener,
|
||||
class AiCloudIdentifyDataManager : IMogoMapListener,
|
||||
IMoGoPlanningRottingListener, IMoGoAutopilotStatusListener {
|
||||
|
||||
companion object {
|
||||
@@ -53,56 +50,45 @@ class AiCloudIdentifyDataManager : IMogoMapListener, IReceivedMsgListener,
|
||||
private var serverSn = ""
|
||||
|
||||
fun initServer(mContext: Context) {
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
MogoMapListenerHandler.mogoMapListenerHandler.registerHostMapListener(TAG, this)
|
||||
CallerTelematicListenerManager.addListener(TAG, this)
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerPlanningRottingListenerManager.addListener(TAG,this)
|
||||
CallerAutoPilotControlManager.getGlobalPath()
|
||||
MogoAiCloudSocketManager.getInstance(mContext)
|
||||
.registerOnMessageListener(
|
||||
0x040003, //低频数据
|
||||
object : IMogoOnMessageListener<SocketDownData.SocketDownDataProto> {
|
||||
override fun target(): Class<SocketDownData.SocketDownDataProto> {
|
||||
return SocketDownData.SocketDownDataProto::class.java
|
||||
}
|
||||
MogoMapListenerHandler.mogoMapListenerHandler.registerHostMapListener(TAG, this)
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerPlanningRottingListenerManager.addListener(TAG,this)
|
||||
CallerAutoPilotControlManager.getGlobalPath()
|
||||
MogoAiCloudSocketManager.getInstance(mContext)
|
||||
.registerOnMessageListener(
|
||||
0x040003, //低频数据
|
||||
object : IMogoOnMessageListener<SocketDownData.SocketDownDataProto> {
|
||||
override fun target(): Class<SocketDownData.SocketDownDataProto> {
|
||||
return SocketDownData.SocketDownDataProto::class.java
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_DATA_TRACKED,
|
||||
linkCode = ChainConstant.CHAIN_LINK_ADAS,
|
||||
endpoint = TracingConstants.Endpoint.PAD,
|
||||
nodeAliasCode = ChainConstant.CHAIN_ALIAS_CODE_ADAS_MESSAGE_RECT_DATA,
|
||||
paramIndexes = [0],
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
override fun onMsgReceived(obj: SocketDownData.SocketDownDataProto?) {
|
||||
obj?.let {
|
||||
obj.data?.let {
|
||||
if (showAiCloud.get()) {
|
||||
if (it.allListList == null || it.allListList.size == 0) {
|
||||
MapIdentifySubscriber.instance.clearAiCloudRoma()
|
||||
return
|
||||
}
|
||||
MapIdentifySubscriber.instance.renderAiCloudResult(it.allListList)
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_DATA_TRACKED,
|
||||
linkCode = ChainConstant.CHAIN_LINK_ADAS,
|
||||
endpoint = TracingConstants.Endpoint.PAD,
|
||||
nodeAliasCode = ChainConstant.CHAIN_ALIAS_CODE_ADAS_MESSAGE_RECT_DATA,
|
||||
paramIndexes = [0],
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
override fun onMsgReceived(obj: SocketDownData.SocketDownDataProto?) {
|
||||
obj?.let {
|
||||
obj.data?.let {
|
||||
if (showAiCloud.get()) {
|
||||
if (it.allListList == null || it.allListList.size == 0) {
|
||||
MapIdentifySubscriber.instance.clearAiCloudRoma()
|
||||
return
|
||||
}
|
||||
MapIdentifySubscriber.instance.renderAiCloudResult(it.allListList)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun trigger(romaStatus: Boolean,connectError: ((Boolean) -> Unit)?) {
|
||||
MapBizTrace.log(TAG, "trigger")
|
||||
if (serverSn.isEmpty()) {
|
||||
serverSn = CallerTelematicManager.getServerToken()
|
||||
if (serverSn.isEmpty()) {
|
||||
ToastUtils.showLong("未获取到司机屏设备信息")
|
||||
connectError?.invoke(!romaStatus)
|
||||
return
|
||||
}
|
||||
}
|
||||
// 乘客屏单独控制漫游
|
||||
// 乘客司机屏屏各自单独控制漫游
|
||||
if (romaStatus) {
|
||||
// 开启roma,当前非漫游,开启
|
||||
openRoma()
|
||||
@@ -111,23 +97,6 @@ class AiCloudIdentifyDataManager : IMogoMapListener, IReceivedMsgListener,
|
||||
}
|
||||
}
|
||||
|
||||
// 乘客屏接收开启/关闭 roma
|
||||
override fun onReceivedMsg(type: Int, byteArray: ByteArray) {
|
||||
MapBizTrace.log(TAG, "onReceivedMsg type : $type")
|
||||
when (type) {
|
||||
TelematicConstant.OPEN_ROMA_STATUS -> {
|
||||
when (String(byteArray)) {
|
||||
"0" -> {
|
||||
openRoma()
|
||||
}
|
||||
"1" -> {
|
||||
closeRoma()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun openRoma() {
|
||||
if (!MogoMapUIController.getInstance().currentMapVisualAngle.isRoma) {
|
||||
updateLongSightLevel(true)
|
||||
@@ -166,10 +135,8 @@ class AiCloudIdentifyDataManager : IMogoMapListener, IReceivedMsgListener,
|
||||
// 请求地图开始漫游
|
||||
MogoMapUIController.getInstance().setRomaMode(FunctionBuildConfig.romaModeStyle)
|
||||
CallerMapRomaListener.invokeMapRoma(true)
|
||||
sendMsgToServer(TelematicConstant.OPEN_ROMA_STATUS, "3".toByteArray())
|
||||
} else {
|
||||
CallerMapRomaListener.invokeMapRoma(false)
|
||||
sendMsgToServer(TelematicConstant.OPEN_ROMA_STATUS, "4".toByteArray())
|
||||
}
|
||||
}, {
|
||||
MapBizTrace.log(
|
||||
@@ -178,7 +145,6 @@ class AiCloudIdentifyDataManager : IMogoMapListener, IReceivedMsgListener,
|
||||
)
|
||||
updateLongSightLevel(false)
|
||||
CallerMapRomaListener.invokeMapRoma(false)
|
||||
sendMsgToServer(TelematicConstant.OPEN_ROMA_STATUS, "4".toByteArray())
|
||||
if(DebugConfig.isDebug()){
|
||||
ToastUtils.showShort("漫游请求异常,msg:$it")
|
||||
}
|
||||
|
||||
@@ -8,6 +8,6 @@ interface IMogoRoma : IProvider {
|
||||
* 触发开启/关闭漫游
|
||||
* @param romaStatus 漫游状态
|
||||
*/
|
||||
fun trigger(romaStatus:Boolean,connectError:((Boolean) -> Unit)? = null)
|
||||
fun trigger(romaStatus:Boolean,requestSuccess:((Boolean) -> Unit)? = null)
|
||||
|
||||
}
|
||||
@@ -10,8 +10,8 @@ object CallerMapIdentifyManager {
|
||||
get() = ARouter.getInstance().build( MogoServicePaths.PATH_MAP_BIZ)
|
||||
.navigation() as IMogoRoma
|
||||
|
||||
fun romaTrigger(romaStatus:Boolean, connectError:((Boolean) -> Unit)? = null){
|
||||
romaApi.trigger(romaStatus, connectError)
|
||||
fun romaTrigger(romaStatus:Boolean, requestSuccess:((Boolean) -> Unit)? = null){
|
||||
romaApi.trigger(romaStatus, requestSuccess)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user