Merge branch 'dev_robotaxi-d-app-module_2130_221116_2.13.0' into 'test_robotaxi-d-app-module_2130_221116_2.13.0.1'
Dev robotaxi d app module 2130 221116 2.13.0 See merge request zhjt/AndroidApp/MoGoEagleEye!404
This commit is contained in:
@@ -39,7 +39,7 @@ class BusPassengerConst {
|
||||
// 未到站(未到站)
|
||||
const val STATION_STATUS_ARRIVING = 3
|
||||
|
||||
//bus平均速度
|
||||
//bus平均速度 bus的平均里程:25km/h
|
||||
const val BUS_AVERAGE_SPEED = 25
|
||||
|
||||
// 订单总里程
|
||||
|
||||
@@ -199,21 +199,22 @@ public class BusPassengerMapDirectionView
|
||||
//圈定地图显示范围
|
||||
LatLngBounds.Builder boundsBuilder = new LatLngBounds.Builder();
|
||||
|
||||
if (mLineStationLatLng.size() > 0){
|
||||
// if (mLineStationLatLng.size() > 0){
|
||||
// //存放经纬度
|
||||
// for (int i = 0; i < mLineStationLatLng.size(); i++) {
|
||||
// boundsBuilder.include(mLineStationLatLng.get(i));
|
||||
// }
|
||||
// //第二个参数为四周留空宽度
|
||||
// }
|
||||
|
||||
if (mCoordinatesLatLng.size() > 0){
|
||||
//存放经纬度
|
||||
for (int i = 0; i < mLineStationLatLng.size(); i++) {
|
||||
boundsBuilder.include(mLineStationLatLng.get(i));
|
||||
for (int i = 0; i < mCoordinatesLatLng.size(); i++) {
|
||||
boundsBuilder.include(mCoordinatesLatLng.get(i));
|
||||
}
|
||||
//第二个参数为四周留空宽度
|
||||
|
||||
}
|
||||
// else {
|
||||
//第二个参数为四周留空宽度
|
||||
//设置希望展示的地图缩放级别
|
||||
// CameraPosition cameraPosition = new CameraPosition.Builder()
|
||||
// .target(mCarMarker.getPosition()).tilt(0).bearing(location.getBearing()).zoom(zoomLevel).build();
|
||||
// mAMap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
|
||||
// }
|
||||
|
||||
boundsBuilder.include(currentLatLng);
|
||||
mAMap.moveCamera(CameraUpdateFactory.newLatLngBoundsRect(boundsBuilder.build(),100,100,100,100));
|
||||
}
|
||||
|
||||
@@ -60,7 +60,9 @@ public class BusProvider implements IMogoOCH {
|
||||
} else {
|
||||
busFragment = new BusFragment();
|
||||
}
|
||||
supportFragmentManager.beginTransaction().add(containerId, busFragment, BusFragment.TAG).commitAllowingStateLoss();
|
||||
if(!busFragment.isAdded()) {
|
||||
supportFragmentManager.beginTransaction().add(containerId, busFragment, BusFragment.TAG).commitAllowingStateLoss();
|
||||
}
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(TAG, "准备show fragment");
|
||||
|
||||
@@ -5,5 +5,7 @@
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
||||
</manifest>
|
||||
@@ -15,6 +15,7 @@ import com.zhjt.mogo_core_function_devatools.badcase.BadCaseManager
|
||||
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigCenter.Companion.bizConfigCenter
|
||||
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigImpl
|
||||
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchManager
|
||||
import com.zhjt.mogo_core_function_devatools.mofang.MoFangManager
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.MonitorManager
|
||||
import com.zhjt.mogo_core_function_devatools.scene.SceneManager.Companion.sceneManager
|
||||
import com.zhjt.mogo_core_function_devatools.status.*
|
||||
@@ -42,6 +43,7 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
bizConfigCenter.init(mContext!!)
|
||||
FuncConfigImpl.init()
|
||||
MogoLogCatchManager.init(mContext!!)
|
||||
MoFangManager.INSTANCE.init(mContext!!)
|
||||
}
|
||||
|
||||
override fun startLogCatch() {
|
||||
|
||||
@@ -186,6 +186,7 @@ internal object BadCaseManager : LifecycleEventObserver {
|
||||
|
||||
override fun onFinish() {
|
||||
passiveBadCaseWindow.hideFloatWindow()
|
||||
BadCaseConfig.windowNum--
|
||||
}
|
||||
}
|
||||
countDownTimer.start()
|
||||
|
||||
@@ -37,6 +37,7 @@ import kotlinx.coroutines.launch
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import com.zhidao.loglib.upload.UploadManager
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import java.io.File
|
||||
import java.lang.reflect.Field
|
||||
|
||||
@@ -139,6 +140,7 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
}
|
||||
//删除记录
|
||||
CallerMsgBoxManager.removeRecordInfo(mActivity, boxBean!!, recordKey!!)
|
||||
EventBus.getDefault().post(boxBean)
|
||||
}
|
||||
|
||||
tvPassiveCancel.setOnClickListener {
|
||||
@@ -146,6 +148,7 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
clickListener?.closeWindow()
|
||||
//删除记录
|
||||
CallerMsgBoxManager.removeRecordInfo(mActivity, boxBean!!, recordKey!!)
|
||||
EventBus.getDefault().post(boxBean)
|
||||
}
|
||||
|
||||
mWindowParams = WindowManager.LayoutParams()
|
||||
@@ -335,8 +338,6 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
}
|
||||
|
||||
override fun onCheckedChanged(buttonView: CompoundButton?, isChecked: Boolean) {
|
||||
Log.i("onCheckedChanged","buttonView"+buttonView)
|
||||
Log.i("onCheckedChanged","isChecked"+isChecked)
|
||||
buttonView?.text?.let {
|
||||
if(isChecked){
|
||||
if(!uploadReason.contains(it)){
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.zhjt.mogo_core_function_devatools.mofang
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.bluetooth.BluetoothAdapter
|
||||
import android.bluetooth.BluetoothDevice
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import com.mogo.eagle.core.data.mofang.MfConstants
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.updateMfStatusView
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_F
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
|
||||
|
||||
/**
|
||||
* 魔方连接状态和设备管理
|
||||
*/
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
class MoFangManager private constructor() {
|
||||
|
||||
companion object {
|
||||
val INSTANCE: MoFangManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
MoFangManager()
|
||||
}
|
||||
}
|
||||
|
||||
private var mContext: Context? = null
|
||||
private val TAG = "MoFangManager"
|
||||
private lateinit var mBluetoothAdapter: BluetoothAdapter
|
||||
private var isMfConnect: Boolean = false //添加状态判断
|
||||
|
||||
|
||||
fun init(context: Context) {
|
||||
mContext = context
|
||||
initBluetooth(context)
|
||||
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter()
|
||||
if (!mBluetoothAdapter.isEnabled) {
|
||||
mBluetoothAdapter.enable()
|
||||
}
|
||||
mBluetoothAdapter.startDiscovery()
|
||||
showBondedDevice(mBluetoothAdapter)
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化蓝牙广播
|
||||
*/
|
||||
private fun initBluetooth(context: Context) {
|
||||
val intentFilter = IntentFilter();
|
||||
// 监视蓝牙关闭和打开的状态
|
||||
intentFilter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED)
|
||||
// 监视蓝牙设备与APP连接的状态
|
||||
intentFilter.addAction(BluetoothDevice.ACTION_ACL_DISCONNECTED)
|
||||
intentFilter.addAction(BluetoothDevice.ACTION_ACL_CONNECTED)
|
||||
// 注册广播
|
||||
context.registerReceiver(bluetoothMonitorReceiver, intentFilter)
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找蓝牙连接过的蓝牙设备
|
||||
*/
|
||||
private fun showBondedDevice(bluetoothAdapter: BluetoothAdapter) {
|
||||
if (bluetoothAdapter != null) {
|
||||
val deviceList = bluetoothAdapter.bondedDevices
|
||||
for (device in deviceList) {
|
||||
try {
|
||||
//使用反射调用获取设备连接状态方
|
||||
val isConnectedMethod = BluetoothDevice::class.java.getDeclaredMethod("isConnected")
|
||||
isConnectedMethod.isAccessible = true
|
||||
val isConnected = isConnectedMethod.invoke(device) as Boolean
|
||||
CallerLogger.d("$M_F${TAG}"," showBondedDevice name = ${device.name} ---address = ${device.address}----isMfConnect = $isMfConnect ---isConnected = $isConnected")
|
||||
if (device.name == "MINI_KEYBOARD") { //并且连接
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putString(MfConstants.BLUETOOTH_NAME, device.name) }
|
||||
}
|
||||
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean(MfConstants.BLUETOOTH_STATUS, isConnected) }
|
||||
if (isConnected) {
|
||||
isMfConnect = true
|
||||
}
|
||||
} catch (e: NoSuchMethodException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private val bluetoothMonitorReceiver: BroadcastReceiver = object : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
when (intent.action) {
|
||||
BluetoothAdapter.ACTION_STATE_CHANGED -> { //中间状态
|
||||
CallerLogger.d("$M_F${TAG}","bluetoothMonitorReceiver ACTION_STATE_CHANGED action = ${intent.action}")
|
||||
}
|
||||
|
||||
BluetoothDevice.ACTION_ACL_CONNECTED -> { //蓝牙设备已连接
|
||||
if (!isMfConnect) {
|
||||
// showBondedDevice(mBluetoothAdapter)
|
||||
updateMfStatusView(TAG, true)
|
||||
isMfConnect = true
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean(MfConstants.BLUETOOTH_STATUS, true) }
|
||||
}
|
||||
CallerLogger.d("$M_F${TAG}","bluetoothMonitorReceiver ACTION_ACL_CONNECTED ----- isMfConnect = $isMfConnect")
|
||||
}
|
||||
|
||||
BluetoothDevice.ACTION_ACL_DISCONNECTED -> { //蓝牙设备已断开 主动更新
|
||||
CallerLogger.d("$M_F${TAG}","bluetoothMonitorReceiver ACTION_ACL_DISCONNECTED ----- isMfConnect = $isMfConnect ")
|
||||
if (isMfConnect) {
|
||||
updateMfStatusView(TAG, false)
|
||||
isMfConnect = false
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean(MfConstants.BLUETOOTH_STATUS, false) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
if (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().autopilotControlParameters == null) {
|
||||
FunctionBuildConfig.isDemoMode = !FunctionBuildConfig.isDemoMode
|
||||
context?.let {
|
||||
CallerHmiManager.updateStatusBarRightView(
|
||||
CallerHmiManager.updateStatusBarLeftView(
|
||||
FunctionBuildConfig.isDemoMode,
|
||||
"demoMode",
|
||||
DemoModeView(it)
|
||||
@@ -455,10 +455,18 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
statusBarView?.updateRightView(insert, tag, viewGroup)
|
||||
}
|
||||
|
||||
override fun updateStatusBarLeftView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
||||
statusBarView?.updateLeftView(insert, tag, viewGroup)
|
||||
}
|
||||
|
||||
override fun updateStatusBarDownloadView(insert: Boolean, tag: String, progress: Int) {
|
||||
statusBarView?.updateProgressView(insert, tag, progress)
|
||||
}
|
||||
|
||||
override fun updateMfStatus(tag: String, status: Boolean) {
|
||||
statusBarView?.updateMfStatus(tag, status)
|
||||
}
|
||||
|
||||
override fun updateDriverMsgBoxTipView(show: Boolean) {
|
||||
if(show){
|
||||
MsgBoxTipView.visibility = View.VISIBLE
|
||||
|
||||
@@ -22,6 +22,9 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import kotlinx.android.synthetic.main.layout_driver_msg_box_list.view.*
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
@@ -186,6 +189,7 @@ class DriverMsgBoxListView @JvmOverloads constructor(
|
||||
super.onAttachedToWindow()
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerMsgBoxListenerManager.addListener(TAG,this)
|
||||
EventBus.getDefault().register(this)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,8 +197,16 @@ class DriverMsgBoxListView @JvmOverloads constructor(
|
||||
super.onDetachedFromWindow()
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerMsgBoxListenerManager.removeListener(TAG)
|
||||
EventBus.getDefault().unregister(this)
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun notifyList(msgBoxList: MsgBoxBean){
|
||||
badCaseList?.let {
|
||||
it.remove(msgBoxList)
|
||||
driverMsgBoxListAdapter?.notifyItemRemoved(it.indexOf(msgBoxList))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,9 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui.msgbox.adapter
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Activity
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
@@ -13,7 +11,6 @@ import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.msgbox.*
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
@@ -24,7 +21,6 @@ import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTran
|
||||
import com.mogo.eagle.core.utilcode.util.ResourceUtils.getDrawable
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat
|
||||
import com.mogo.eagle.core.widget.RoundConstraintLayout
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
@@ -79,7 +75,6 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
|
||||
holder.tvBagReceiveTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvBagRecordTime.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
|
||||
val msgBoxBean = it[position]
|
||||
// val recordBagMsg = (it[position].bean as RecordBagMsg)
|
||||
holder.tvRecordCheck.setOnClickListener {
|
||||
//打开被动录包弹窗
|
||||
CallerDevaToolsManager.onReceiveBadCaseRecord(msgBoxBean,activity,false)
|
||||
|
||||
@@ -586,7 +586,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
// 演示模式
|
||||
tbIsDemoMode.setOnCheckedChangeListener { _, isChecked ->
|
||||
CallerHmiManager.updateStatusBarRightView(isChecked, "demoMode", DemoModeView(context))
|
||||
CallerHmiManager.updateStatusBarLeftView(isChecked, "demoMode", DemoModeView(context))
|
||||
CallerAutoPilotManager.setDemoMode(isChecked)
|
||||
if (!isChecked) {
|
||||
//关闭美化模式时,通知工控机
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.RouteStrategy
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
||||
import kotlinx.android.synthetic.main.view_sop_setting.view.*
|
||||
import kotlinx.android.synthetic.main.view_sop_setting.view.tbRouteDynamicEffect
|
||||
|
||||
@@ -71,6 +72,28 @@ class SOPSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* obu弱势交通控制
|
||||
*/
|
||||
tbObuWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (!isChecked) { //默认开启
|
||||
CallerHmiManager.setObuWeaknessTraffic(true)
|
||||
} else {
|
||||
CallerHmiManager.setObuWeaknessTraffic(false)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 云端弱势交通控制
|
||||
*/
|
||||
tbCloudWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (isChecked) { //默认关闭
|
||||
CallerHmiManager.setCloudWeaknessTraffic(true)
|
||||
} else {
|
||||
CallerHmiManager.setCloudWeaknessTraffic(false)
|
||||
}
|
||||
}
|
||||
|
||||
//红绿灯标识
|
||||
tbTrafficLight.isChecked = HmiBuildConfig.isShowTrafficLightView
|
||||
tbTrafficLight.setOnCheckedChangeListener { _, isChecked ->
|
||||
@@ -97,7 +120,7 @@ class SOPSettingView @JvmOverloads constructor(
|
||||
tbDemoMode.isChecked = FunctionBuildConfig.isDemoMode
|
||||
// 演示模式
|
||||
tbDemoMode.setOnCheckedChangeListener { _, isChecked ->
|
||||
CallerHmiManager.updateStatusBarRightView(isChecked, "demoMode", DemoModeView(context))
|
||||
CallerHmiManager.updateStatusBarLeftView(isChecked, "demoMode", DemoModeView(context))
|
||||
CallerAutoPilotManager.setDemoMode(isChecked)
|
||||
if (!isChecked) {
|
||||
//关闭美化模式时,通知工控机
|
||||
|
||||
@@ -2,12 +2,15 @@ package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.*
|
||||
import android.widget.*
|
||||
import com.mogo.eagle.core.data.mofang.MfConstants
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
||||
import com.mogo.eagle.core.function.call.devatools.*
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ScreenUtils
|
||||
import kotlinx.android.synthetic.main.view_status_bar.view.*
|
||||
@@ -29,6 +32,7 @@ class StatusBarView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private val rightViewList = CopyOnWriteArrayList<String>()
|
||||
private val leftViewList = CopyOnWriteArrayList<String>()
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
@@ -39,6 +43,11 @@ class StatusBarView @JvmOverloads constructor(
|
||||
|
||||
// 添加换肤监听
|
||||
CallerSkinModeListenerManager.addListener(TAG, this)
|
||||
|
||||
var isBluetoothConnect = SharedPrefsMgr.getInstance(context).getBoolean(MfConstants.BLUETOOTH_STATUS, false)
|
||||
if (isBluetoothConnect) {
|
||||
updateMfStatus("MoFangManager", true)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSkinModeChange(skinMode: Int) {
|
||||
@@ -70,6 +79,20 @@ class StatusBarView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
fun updateLeftView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
||||
if (insert) {
|
||||
leftViewList.add(0, tag)
|
||||
viewStatusBarLeft.addView(viewGroup, 0)
|
||||
} else {
|
||||
leftViewList.forEachIndexed { index, s ->
|
||||
if (s == tag) {
|
||||
leftViewList.removeAt(index)
|
||||
viewStatusBarLeft.removeViewAt(index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun updateProgressView(insert: Boolean, tag: String, progress: Int) {
|
||||
if (insert) {
|
||||
viewProgressTv.visibility = VISIBLE
|
||||
@@ -81,9 +104,9 @@ class StatusBarView @JvmOverloads constructor(
|
||||
|
||||
fun updateMfStatus(tag: String, status: Boolean) {
|
||||
if (status) {
|
||||
// viewMofangStatus.setImageResource(R.drawable.icon_car_red)
|
||||
viewMofangStatus.setImageResource(R.drawable.icon_bluetooth_p)
|
||||
} else {
|
||||
// viewMofangStatus.setImageResource(R.drawable.icon_car_red)
|
||||
viewMofangStatus.setImageResource(R.drawable.blue_tooth)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,11 +3,9 @@ package com.mogo.eagle.core.function.main;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_ALIAS_CODE_START_UP;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_INIT;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_LOG_CONNECT_STATUS;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_F;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Process;
|
||||
@@ -17,17 +15,19 @@ import android.view.KeyEvent;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.module.intent.IMogoIntentListener;
|
||||
import com.mogo.commons.module.intent.IntentManager;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.mofang.MfConstants;
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.function.main.moujie.BluetoothMonitorReceiver;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
@@ -40,9 +40,7 @@ import com.zhjt.service.chain.TracingConstants;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
@@ -63,8 +61,6 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
private Timer timerHorn;
|
||||
private Timer timerAcc;
|
||||
|
||||
private BluetoothMonitorReceiver mBluetoothReceiver = null;
|
||||
private BluetoothAdapter mBluetoothAdapter;
|
||||
private boolean isShowToast = false; //toast 控制
|
||||
private long startPressTime = 0; //开始按减时间
|
||||
private boolean isPressEnd = false; //按键是否结束
|
||||
@@ -91,14 +87,6 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
initBluetooth();
|
||||
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
|
||||
if (!mBluetoothAdapter.isEnabled()) {
|
||||
mBluetoothAdapter.enable();
|
||||
}
|
||||
mBluetoothAdapter.startDiscovery();
|
||||
showBondedDevice(mBluetoothAdapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -126,7 +114,6 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
mIsHomeKeyDown = false;
|
||||
unregisterReceiver(this.mBluetoothReceiver);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -217,10 +204,10 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
*/
|
||||
@Override
|
||||
public boolean dispatchKeyEvent(KeyEvent event) {
|
||||
// Log.d(TAG, "dispatchKeyEvent code = " + event.getKeyCode() + "--action = " + event.getAction() + "----" + event);
|
||||
String bluetoothName = SharedPrefsMgr.getInstance(getContext()).getString("BLUETOOTH");
|
||||
// CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent code = " + event.getKeyCode() + "--action = " + event.getAction() + "----" + event);
|
||||
String bluetoothName = SharedPrefsMgr.getInstance(getContext()).getString(MfConstants.BLUETOOTH_NAME);
|
||||
if (!isPressEnd) {
|
||||
Log.e(TAG, "dispatchKeyEvent bluetoothName = " + bluetoothName);
|
||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager","dispatchKeyEvent bluetoothName = " + bluetoothName);
|
||||
}
|
||||
if (bluetoothName.equals("MINI_KEYBOARD")) {
|
||||
if (!isPressEnd) {
|
||||
@@ -231,7 +218,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
if (event.getKeyCode() == KeyEvent.KEYCODE_A) { //单击 -1,长按无操作,AB组合-2
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
pressADownTime = System.currentTimeMillis();
|
||||
Log.d(TAG, "dispatchKeyEvent A down pressADownTime = " + pressADownTime + "---" + (pressADownTime - startPressTime) + "----isCombinationKey = " + isCombinationKey + "--pressBDownTime = " + pressBDownTime);
|
||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent A down pressADownTime = " + pressADownTime + "---" + (pressADownTime - startPressTime) + "----isCombinationKey = " + isCombinationKey + "--pressBDownTime = " + pressBDownTime);
|
||||
if ((pressADownTime - startPressTime) > 320 && (pressADownTime - startPressTime) < 1300 && pressBDownTime > 0) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 A 按AB组合 -2 ");
|
||||
@@ -250,7 +237,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
}
|
||||
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
||||
pressAUpTime = System.currentTimeMillis();
|
||||
Log.e(TAG, "dispatchKeyEvent A up pressAUpTime = " + pressAUpTime + "---" + (pressAUpTime - startPressTime) + "--pressBDownTime = " + pressBDownTime);
|
||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent A up pressAUpTime = " + pressAUpTime + "---" + (pressAUpTime - startPressTime) + "--pressBDownTime = " + pressBDownTime);
|
||||
if ((pressAUpTime - startPressTime) < 300 && isCombinationKey != 3) {
|
||||
isCombinationKey = 1;
|
||||
if (isShowToast) {
|
||||
@@ -267,12 +254,11 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
}
|
||||
}, 300);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if (event.getKeyCode() == KeyEvent.KEYCODE_B) {//单击复原,长按+1,AB组合-2
|
||||
} else if (event.getKeyCode() == KeyEvent.KEYCODE_B) { //单击复原,长按+1,AB组合-2
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
pressBDownTime = System.currentTimeMillis();
|
||||
Log.d(TAG, "dispatchKeyEvent B down pressBDownTime = " + pressBDownTime + "--差-" + (pressBDownTime - startPressTime) + "---isCombinationKey = " + isCombinationKey + "--pressADownTime = " + pressADownTime);
|
||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent B down pressBDownTime = " + pressBDownTime + "--差-" + (pressBDownTime - startPressTime) + "---isCombinationKey = " + isCombinationKey + "--pressADownTime = " + pressADownTime);
|
||||
if ((pressBDownTime - startPressTime) > 320 && (pressBDownTime - startPressTime) < 1300 && pressADownTime > 0) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 B 按AB组合 ");
|
||||
@@ -291,7 +277,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
}
|
||||
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
||||
pressBUpTime = System.currentTimeMillis();
|
||||
Log.e(TAG, "dispatchKeyEvent B up pressBUpTime = " + pressBUpTime + "--差-" + (pressBUpTime - startPressTime) + "--pressADownTime = " + pressADownTime);
|
||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent B up pressBUpTime = " + pressBUpTime + "--差-" + (pressBUpTime - startPressTime) + "--pressADownTime = " + pressADownTime);
|
||||
if ((pressBUpTime - startPressTime) < 300 && isCombinationKey != 3) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 单击B 0 ");
|
||||
@@ -309,12 +295,12 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
}
|
||||
}, 300);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if (event.getKeyCode() == KeyEvent.KEYCODE_C) { //单击左变道,长按无操作
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
pressCDownTime = System.currentTimeMillis();
|
||||
if ((pressCDownTime - startPressTime) > 1320) {
|
||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 长按C 无操作 ");
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 长按C 无操作 ");
|
||||
}
|
||||
@@ -323,6 +309,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
pressCUpTime = System.currentTimeMillis();
|
||||
isPressEnd = false;
|
||||
if ((pressCUpTime - startPressTime) < 300) {
|
||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 单击C ← 向左变道 ");
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 单击C ← 向左变道 ");
|
||||
}
|
||||
@@ -334,6 +321,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
pressDDownTime = System.currentTimeMillis();
|
||||
if ((pressDDownTime - startPressTime) > 1320) {
|
||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 长按D 无操作 ");
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 长按D 无操作 ");
|
||||
}
|
||||
@@ -345,10 +333,10 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 单击D → 向右变道 ");
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 单击D → 向右变道 ");
|
||||
CallerAutoPilotManager.INSTANCE.sendOperatorChangeLaneRight();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if (event.getKeyCode() == KeyEvent.KEYCODE_E) { //单击启动自驾,长按鸣笛
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
@@ -357,6 +345,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 长按E 鸣笛 ");
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 长按E 鸣笛 ");
|
||||
CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(1);
|
||||
if (timerHorn == null) {
|
||||
timerHorn = new Timer();
|
||||
@@ -376,20 +365,18 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 单击E 开启自动驾驶 ");
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 单击E 开启自动驾驶 ");
|
||||
CallerAutoPilotManager.INSTANCE.startAutoPilot(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParameters());
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return super.dispatchKeyEvent(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSkinModeChange(int skinMode) {
|
||||
|
||||
}
|
||||
|
||||
private synchronized void sendAcc(boolean isSend, double acc) {
|
||||
@@ -413,42 +400,4 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化蓝牙广播
|
||||
*/
|
||||
private void initBluetooth() {
|
||||
this.mBluetoothReceiver = new BluetoothMonitorReceiver();
|
||||
IntentFilter intentFilter = new IntentFilter();
|
||||
// 监视蓝牙关闭和打开的状态
|
||||
intentFilter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED);
|
||||
|
||||
// 监视蓝牙设备与APP连接的状态
|
||||
intentFilter.addAction(BluetoothDevice.ACTION_ACL_DISCONNECTED);
|
||||
intentFilter.addAction(BluetoothDevice.ACTION_ACL_CONNECTED);
|
||||
|
||||
// 注册广播
|
||||
registerReceiver(this.mBluetoothReceiver, intentFilter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找蓝牙连接过的蓝牙设备
|
||||
*/
|
||||
private void showBondedDevice(BluetoothAdapter bluetoothAdapter) {
|
||||
Set<BluetoothDevice> deviceList = bluetoothAdapter.getBondedDevices();
|
||||
for (BluetoothDevice device : deviceList) {
|
||||
try {
|
||||
//使用反射调用获取设备连接状态方法
|
||||
Method isConnectedMethod = BluetoothDevice.class.getDeclaredMethod("isConnected", (Class[]) null);
|
||||
isConnectedMethod.setAccessible(true);
|
||||
// boolean isConnected = (boolean) isConnectedMethod.invoke(device, (Object[]) null);
|
||||
Log.d(TAG, "-- device.getName() = " + device.getName()); //device.getAddress()
|
||||
if (device.getName().equals("MINI_KEYBOARD")) {
|
||||
SharedPrefsMgr.getInstance(getContext()).putString("BLUETOOTH", device.getName());
|
||||
}
|
||||
} catch (NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ import com.zhjt.mogo_core_function_devatools.monitor.db.CpuInfo;
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.MemInfo;
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.MonitorDb;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
@@ -101,15 +102,25 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
new Thread(() -> {
|
||||
String lastLaunchTimeStr = SPUtils.getInstance().getString("last_launch", "");
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date currDate = new Date(System.currentTimeMillis());
|
||||
String currTimeStr = format.format(currDate);
|
||||
if (lastLaunchTimeStr != null && !lastLaunchTimeStr.isEmpty()) {
|
||||
Date currDate = new Date(System.currentTimeMillis());
|
||||
String currTimeStr = format.format(currDate);
|
||||
boolean isSameDay = currTimeStr.equals(lastLaunchTimeStr);
|
||||
// 超过一天需要清除消息盒子中的数据,并把时间戳存入SP
|
||||
if (!isSameDay) {
|
||||
this.deleteDatabase(MsgBoxDb.INTERNAL_DB_NAME);
|
||||
File file = this.getDatabasePath(MsgBoxDb.INTERNAL_DB_NAME);
|
||||
if (file != null && file.exists()) {
|
||||
this.deleteDatabase(MsgBoxDb.INTERNAL_DB_NAME);
|
||||
}
|
||||
SPUtils.getInstance().put("last_launch", currTimeStr);
|
||||
}
|
||||
} else {
|
||||
// 首次使用App或中途仅删除sp文件
|
||||
File file = this.getDatabasePath(MsgBoxDb.INTERNAL_DB_NAME);
|
||||
if (file != null && file.exists()) {
|
||||
this.deleteDatabase(MsgBoxDb.INTERNAL_DB_NAME);
|
||||
}
|
||||
SPUtils.getInstance().put("last_launch", currTimeStr);
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 153 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@@ -4,13 +4,13 @@
|
||||
android:layout_width="804px"
|
||||
android:layout_height="160px"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#1A2344"
|
||||
android:background="#53000000"
|
||||
app:roundLayoutRadius="24px"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="30px"
|
||||
android:layout_marginEnd="30px"
|
||||
android:layout_marginTop="5px"
|
||||
android:layout_marginBottom="5px"
|
||||
android:layout_marginTop="7px"
|
||||
android:layout_marginBottom="7px"
|
||||
android:clickable="true"
|
||||
>
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivBadCaseImage"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivBadCaseImage"
|
||||
android:layout_marginBottom="5px"
|
||||
android:layout_marginStart="25px"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="30px"
|
||||
@@ -68,12 +67,10 @@
|
||||
app:layout_constraintTop_toTopOf="@id/tvBagRecordTime"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvBagRecordTime"
|
||||
android:paddingEnd="25px"
|
||||
android:paddingTop="10px"
|
||||
android:paddingBottom="10px"
|
||||
android:paddingStart="20px"
|
||||
android:text="查看"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="30px"
|
||||
/>
|
||||
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -3,13 +3,13 @@
|
||||
android:layout_width="804px"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#1A2344"
|
||||
android:background="#53000000"
|
||||
app:roundLayoutRadius="24px"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="30px"
|
||||
android:layout_marginEnd="30px"
|
||||
android:layout_marginTop="5px"
|
||||
android:layout_marginBottom="5px"
|
||||
android:layout_marginTop="7px"
|
||||
android:layout_marginBottom="7px"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
@@ -30,8 +30,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivReportImageNormal"
|
||||
android:layout_marginTop="20px"
|
||||
android:layout_marginStart="25px"
|
||||
android:layout_marginTop="25px"
|
||||
android:layout_marginStart="23px"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="32px"
|
||||
/>
|
||||
@@ -45,6 +45,7 @@
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="28px"
|
||||
android:layout_marginTop="5px"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -56,12 +57,13 @@
|
||||
app:layout_constraintRight_toRightOf="@id/tvStatusSelect"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginTop="5px"
|
||||
android:layout_marginBottom="10px"
|
||||
android:layout_marginBottom="25px"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:gravity="start"
|
||||
android:textSize="28px"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -94,6 +96,7 @@
|
||||
android:layout_marginEnd="20px"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="24px"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
@@ -116,7 +119,7 @@
|
||||
app:layout_constraintLeft_toRightOf="@id/ivReportImageOpen"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="32px"
|
||||
android:layout_marginStart="20px"
|
||||
android:layout_marginStart="10px"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
@@ -126,9 +129,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/ivReportImageOpen"
|
||||
app:layout_constraintLeft_toLeftOf="@id/ivReportImageOpen"
|
||||
android:layout_marginTop="5px"
|
||||
android:layout_marginTop="10px"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="28px"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
@@ -138,9 +142,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvReportTimeOpen"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvReportTimeOpen"
|
||||
android:layout_marginTop="5px"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="28px"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
@@ -152,9 +156,9 @@
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvReportTypeOpen"
|
||||
app:layout_constraintRight_toRightOf="@id/tvStatusSelect"
|
||||
android:gravity="start"
|
||||
android:layout_marginTop="5px"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="28px"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
@@ -166,10 +170,10 @@
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvReportReasonOpen"
|
||||
app:layout_constraintRight_toRightOf="@id/tvStatusSelect"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginTop="5px"
|
||||
android:layout_marginBottom="10px"
|
||||
android:layout_marginBottom="15px"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="28px"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
android:layout_width="804px"
|
||||
android:layout_height="160px"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#1A2344"
|
||||
android:background="#53000000"
|
||||
app:roundLayoutRadius="24px"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="30px"
|
||||
android:layout_marginEnd="30px"
|
||||
android:layout_marginTop="5px"
|
||||
android:layout_marginBottom="5px"
|
||||
android:layout_marginTop="7px"
|
||||
android:layout_marginBottom="7px"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
android:layout_width="804px"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#1A2344"
|
||||
android:background="#53000000"
|
||||
app:roundLayoutRadius="24px"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="30px"
|
||||
android:layout_marginEnd="30px"
|
||||
android:layout_marginTop="5px"
|
||||
android:layout_marginBottom="5px"
|
||||
android:layout_marginTop="7px"
|
||||
android:layout_marginBottom="7px"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
@@ -35,7 +35,7 @@
|
||||
android:text="运营平台"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="32px"
|
||||
android:layout_marginStart="25px"
|
||||
android:layout_marginStart="23px"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -51,6 +51,8 @@
|
||||
android:textSize="28px"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:paddingBottom="15px"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -107,7 +109,7 @@
|
||||
android:text="运营平台"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="32px"
|
||||
android:layout_marginStart="20px"
|
||||
android:layout_marginStart="10px"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
@@ -122,6 +124,7 @@
|
||||
android:gravity="start"
|
||||
android:layout_marginTop="10px"
|
||||
android:layout_marginBottom="15px"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="28px"
|
||||
android:visibility="gone"
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
android:layout_width="804px"
|
||||
android:layout_height="160px"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#1A2344"
|
||||
android:background="#53000000"
|
||||
app:roundLayoutRadius="24px"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="30px"
|
||||
android:layout_marginEnd="30px"
|
||||
android:layout_marginTop="5px"
|
||||
android:layout_marginBottom="5px">
|
||||
android:layout_marginTop="7px"
|
||||
android:layout_marginBottom="7px">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivV2XImage"
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
android:layout_width="804px"
|
||||
android:layout_height="160px"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#1A2344"
|
||||
android:background="#53000000"
|
||||
app:roundLayoutRadius="24px"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="30px"
|
||||
android:layout_marginEnd="30px"
|
||||
android:layout_marginTop="5px"
|
||||
android:layout_marginBottom="5px">
|
||||
android:layout_marginTop="7px"
|
||||
android:layout_marginBottom="7px">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivBubbleOperationImage"
|
||||
@@ -28,7 +28,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivBubbleOperationImage"
|
||||
android:layout_marginTop="20px"
|
||||
android:layout_marginTop="25px"
|
||||
android:layout_marginStart="25px"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="32px"
|
||||
@@ -54,12 +54,12 @@
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvBubbleOperationTitle"
|
||||
app:layout_constraintRight_toRightOf="@id/tvBubbleOperationTime"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvBubbleOperationTitle"
|
||||
android:layout_marginTop="10px"
|
||||
android:gravity="start"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="28px"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -3,13 +3,13 @@
|
||||
android:layout_width="804px"
|
||||
android:layout_height="160px"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#1A2344"
|
||||
android:background="#53000000"
|
||||
app:roundLayoutRadius="24px"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="30px"
|
||||
android:layout_marginEnd="30px"
|
||||
android:layout_marginTop="5px"
|
||||
android:layout_marginBottom="5px"
|
||||
android:layout_marginTop="7px"
|
||||
android:layout_marginBottom="7px"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
@@ -29,7 +29,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivBubbleReportImage"
|
||||
android:layout_marginTop="20px"
|
||||
android:layout_marginTop="15px"
|
||||
android:layout_marginStart="25px"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="32px"
|
||||
@@ -49,13 +49,17 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBubbleReportType"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvBubbleReportTime"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvBubbleReportTime"
|
||||
android:layout_marginTop="5px"
|
||||
app:layout_constraintRight_toRightOf="@id/tvBubbleReceiveTime"
|
||||
android:layout_marginTop="6px"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="28px"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="start"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
android:id="@+id/rvBubbleList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="15px"
|
||||
android:paddingBottom="15px"
|
||||
android:paddingTop="20px"
|
||||
android:paddingBottom="20px"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
|
||||
@@ -129,6 +129,30 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/tbRainMode"
|
||||
/>
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbObuWeaknessTrafficSop"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:padding="@dimen/dp_20"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbObu"
|
||||
android:textOff="关闭路侧弱势群体预警"
|
||||
android:textOn="打开路侧弱势群体预警"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbCloudWeaknessTrafficSop"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:padding="@dimen/dp_20"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbObuWeaknessTrafficSop"
|
||||
android:textOff="开启云端弱势群体预警"
|
||||
android:textOn="关闭云端弱势群体预警"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbIPCReport"
|
||||
android:layout_width="match_parent"
|
||||
@@ -140,7 +164,7 @@
|
||||
android:textOff="开启异常上报提示"
|
||||
android:textOn="关闭异常上报提示"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbObu"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbCloudWeaknessTrafficSop"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -40,8 +40,17 @@
|
||||
android:id="@+id/viewMofangStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/blue_tooth"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_27" />
|
||||
android:layout_marginStart="@dimen/dp_8" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/viewStatusBarLeft"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="end|center"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="@dimen/dp_8"/>
|
||||
|
||||
<!--app下载进度-->
|
||||
<TextView
|
||||
@@ -51,7 +60,7 @@
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/app_download_bg"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:gravity="center"
|
||||
android:drawableLeft="@drawable/icon_download_guide"
|
||||
android:textColor="@color/background_debug"
|
||||
|
||||
@@ -101,7 +101,6 @@ object TrafficMarkerDrawer {
|
||||
fun updateITrafficThreatLevelInfo(trafficData: TrafficData) {
|
||||
CallerLogger.d(TAG,
|
||||
"trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel + "----FunctionBuildConfig.debugTrackerProvider = " + FunctionBuildConfig.debugTrackerProvider)
|
||||
// Log.e("liyz", "trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel + "----FunctionBuildConfig.debugTrackerProvider = " + FunctionBuildConfig.debugTrackerProvider)
|
||||
if (FunctionBuildConfig.debugTrackerProvider != 1) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ public class MogoObuConst {
|
||||
*/
|
||||
public static final String TAG_MOGO_OBU = "MogoObu";
|
||||
|
||||
public static final String TAG_MOGO_NEW_OBU = "MogoNewObu";
|
||||
|
||||
// OBU 场景测试
|
||||
// 场景类型
|
||||
public static String BROADCAST_OBU_TYPE_EXTRA_KEY = "obuType";
|
||||
|
||||
@@ -17,7 +17,6 @@ import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Defa
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.TooClose
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager
|
||||
import com.mogo.eagle.core.function.obu.mogo.MogoObuConst.TAG_MOGO_OBU
|
||||
import com.mogo.eagle.core.function.obu.mogo.utils.TrafficDataConvertUtilsNew
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
@@ -93,7 +92,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
*/
|
||||
override fun onConnectStatus(connectStatus: Int) {
|
||||
if (connectStatus == 0) { //断开连接
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "onConnectFail ------> ")
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onConnectFail ------> ")
|
||||
mObuStatusInfo.obuStatus = false
|
||||
mObuStatusInfo.obuHvStatus = false
|
||||
mObuStatusInfo.obuRvStatus = false
|
||||
@@ -102,7 +101,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_HV", false) }
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_RV", false) }
|
||||
} else if (connectStatus == 1) { //连接成功
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "onConnected ------> ")
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onConnected ------> ")
|
||||
mObuStatusInfo.obuStatus = true
|
||||
CallerObuListenerManager.invokeListener(mObuStatusInfo)
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", true) }
|
||||
@@ -125,7 +124,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
|
||||
if (p0 != null && p0.vehBasicsMsg != null) {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"onMogoObuHvBasics lon = ${p0.vehBasicsMsg.longitude} --- lat = ${p0.vehBasicsMsg.latitude} ---speed = ${p0.vehBasicsMsg.speed} ---heading = ${p0.vehBasicsMsg.heading} --acceleration = ${p0.vehBasicsMsg.accFourAxes.accLat} --yawRate = ${p0.vehBasicsMsg.accFourAxes.accYaw}"
|
||||
)
|
||||
val data = JSONObject()
|
||||
@@ -179,7 +178,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
CallerMapUIServiceManager.getMarkerService()?.updateITrafficLocationInfo(it)
|
||||
}
|
||||
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", data.toString())
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", data.toString())
|
||||
data.let {
|
||||
//预警信息,预警类型 threat_level 2、3
|
||||
var status = data.status
|
||||
@@ -197,7 +196,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
}
|
||||
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"onMogoObuRvWarning target_classification = ${
|
||||
getMessageDirection(data.vehBasicsMsg.targetPosition)
|
||||
} --- direction = $direction --- appId = $appId ---level = $level -- status = $status"
|
||||
@@ -233,7 +232,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
override fun onMogoObuRsiWarning(data: MogoObuRsiWarningData) {
|
||||
super.onMogoObuRsiWarning(data)
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"onMogoObuRsiWarning ------> $data"
|
||||
)
|
||||
if (data != null && data.warningMsg != null && data.warningMsg.size > 0) {
|
||||
@@ -244,7 +243,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
val level = data.warningMsg[0].warningLevel
|
||||
val direction = getMessageDirection(data.warningMsg[0].targetPosition)
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"onCvxRtiThreatIndInfo appId = $appId --status = $status --level = $level -- eventSerialNum = ${data.warningMsg[0].eventSerialNum} ---signSerialNum = ${data.warningMsg[0].signSerialNum} --- direction = $direction -- targetPosition = ${data.warningMsg[0].targetPosition}"
|
||||
)
|
||||
|
||||
@@ -400,7 +399,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
}
|
||||
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"ttsContent = $ttsContent --alertContent = $alertContent --appId = $appId ---direction = ${direction.direction} --distance = ${Math.round(data.warningMsg[0].distance)} ---eventRadius = ${Math.round(data.warningMsg[0].eventRadius)} --speedMaxLimit = ${data.warningMsg[0].speedMaxLimit.toInt()}"
|
||||
)
|
||||
when (status) {
|
||||
@@ -476,7 +475,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
super.onMogoObuRsmWarning(data)
|
||||
if (HmiBuildConfig.isShowObuWeaknessTrafficView) {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"onMogoObuRsmWarning ------> ${data.toString()}"
|
||||
)
|
||||
// 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu
|
||||
@@ -501,7 +500,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
val direction = getMessageDirection(data.participant.targetPosition)
|
||||
if (data.warningMsg != null && data.warningMsg.warningData != null && data.warningMsg.warningData.size > 0) {
|
||||
level = data.warningMsg.warningData[0].warningLevel //默认是1个
|
||||
CallerLogger.d("$M_OBU${TAG_MOGO_OBU}",
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"onMogoObuRsmWarning ---status---> ${data.status} ---data.warningMsg.warningData[0].status = ${data.warningMsg.warningData[0].status}"
|
||||
)
|
||||
|
||||
@@ -540,7 +539,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
|
||||
// 更新数据
|
||||
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)?.let {
|
||||
CallerLogger.d("$M_OBU${TAG_MOGO_OBU}", "add cvxPtcThreatIndInfo2TrafficData ---it---> $it")
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "add cvxPtcThreatIndInfo2TrafficData ---it---> $it")
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.updateITrafficThreatLevelInfo(it)
|
||||
}
|
||||
@@ -579,7 +578,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
if(isShowObuLimitSpeedView) { //默认显示obu的限速
|
||||
if (data != null) {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${TAG_MOGO_OBU}",
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"onMogoObuMapMathstatus = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit*3.6))}")
|
||||
when (data.status) {
|
||||
MogoObuConstants.STATUS.ADD -> { // 添加
|
||||
@@ -610,7 +609,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
* 获取消息的方位 车辆相关
|
||||
*/
|
||||
private fun getMessageDirection(targetClassification: Int): WarningDirectionEnum {
|
||||
// CallerLogger.d("$M_OBU${TAG_MOGO_OBU}", "预警红边:预警方向->$targetClassification")
|
||||
// CallerLogger.d("$M_OBU${TAG_MOGO_NEW_OBU}", "预警红边:预警方向->$targetClassification")
|
||||
return when (targetClassification) {
|
||||
MogoObuConstants.VEH_TARGET_POSITION.AHEAD_IN_LANE,
|
||||
MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_TOP //正前方
|
||||
@@ -656,7 +655,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
) {
|
||||
// 这里排除需要特殊定制的语音及文案外,其余的都可以使用 EventTypeEnumNew 提供的
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"handleSdkObu appId = $appId --- handleDirection = $direction ---level = $level ---status = $status"
|
||||
)
|
||||
|
||||
@@ -735,7 +734,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
MogoObuConstants.STATUS.ADD,
|
||||
MogoObuConstants.STATUS.UPDATE -> {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"appId2 = $appId --- level = $level ---ttsContent = $ttsContent --- alertContent = $alertContent --- direction = $direction"
|
||||
)
|
||||
if (level == 2 || level == 3) {
|
||||
@@ -804,7 +803,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
*/
|
||||
private fun handlerTrafficLight(appId: Int, status: Int, lights: List<SpatLight>) {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"handlerTrafficLight --- status = $status ---lights.size = ${lights.size} ---lights = $lights ---appId = $appId"
|
||||
)
|
||||
when (status) {
|
||||
@@ -839,7 +838,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
//这里需要根据真实数据确定 index 取值方式
|
||||
val currentLight = lights[0]
|
||||
CallerLogger.d(
|
||||
"$M_OBU${TAG_MOGO_OBU}",
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"currentLight = $currentLight ---currentLight.phase = ${currentLight.phaseId} ---appId = $appId"
|
||||
)
|
||||
// 闯红灯预警,绿波通行和闯红灯是互斥的
|
||||
@@ -849,7 +848,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
}
|
||||
0x1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT TODO 需要约束一个红灯周期只显示一次
|
||||
// CallerHmiManager.disableWarningV2X(0x2.toString())
|
||||
// CallerLogger.d("$M_OBU${TAG_MOGO_OBU}","changeTrafficLightStatus 闯红灯 --------> ")
|
||||
// CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}","changeTrafficLightStatus 闯红灯 --------> ")
|
||||
// ttsContent = EventTypeEnumTrafficLight.getWarningTts(appId.toString())
|
||||
// alertContent = EventTypeEnumTrafficLight.getWarningContent(appId.toString())
|
||||
// CallerHmiManager.warningV2X(
|
||||
@@ -860,7 +859,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
0x2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION TODO 需要约束一个绿灯周期只显示一次
|
||||
// CallerHmiManager.disableWarningV2X(0x1.toString())
|
||||
// CallerLogger.d(
|
||||
// "$M_OBU${TAG_MOGO_OBU}",
|
||||
// "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
// "speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}"
|
||||
// )
|
||||
// val adviceSpeed =
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.mogo.eagle.core.data.mofang
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @date 2021/12/7
|
||||
*
|
||||
*/
|
||||
object MfConstants {
|
||||
// 蓝牙名称
|
||||
const val BLUETOOTH_NAME = "BLUETOOTH_NAME"
|
||||
|
||||
// 蓝牙 ADDRESS
|
||||
const val BLUETOOTH_ADDRESS = "BLUETOOTH_ADDRESS"
|
||||
|
||||
//蓝牙连接状态
|
||||
const val BLUETOOTH_STATUS = "BLUETOOTH_STATUS"
|
||||
|
||||
|
||||
}
|
||||
@@ -296,6 +296,11 @@ interface IMoGoWaringProvider : IMoGoHmiViewProxy {
|
||||
*/
|
||||
fun updateStatusBarRightView(insert: Boolean, tag: String, viewGroup: ViewGroup)
|
||||
|
||||
/**
|
||||
* 更新(添加/删除)状态栏左侧元素
|
||||
*/
|
||||
fun updateStatusBarLeftView(insert: Boolean, tag: String, viewGroup: ViewGroup)
|
||||
|
||||
/**
|
||||
* 设置司机端消息盒子是否展示
|
||||
*/
|
||||
@@ -310,4 +315,10 @@ interface IMoGoWaringProvider : IMoGoHmiViewProxy {
|
||||
* 更新(添加/删除)下载进度
|
||||
*/
|
||||
fun updateStatusBarDownloadView(insert: Boolean, tag: String, progress: Int)
|
||||
|
||||
/**
|
||||
* 更新魔方的连接状态
|
||||
*/
|
||||
fun updateMfStatus(tag: String, status: Boolean)
|
||||
|
||||
}
|
||||
@@ -475,6 +475,13 @@ object CallerHmiManager : CallerBase() {
|
||||
waringProviderApi?.updateStatusBarRightView(insert, tag, viewGroup)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新(添加/删除)状态栏左侧元素
|
||||
*/
|
||||
fun updateStatusBarLeftView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
||||
waringProviderApi?.updateStatusBarLeftView(insert, tag, viewGroup)
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置司机端消息盒子是否展示
|
||||
*/
|
||||
@@ -488,6 +495,7 @@ object CallerHmiManager : CallerBase() {
|
||||
fun updatePassengerMsgBoxTipView(show: Boolean = false){
|
||||
waringProviderApi?.updatePassengerMsgBoxTipView(show)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新(添加/删除)状态栏右侧元素
|
||||
*/
|
||||
@@ -495,5 +503,13 @@ object CallerHmiManager : CallerBase() {
|
||||
waringProviderApi?.updateStatusBarDownloadView(insert, tag, progress)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新魔方的链接状态
|
||||
*/
|
||||
fun updateMfStatusView(tag: String, status: Boolean) {
|
||||
waringProviderApi?.updateMfStatus(tag, status)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -24,6 +24,7 @@ class SceneConstant {
|
||||
const val M_NOTICE = "M_NOTICE-"
|
||||
const val M_OBU = "M_OBU-"
|
||||
const val M_V2X = "M_V2X-"
|
||||
const val M_F = "M_F-"
|
||||
|
||||
//旧module
|
||||
const val M_OLD_ROUTE = "M_OLD_ROUTE-"
|
||||
|
||||
@@ -499,10 +499,7 @@ public final class PermissionUtils {
|
||||
} else if (type == TYPE_DRAW_OVERLAYS) {
|
||||
currentRequestCode = TYPE_DRAW_OVERLAYS;
|
||||
startOverlayPermissionActivity(activity, TYPE_DRAW_OVERLAYS);
|
||||
} else if (type == TYPE_ACCESS_FINE_LOCATION) {
|
||||
currentRequestCode = TYPE_ACCESS_FINE_LOCATION;
|
||||
startOverlayPermissionActivity(activity, TYPE_ACCESS_FINE_LOCATION);
|
||||
} else {
|
||||
} else {
|
||||
activity.finish();
|
||||
Log.e("PermissionUtils", "type is wrong.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user