Merge branch 'dev_arch_opt_3.0' into dev_robosweeper-d_app-module_221230_1.1.0
# Conflicts: # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/fragment/BaseSweeperTabFragment.java # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/fragment/SweeperFragment.java # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/presenter/SweeperPresenter.java # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/SweeperOperatePanelView.java # app_ipc_monitoring/src/main/java/com/zhidao/adas/client/DataDistribution.java # app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/MainActivity.java # app_mogo_magic_ring/src/main/java/com/zhidao/adas/magic/ui/MainActivity.java # core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoHandAdasMsgManager.java # core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/bindingcar/BindingcarProvider.java # core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt # core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/can/CanImpl.kt # core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt # core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java # core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TrafficDataView.java # core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotVehicleStateListener.kt # core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotVehicleStateListenerManager.kt # libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/OnAdasListener.java # libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/MyMessageFactory.java # libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/VehicleStateMessage.java
This commit is contained in:
@@ -56,6 +56,7 @@ dependencies {
|
||||
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
implementation rootProject.ext.dependencies.mogoaicloudtrafficlive
|
||||
implementation rootProject.ext.dependencies.material
|
||||
|
||||
kapt rootProject.ext.dependencies.androidxroomcompiler
|
||||
implementation rootProject.ext.dependencies.androidxroomruntime
|
||||
@@ -80,69 +81,40 @@ dependencies {
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
api rootProject.ext.dependencies.mogoaicloudservicesdk
|
||||
api rootProject.ext.dependencies.mogocommons
|
||||
api rootProject.ext.dependencies.modulecommon
|
||||
api rootProject.ext.dependencies.mogoserviceapi
|
||||
api rootProject.ext.dependencies.moduleservice
|
||||
api rootProject.ext.dependencies.mogoservice
|
||||
api rootProject.ext.dependencies.mogomap
|
||||
api rootProject.ext.dependencies.crashreportupgrade
|
||||
// api rootProject.ext.dependencies.crashreportbugly
|
||||
|
||||
api rootProject.ext.dependencies.mogo_core_res
|
||||
api rootProject.ext.dependencies.mogo_core_data
|
||||
api rootProject.ext.dependencies.mogo_core_utils
|
||||
api rootProject.ext.dependencies.mogo_core_network
|
||||
api rootProject.ext.dependencies.mogo_core_function_obu_mogo
|
||||
api rootProject.ext.dependencies.mogo_core_function_notice
|
||||
api rootProject.ext.dependencies.mogo_core_function_bindingcar
|
||||
api rootProject.ext.dependencies.mogo_core_function_autopilot
|
||||
api rootProject.ext.dependencies.mogo_core_function_check
|
||||
api rootProject.ext.dependencies.mogo_core_function_map
|
||||
api rootProject.ext.dependencies.mogo_core_function_v2x
|
||||
api rootProject.ext.dependencies.mogo_core_function_monitoring
|
||||
api rootProject.ext.dependencies.mogo_core_function_devatools
|
||||
api rootProject.ext.dependencies.mogo_core_function_carcorder
|
||||
api rootProject.ext.dependencies.mogo_core_function_call
|
||||
api rootProject.ext.dependencies.mogo_core_function_api
|
||||
api rootProject.ext.dependencies.mogo_core_function_msgbox
|
||||
|
||||
implementation project(':libraries:map-usbcamera')
|
||||
implementation project(':libraries:mogo-adas-other')
|
||||
} else {
|
||||
api project(':foudations:mogo-aicloud-services-sdk')
|
||||
api project(':foudations:mogo-commons')
|
||||
api project(':modules:mogo-module-common')
|
||||
api project(':services:mogo-service-api')
|
||||
api project(':services:mogo-service')
|
||||
|
||||
api project(':libraries:mogo-map')
|
||||
api project(':test:crashreport-upgrade')
|
||||
// api project(':test:crashreport-bugly')
|
||||
api project(':test:crashreport-apmbyte')
|
||||
|
||||
api project(':core:mogo-core-res')
|
||||
api project(':core:mogo-core-data')
|
||||
api project(':core:mogo-core-utils')
|
||||
api project(':core:function-impl:mogo-core-function-obu-mogo')
|
||||
api project(':core:function-impl:mogo-core-function-autopilot')
|
||||
api project(':core:function-impl:mogo-core-function-check')
|
||||
api project(':core:function-impl:mogo-core-function-map')
|
||||
api project(':core:function-impl:mogo-core-function-notice')
|
||||
api project(':core:function-impl:mogo-core-function-v2x')
|
||||
api project(':core:function-impl:mogo-core-function-monitoring')
|
||||
api project(':core:function-impl:mogo-core-function-devatools')
|
||||
api project(':core:function-impl:mogo-core-function-carcorder')
|
||||
api project(':core:function-impl:mogo-core-function-dispatch')
|
||||
api project(':core:function-impl:mogo-core-function-chat')
|
||||
api project(':core:function-impl:mogo-core-function-bindingcar')
|
||||
api project(':core:function-impl:mogo-core-function-msgbox')
|
||||
api project(':core:function-impl:mogo-core-function-datacenter')
|
||||
api project(':core:function-impl:mogo-core-function-biz')
|
||||
|
||||
api project(':core:mogo-core-function-call')
|
||||
api project(':core:mogo-core-function-api')
|
||||
|
||||
api project(':libraries:mogo-adas')
|
||||
api project(':libraries:map-usbcamera')
|
||||
api project(':libraries:mogo-adas-other')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
@@ -65,19 +65,66 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name="com.mogo.eagle.core.function.main.PassengerLauncherActivity"
|
||||
android:clearTaskOnLaunch="${ACTIVITY_ROOT}"
|
||||
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:process=":passenger"
|
||||
android:resizeableActivity="false"
|
||||
android:resumeWhilePausing="true"
|
||||
android:screenOrientation="landscape"
|
||||
android:stateNotNeeded="true"
|
||||
android:theme="@style/Main"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden">
|
||||
<!--<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<!–调试用,暂时开启LAUNCHER这个属性–>
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
<category android:name="android.intent.category.LAUNCHER_APP" />
|
||||
<category android:name="android.intent.category.HOME" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>-->
|
||||
<intent-filter>
|
||||
<data
|
||||
android:host="launcher"
|
||||
android:path="/main/switch2"
|
||||
android:scheme="mogo" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name="com.mogo.eagle.core.function.main.VideoAdAtc"
|
||||
android:clearTaskOnLaunch="${ACTIVITY_ROOT}"
|
||||
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:process=":video_ad"
|
||||
android:resizeableActivity="false"
|
||||
android:resumeWhilePausing="true"
|
||||
android:screenOrientation="landscape"
|
||||
android:stateNotNeeded="true"
|
||||
android:theme="@style/Main"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden">
|
||||
<intent-filter>
|
||||
<data
|
||||
android:host="launcher"
|
||||
android:path="/main/switch2"
|
||||
android:scheme="mogo" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<meta-data
|
||||
android:name="MAP_SDK_VERSION111111"
|
||||
android:value="${MAP_SDK_VERSION}" />
|
||||
|
||||
<service
|
||||
android:name="com.mogo.eagle.core.function.main.service.MogoMainService"
|
||||
android:enabled="true"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.mogo.launcher.action.MAIN_SERVICE" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<receiver android:name="com.mogo.eagle.core.function.hmi.receiver.V2XWarningBroadcastReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.hmi.v2x.notification" />
|
||||
@@ -126,5 +173,18 @@
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name="com.mogo.eagle.core.function.hmi.receiver.NoticeBroadcastReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.hmi.notice.control" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name="com.mogo.eagle.core.function.hmi.receiver.DispatchTestPanelBroadCastReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.dispatch.test_panel_control" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -4,9 +4,7 @@ import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBindingcarDialog
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBrakeLight
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showModifyBindingcarDialog
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showTurnLight
|
||||
|
||||
/**
|
||||
* 绑定车辆
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.mogo.eagle.core.function.hmi.receiver
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager
|
||||
import com.mogo.eagle.core.function.hmi.receiver.DispatchTestPanelBroadCastReceiver
|
||||
import java.lang.Exception
|
||||
|
||||
class DispatchTestPanelBroadCastReceiver : BroadcastReceiver() {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "DispatchTestPanelBroadCastReceiver"
|
||||
|
||||
/**
|
||||
* Adas测试控制面板广播Action
|
||||
*/
|
||||
const val BROADCAST_TEST_PANEL_CONTROL_TYPE_EXTRA_KEY = "sceneType"
|
||||
}
|
||||
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
try {
|
||||
val sceneType = intent.getIntExtra(BROADCAST_TEST_PANEL_CONTROL_TYPE_EXTRA_KEY, 0)
|
||||
// 分发场景
|
||||
dispatchSceneTest(sceneType)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分发处理场景
|
||||
*
|
||||
* @param sceneType 场景类型
|
||||
*/
|
||||
private fun dispatchSceneTest(sceneType: Int) {
|
||||
CallerFuncBizManager.bizProvider.testDispatch(sceneType)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.mogo.eagle.core.function.hmi.receiver
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
|
||||
/**
|
||||
* @author Jing
|
||||
* @description 测试类
|
||||
* @since: 10/29/21
|
||||
*/
|
||||
class NoticeBroadcastReceiver : BroadcastReceiver() {
|
||||
private var mContext: Context? = null
|
||||
|
||||
override fun onReceive(context: Context?, intent: Intent) {
|
||||
try {
|
||||
mContext = context
|
||||
val sceneType = intent.getIntExtra("sceneType", 0)
|
||||
// 分发场景
|
||||
dispatchSceneTest(sceneType)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
private fun dispatchSceneTest(sceneType: Int) {
|
||||
if (sceneType == 301001) {
|
||||
val pushData = NoticeTrafficStylePushData()
|
||||
pushData.msg = "交警任务公告"
|
||||
pushData.title = "北京市顺义区北小营镇北小营市场发生交通事故,请警务人员前往处理"
|
||||
//图片
|
||||
val image: String = "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fitem%2F201609%2F26%2F20160926081306_GM2tv.thumb.1000_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1638511084&t=92def7498b526dcba3fceda17c43fcb8"
|
||||
//视频
|
||||
val video: String = "https://view.2amok.com/20200219/012d8e2a55f227e90d76056bb6aab5e4.mp4"
|
||||
pushData.poiImgUrl = video
|
||||
pushData.type = 1
|
||||
pushData.infoId = "909754135789686784"
|
||||
CallerHmiManager.showTrafficBanner(pushData)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,6 +33,7 @@ import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_RTS
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I
|
||||
import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.enums.SidePattern
|
||||
import com.mogo.eagle.core.data.enums.SidePattern.*
|
||||
@@ -52,18 +53,16 @@ import com.mogo.eagle.core.function.api.hmi.view.IOchBusView
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewLimitingVelocity
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewNotification
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWaringProvider
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoHmiProvider
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager
|
||||
import com.mogo.eagle.core.function.call.check.CallerCheckManager
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.*
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Turning
|
||||
import com.mogo.eagle.core.function.call.monitor.CallerMonitorManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
|
||||
@@ -73,8 +72,9 @@ import com.mogo.eagle.core.function.hmi.ui.bindingcar.ToBindingCarDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.bindingcar.UpgradeAppDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.camera.CameraListView
|
||||
import com.mogo.eagle.core.function.hmi.ui.camera.RoadVideoDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.dispatch.DispatchDialogManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeCheckDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeTrafficDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.traffic.NoticeTrafficDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.DebugSettingView
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.IPCReportWindow
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ReportListFloatWindow
|
||||
@@ -85,7 +85,7 @@ import com.mogo.eagle.core.function.hmi.ui.tools.MaskView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.V2XNotificationView
|
||||
import com.mogo.eagle.core.function.main.utils.DisplayEffectsHelper
|
||||
import com.mogo.eagle.core.function.main.DisplayEffectsHelper
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.*
|
||||
@@ -120,7 +120,7 @@ import java.util.*
|
||||
*/
|
||||
@Route(path = MoGoFragmentPaths.PATH_FRAGMENT_HMI)
|
||||
class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
IMoGoWaringProvider,
|
||||
IMoGoHmiProvider,
|
||||
IMoGoHmiViewProxy,
|
||||
MoGoHmiContract.View,
|
||||
IMoGoAutopilotRecordListener,
|
||||
@@ -210,7 +210,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
|
||||
ivCameraIcon?.setOnClickListener {
|
||||
if (cameraViewFloat == null) {
|
||||
showCameraList(CallerMonitorManager.getCameraList())
|
||||
showCameraList(CallerFuncBizManager.bizProvider.getCameraList)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,13 +254,13 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
}
|
||||
|
||||
cbMsgBoxDriver.setOnCheckedChangeListener { _, isChecked ->
|
||||
if(isChecked){
|
||||
if (isChecked) {
|
||||
viewDriverMsgBoxList.visibility = View.VISIBLE
|
||||
viewDriverMsgBoxList.notifyData()
|
||||
viewDriverMsgBoxBubble.visibility = View.GONE
|
||||
viewDriverMsgBoxBubble.isShowData(false)
|
||||
CallerHmiManager.updateDriverMsgBoxTipView(false)
|
||||
}else{
|
||||
} else {
|
||||
viewDriverMsgBoxList.visibility = View.GONE
|
||||
viewDriverMsgBoxBubble.visibility = View.VISIBLE
|
||||
viewDriverMsgBoxBubble.isShowData(true)
|
||||
@@ -268,24 +268,25 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
}
|
||||
|
||||
cbMsgBoxPassenger.setOnCheckedChangeListener { _, isChecked ->
|
||||
if(isChecked){
|
||||
if (isChecked) {
|
||||
viewPassengerMsgBoxList.visibility = View.VISIBLE
|
||||
viewPassengerMsgBoxBubble.visibility = View.GONE
|
||||
viewPassengerMsgBoxBubble.isShowData(false)
|
||||
CallerHmiManager.updatePassengerMsgBoxTipView(false)
|
||||
}else{
|
||||
} else {
|
||||
viewPassengerMsgBoxList.visibility = View.GONE
|
||||
viewPassengerMsgBoxBubble.visibility = View.VISIBLE
|
||||
viewPassengerMsgBoxBubble.isShowData(true)
|
||||
}
|
||||
}
|
||||
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
cbMsgBoxDriver.visibility = View.VISIBLE
|
||||
viewDriverMsgBoxBubble.visibility = View.VISIBLE
|
||||
}
|
||||
if(AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)
|
||||
) {
|
||||
cbMsgBoxPassenger.visibility = View.VISIBLE
|
||||
viewPassengerMsgBoxBubble.visibility = View.VISIBLE
|
||||
}
|
||||
@@ -468,18 +469,33 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
statusBarView?.updateMfStatus(tag, status)
|
||||
}
|
||||
|
||||
override fun showDispatchDialog(msgData: DispatchAdasAutoPilotLocReceiverBean) {
|
||||
context?.let {
|
||||
if (DispatchDialogManager.getInstance(it).isShowing) {
|
||||
return
|
||||
}
|
||||
DispatchDialogManager.getInstance(it).showDialog(msgData)
|
||||
}
|
||||
}
|
||||
|
||||
override fun dismissDispatchDialog() {
|
||||
context?.let {
|
||||
DispatchDialogManager.getInstance(it).releaseDialog()
|
||||
}
|
||||
}
|
||||
|
||||
override fun updateDriverMsgBoxTipView(show: Boolean) {
|
||||
if(show){
|
||||
if (show) {
|
||||
MsgBoxTipView.visibility = View.VISIBLE
|
||||
}else{
|
||||
} else {
|
||||
MsgBoxTipView.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun updatePassengerMsgBoxTipView(show: Boolean) {
|
||||
if(show){
|
||||
if (show) {
|
||||
MsgBoxPTipView.visibility = View.VISIBLE
|
||||
}else{
|
||||
} else {
|
||||
MsgBoxPTipView.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
@@ -504,12 +520,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
if (toolsView == null) {
|
||||
toolsView = AutoPilotAndCheckView(it)
|
||||
toolsView!!.setClickListener(object : AutoPilotAndCheckView.ClickListener {
|
||||
override fun go2CheckPage() {
|
||||
// 启动检测页面
|
||||
CallerCheckManager.startCheckActivity(context)
|
||||
dismissToolsFloatView()
|
||||
}
|
||||
|
||||
override fun onClose(v: View) {
|
||||
dismissToolsFloatView()
|
||||
}
|
||||
@@ -1162,7 +1172,11 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
}
|
||||
ThreadUtils.runOnUiThread {
|
||||
context?.let {
|
||||
noticeTrafficDialog = NoticeTrafficDialog(it, trafficStylePushData)
|
||||
noticeTrafficDialog =
|
||||
NoticeTrafficDialog(
|
||||
it,
|
||||
trafficStylePushData
|
||||
)
|
||||
noticeTrafficDialog?.show()
|
||||
}
|
||||
}
|
||||
@@ -1289,7 +1303,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
dismissFloatView()
|
||||
// 丢弃开启摄像头推流请求,同时monitor回调hmi的startRoadCameraLive()
|
||||
// 也做了cameraListView的非空判断
|
||||
CallerMonitorManager.disposeCameraStream()
|
||||
CallerFuncBizManager.bizProvider.closeCameraLive()
|
||||
}
|
||||
|
||||
override fun onShowLive(isShow: Boolean) {
|
||||
@@ -1300,7 +1314,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
}
|
||||
|
||||
override fun refreshCameraList() {
|
||||
cameraListView?.refreshCameraList(CallerMonitorManager.getCameraList())
|
||||
cameraListView?.refreshCameraList(CallerFuncBizManager.bizProvider.getCameraList)
|
||||
}
|
||||
})
|
||||
cameraViewFloat = WarningFloat.with(it)
|
||||
@@ -1379,7 +1393,10 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
* 显示转向灯效果 if (HmiBuildConfig.isShowBadCaseView) {
|
||||
*/
|
||||
override fun showTurnLight(light: Int) {
|
||||
CallerLogger.d("${SceneConstant.M_DEVA}${"TurnLight"}", "---showTurnLight = $light ---isLeftLight = $isLeftLight ---isRightLight = $isRightLight")
|
||||
CallerLogger.d(
|
||||
"${SceneConstant.M_DEVA}${"TurnLight"}",
|
||||
"---showTurnLight = $light ---isLeftLight = $isLeftLight ---isRightLight = $isRightLight"
|
||||
)
|
||||
if (HmiBuildConfig.isShowTurnLightView) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (light == 1 || light == 2) {
|
||||
@@ -1398,7 +1415,10 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
isLeftLight = true
|
||||
isRightLight = false
|
||||
isDisappare = false
|
||||
CallerLogger.d("${SceneConstant.M_DEVA}${"TurnLight"}", "---showTurnLight ---light = 1")
|
||||
CallerLogger.d(
|
||||
"${SceneConstant.M_DEVA}${"TurnLight"}",
|
||||
"---showTurnLight ---light = 1"
|
||||
)
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(4, 500)
|
||||
}
|
||||
} else if (light == 2) { //右转灯
|
||||
@@ -1406,7 +1426,10 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
isRightLight = true
|
||||
isLeftLight = false
|
||||
isDisappare = false
|
||||
CallerLogger.d("${SceneConstant.M_DEVA}${"TurnLight"}", "---showTurnLight ---light = 2")
|
||||
CallerLogger.d(
|
||||
"${SceneConstant.M_DEVA}${"TurnLight"}",
|
||||
"---showTurnLight ---light = 2"
|
||||
)
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500)
|
||||
}
|
||||
} else {
|
||||
@@ -1414,7 +1437,10 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
isDisappare = true
|
||||
isLeftLight = false
|
||||
isRightLight = false
|
||||
CallerLogger.d("${SceneConstant.M_DEVA}${"TurnLight"}", "---showTurnLight ---light other")
|
||||
CallerLogger.d(
|
||||
"${SceneConstant.M_DEVA}${"TurnLight"}",
|
||||
"---showTurnLight ---light other"
|
||||
)
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500)
|
||||
}
|
||||
}
|
||||
@@ -1426,33 +1452,10 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
}
|
||||
}
|
||||
|
||||
private var isBrake: Boolean = false
|
||||
|
||||
/**
|
||||
* 显示刹车效果
|
||||
*/
|
||||
override fun showBrakeLight(light: Int) {
|
||||
if (HmiBuildConfig.isShowBrakeLightView) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (light == 1) { //刹车灯亮
|
||||
if (!isBrake) {
|
||||
isBrake = true
|
||||
CallerLogger.d("${SceneConstant.M_DEVA}${"BrakeLight"}", " showBrakeLight light = 1 ")
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(0, 500)
|
||||
}
|
||||
} else {
|
||||
if (isBrake) {//默认 不亮灯
|
||||
isBrake = false
|
||||
CallerLogger.d("${SceneConstant.M_DEVA}${"BrakeLight"}", " showBrakeLight light != 1 ")
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500)
|
||||
}
|
||||
}
|
||||
|
||||
// brakeView?.let {
|
||||
// brakeView.setBrakeLight(light)
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var modifyBindingCarDialog: ModifyBindingCarDialog? = null
|
||||
@@ -1463,14 +1466,14 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
if (toBindingCarDialog == null) {
|
||||
toBindingCarDialog = ToBindingCarDialog(requireContext())
|
||||
}
|
||||
toBindingCarDialog!!.showToBindingcarDialog()
|
||||
toBindingCarDialog!!.showToBindingCarDialog()
|
||||
}
|
||||
|
||||
override fun showModifyBindingcarDialog() {
|
||||
if (modifyBindingCarDialog == null) {
|
||||
modifyBindingCarDialog = ModifyBindingCarDialog(requireContext())
|
||||
}
|
||||
modifyBindingCarDialog!!.showModifyBindingcarDialog()
|
||||
modifyBindingCarDialog!!.showModifyBindingCarDialog()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1509,8 +1512,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
adUpgradeDialog?.setClickListener(object : AdUpgradeDialog.ClickListener {
|
||||
override fun confirm() {
|
||||
//确认升级
|
||||
CallerBindingcarManager.getBindingcarProvider()
|
||||
.upgradeConfirm(images, padSn, releaseId)
|
||||
CallerDevaToolsManager.upgradeConfirm(images, padSn, releaseId)
|
||||
AdUpgradeStateHelper.setConfirmUpgrade(true)
|
||||
ToastUtils.showLong("最新版本下载中...")
|
||||
adUpgradeDialog?.dismiss()
|
||||
|
||||
@@ -6,7 +6,7 @@ import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.module.status.StatusDescriptor
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
@@ -18,13 +18,16 @@ import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
*/
|
||||
class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||
|
||||
private val TAG = "BindingCarDialog"
|
||||
companion object{
|
||||
private const val TAG = "BindingCarDialog"
|
||||
}
|
||||
|
||||
private var confirmTv: TextView? = null
|
||||
private var cancelTv: TextView? = null
|
||||
|
||||
private val statusChangedListenerForCheckNotice =
|
||||
IMogoStatusChangedListener { descriptor, isTrue ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND) {
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
@@ -37,7 +40,7 @@ class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifec
|
||||
cancelTv = findViewById(R.id.tv_bindingcar_cancel)
|
||||
|
||||
confirmTv?.setOnClickListener {
|
||||
modifyBindingcar()
|
||||
modifyBindingCar()
|
||||
}
|
||||
|
||||
cancelTv?.setOnClickListener {
|
||||
@@ -54,8 +57,8 @@ class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifec
|
||||
/**
|
||||
* 修改绑定车机
|
||||
*/
|
||||
fun modifyBindingcar() {
|
||||
CallerBindingcarManager.getBindingcarProvider().modifyCarInfo {
|
||||
private fun modifyBindingCar() {
|
||||
CallerDevaToolsManager.modifyCarInfo{
|
||||
if (it.code == 200) {
|
||||
TipToast.shortTip("修改绑定成功")
|
||||
} else {
|
||||
@@ -74,11 +77,10 @@ class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifec
|
||||
)
|
||||
}
|
||||
|
||||
fun showModifyBindingcarDialog() {
|
||||
fun showModifyBindingCarDialog() {
|
||||
if (isShowing) {
|
||||
return
|
||||
}
|
||||
|
||||
show()
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.module.status.StatusDescriptor
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
@@ -18,12 +18,15 @@ import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
*/
|
||||
class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver{
|
||||
|
||||
private val TAG = "ToBindingCarDialog"
|
||||
companion object{
|
||||
private const val TAG = "ToBindingCarDialog"
|
||||
}
|
||||
|
||||
private var confirmTv: TextView? = null
|
||||
private var cancelTv: TextView? = null
|
||||
|
||||
private val statusChangedListenerForCheckNotice = IMogoStatusChangedListener { descriptor, isTrue ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND) {
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
@@ -36,7 +39,7 @@ class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifecycle
|
||||
cancelTv = findViewById(R.id.tv_to_bindingcar_cancel)
|
||||
|
||||
confirmTv?.setOnClickListener {
|
||||
toBindingcar()
|
||||
toBindingCar()
|
||||
}
|
||||
|
||||
cancelTv?.setOnClickListener {
|
||||
@@ -53,8 +56,8 @@ class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifecycle
|
||||
/**
|
||||
* 修改绑定车机
|
||||
*/
|
||||
fun toBindingcar() {
|
||||
CallerBindingcarManager.getBindingcarProvider().modifyCarInfo {
|
||||
private fun toBindingCar() {
|
||||
CallerDevaToolsManager.modifyCarInfo{
|
||||
if (it.code == 200) {
|
||||
TipToast.shortTip("绑定成功")
|
||||
} else {
|
||||
@@ -73,11 +76,10 @@ class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifecycle
|
||||
)
|
||||
}
|
||||
|
||||
fun showToBindingcarDialog() {
|
||||
fun showToBindingCarDialog() {
|
||||
if (isShowing) {
|
||||
return
|
||||
}
|
||||
|
||||
show()
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.cloud.trafficlive.api.ITrafficCarLiveCallBack
|
||||
import com.mogo.cloud.trafficlive.api.MoGoAiCloudTrafficLive
|
||||
import com.mogo.eagle.core.data.camera.CameraEntity
|
||||
import com.mogo.eagle.core.function.call.monitor.CallerMonitorManager
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
@@ -107,7 +107,7 @@ class CameraListView : FrameLayout {
|
||||
gsyVideoPlay(cameraEntity.flvUrl!!)
|
||||
} else if (!cameraEntity.ip.isNullOrEmpty()) {
|
||||
CallerLogger.d("$M_HMI$TAG", "打开推流的摄像头ip为:${cameraEntity.ip}")
|
||||
CallerMonitorManager.openCameraStream(cameraEntity.ip!!)
|
||||
CallerFuncBizManager.bizProvider.openCameraStream(cameraEntity.ip!!)
|
||||
} else {
|
||||
CallerLogger.e("$M_HMI$TAG", "摄像头视频播放地址和ip均为空")
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import android.view.View
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.eagle.core.data.map.Infrastructure
|
||||
import com.mogo.eagle.core.function.call.monitor.CallerMonitorManager
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
@@ -88,7 +88,7 @@ class RoadVideoDialog(context: Context) : BaseFloatDialog(context), LifecycleObs
|
||||
private fun playVideo(ip: String) {
|
||||
roadVideoPB.visibility = View.VISIBLE
|
||||
tvCameraDesc.visibility = View.GONE
|
||||
CallerMonitorManager.openCameraStream(ip, { flvUrl ->
|
||||
CallerFuncBizManager.bizProvider.openCameraStream(ip, { flvUrl ->
|
||||
gsyVideoPlay(flvUrl)
|
||||
}) {
|
||||
roadVideoPB.visibility = View.GONE
|
||||
|
||||
@@ -1,251 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.carcorder
|
||||
|
||||
import android.animation.Animator
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.hardware.usb.UsbDevice
|
||||
import android.os.Looper
|
||||
import android.view.*
|
||||
import android.view.animation.OvershootInterpolator
|
||||
import com.mogo.cloud.live.manager.ILiveStreamManager
|
||||
import com.mogo.cloud.live.manager.LiveStreamManagerImpl
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
|
||||
import com.mogo.eagle.core.function.hmi.notification.anim.DefaultAnimator
|
||||
import com.mogo.eagle.core.data.enums.SidePattern
|
||||
import com.mogo.usbcamera.UVCCameraHelper
|
||||
import com.serenegiant.usb.ParentPreviewConstraintLayout
|
||||
import com.serenegiant.usb.widget.CameraViewInterface
|
||||
import kotlinx.android.synthetic.main.view_carcorder_preview.view.*
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @date 2021/9/30 8:46 下午
|
||||
* USB-Camera 摄像头预览
|
||||
*
|
||||
* TODO 临时方案,后面考虑封装将摄像头数据流通过 Tensorflow-lite 处理后展示
|
||||
*/
|
||||
class CarcorderPreviewView private constructor(
|
||||
context: Context
|
||||
) : ParentPreviewConstraintLayout(context),
|
||||
CameraViewInterface.Callback {
|
||||
|
||||
private val TAG = "CarcorderPreviewView"
|
||||
|
||||
|
||||
private var mCameraHelper: UVCCameraHelper? = null
|
||||
|
||||
private var isRequest = false
|
||||
private var isPreview = false
|
||||
|
||||
private var liveStreamManager: ILiveStreamManager? = null
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_carcorder_preview, this, true)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private var mCarcorderPreviewViewFloat: WarningFloat.Builder? = null
|
||||
|
||||
@Volatile
|
||||
var instance: CarcorderPreviewView? = null
|
||||
|
||||
fun getInstance(context: Activity): CarcorderPreviewView {
|
||||
if (instance == null) {
|
||||
synchronized(CarcorderPreviewView::class) {
|
||||
if (instance == null) {
|
||||
instance = CarcorderPreviewView(context)
|
||||
}
|
||||
}
|
||||
}
|
||||
return instance!!
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示窗口
|
||||
*/
|
||||
fun show(context: Activity) {
|
||||
if (mCarcorderPreviewViewFloat == null) {
|
||||
val carcorderPreviewVie = getInstance(context)
|
||||
mCarcorderPreviewViewFloat = WarningFloat.with(context)
|
||||
.setTag("CarcorderPreviewView")
|
||||
.setLayout(carcorderPreviewVie)
|
||||
.setSidePattern(SidePattern.RIGHT)
|
||||
.setGravity(Gravity.RIGHT, offsetY = 250)
|
||||
.setImmersionStatusBar(true)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: WindowManager.LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: WindowManager.LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.show()
|
||||
} else {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐藏窗口
|
||||
*/
|
||||
fun dismiss() {
|
||||
if (mCarcorderPreviewViewFloat != null) {
|
||||
WarningFloat.dismiss(mCarcorderPreviewViewFloat!!.config.floatTag, false)
|
||||
mCarcorderPreviewViewFloat = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val listener: UVCCameraHelper.OnMyDevConnectListener = object : UVCCameraHelper.OnMyDevConnectListener {
|
||||
override fun onAttachDev(device: UsbDevice?) {
|
||||
CallerLogger.d("$M_HMI$TAG", "onAttachDev")
|
||||
// request open permission
|
||||
if (!isRequest) {
|
||||
isRequest = true
|
||||
mCameraHelper?.requestPermission(0)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDettachDev(device: UsbDevice) {
|
||||
CallerLogger.d("$M_HMI$TAG", "onDettachDev")
|
||||
// close camera
|
||||
if (isRequest) {
|
||||
isRequest = false
|
||||
mCameraHelper?.closeCamera()
|
||||
showShortMsg(device.deviceName + " is out")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onConnectDev(device: UsbDevice?, isConnected: Boolean) {
|
||||
CallerLogger.d("$M_HMI$TAG", "onConnectDev:isConnected=$isConnected")
|
||||
if (!isConnected) {
|
||||
showShortMsg("fail to connect,please check resolution params")
|
||||
isPreview = false
|
||||
} else {
|
||||
isPreview = true
|
||||
showShortMsg("相机连接中")
|
||||
// initialize seekbar
|
||||
// need to wait UVCCamera initialize over
|
||||
Thread {
|
||||
try {
|
||||
Thread.sleep(2500)
|
||||
} catch (e: InterruptedException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
Looper.prepare()
|
||||
if (mCameraHelper != null && mCameraHelper!!.isCameraOpened) {
|
||||
CallerLogger.d("$M_HMI$TAG", "亮度(brightness):${mCameraHelper!!.getModelValue(UVCCameraHelper.MODE_BRIGHTNESS)}")
|
||||
CallerLogger.d("$M_HMI$TAG", "对比度(contrast):${mCameraHelper!!.getModelValue(UVCCameraHelper.MODE_CONTRAST)}")
|
||||
}
|
||||
Looper.loop()
|
||||
}.start()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDisConnectDev(device: UsbDevice?) {
|
||||
CallerLogger.d("$M_HMI$TAG", "onDisConnectDev")
|
||||
showShortMsg("相机断开连接")
|
||||
}
|
||||
|
||||
override fun onCancelDev(device: UsbDevice?) {
|
||||
CallerLogger.d("$M_HMI$TAG", "onCancelDev:" + device?.deviceName)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun showShortMsg(msg: String) {
|
||||
//Toast.makeText(context, msg, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
// step.1 initialize UVCCameraHelper
|
||||
carcorderPreview.setCallback(this)
|
||||
mCameraHelper = UVCCameraHelper.getInstance()
|
||||
mCameraHelper?.setDefaultFrameFormat(UVCCameraHelper.FRAME_FORMAT_MJPEG)
|
||||
mCameraHelper?.initUSBMonitor(context as Activity, carcorderPreview, listener)
|
||||
|
||||
mCameraHelper?.setOnPreviewFrameListener { nv21Yuv ->
|
||||
CallerLogger.d("$M_HMI$TAG", "onPreviewResult: " + nv21Yuv.size)
|
||||
if (liveStreamManager != null) {
|
||||
// 将摄像头采集的YUV数据推送到ZEGO
|
||||
liveStreamManager!!.notifyYUVData(nv21Yuv, 640, 480, 2)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
initView()
|
||||
// step.2 register USB event broadcast
|
||||
if (mCameraHelper != null) {
|
||||
mCameraHelper!!.registerUSB()
|
||||
}
|
||||
// 初始化直播流管理
|
||||
// 初始化直播流管理
|
||||
liveStreamManager = LiveStreamManagerImpl.getInstance((context as Activity).application,
|
||||
MoGoAiCloudClientConfig.getInstance().sn, true)
|
||||
|
||||
// 设置状态回调
|
||||
liveStreamManager!!.setLiveStatusChangeCallback { status ->
|
||||
if (status == 0) {
|
||||
CallerLogger.d("$M_HMI$TAG", "直播中……")
|
||||
} else {
|
||||
CallerLogger.d("$M_HMI$TAG", "直播结束……")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
// step.3 unregister USB event broadcast
|
||||
if (mCameraHelper != null) {
|
||||
mCameraHelper!!.unregisterUSB()
|
||||
}
|
||||
|
||||
if (liveStreamManager != null) {
|
||||
// 停止
|
||||
liveStreamManager!!.stopLiveStream()
|
||||
// 释放资源
|
||||
liveStreamManager!!.release()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSurfaceCreated(view: CameraViewInterface?, surface: Surface?) {
|
||||
if (!isPreview && mCameraHelper!!.isCameraOpened) {
|
||||
mCameraHelper!!.startPreview(carcorderPreview)
|
||||
isPreview = true
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSurfaceChanged(view: CameraViewInterface?, surface: Surface?, width: Int, height: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun onSurfaceDestroy(view: CameraViewInterface?, surface: Surface?) {
|
||||
if (isPreview && mCameraHelper!!.isCameraOpened) {
|
||||
mCameraHelper!!.stopPreview()
|
||||
isPreview = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.dispatch;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean;
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
|
||||
public class DispatchAirportDialog extends DispatchBaseDialog {
|
||||
|
||||
private final TextView tvStartLoc;
|
||||
private final TextView tvEndLoc;
|
||||
private final TextView tvTaskTime;
|
||||
private final TextView tvFlightInfo;
|
||||
private final TextView tvTaskContent;
|
||||
|
||||
public DispatchAirportDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
setContentView(R.layout.dialog_adas_dispatch_airport);
|
||||
setCanceledOnTouchOutside(false);
|
||||
tvStartLoc = findViewById(R.id.module_services_dispatch_dialog_start_content);
|
||||
tvEndLoc = findViewById(R.id.module_services_dispatch_dialog_end_content);
|
||||
tvTaskTime = findViewById(R.id.module_services_dispatch_dialog_task_time);
|
||||
tvFlightInfo = findViewById(R.id.module_services_dispatch_dialog_flight_time);
|
||||
tvTaskContent = findViewById(R.id.module_services_dispatch_dialog_task_content);
|
||||
Button btnAffirm = findViewById(R.id.module_services_dispatch_dialog_confirm);
|
||||
btnAffirm.setOnClickListener(v -> {
|
||||
CallerFuncBizManager.getBizProvider().dispatchAffirm();
|
||||
dismissDialog();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showDialog(DispatchAdasAutoPilotLocReceiverBean dispatchContent) {
|
||||
show();
|
||||
if (!TextUtils.isEmpty(dispatchContent.getStartLocAddress())) {
|
||||
tvStartLoc.setText(dispatchContent.getStartLocAddress());
|
||||
}
|
||||
if (!TextUtils.isEmpty(dispatchContent.getEndLocAddress())) {
|
||||
tvEndLoc.setText(dispatchContent.getEndLocAddress());
|
||||
}
|
||||
if (!TextUtils.isEmpty(dispatchContent.getTaskTime())) {
|
||||
tvTaskTime.setText(dispatchContent.getTaskTime());
|
||||
}
|
||||
if (!TextUtils.isEmpty(dispatchContent.getFlightInfo())) {
|
||||
tvFlightInfo.setText(dispatchContent.getFlightInfo());
|
||||
}
|
||||
if (!TextUtils.isEmpty(dispatchContent.getTaskInfo())) {
|
||||
tvTaskContent.setText(dispatchContent.getTaskInfo());
|
||||
}
|
||||
}
|
||||
|
||||
private void dismissDialog() {
|
||||
dismiss();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.dispatch;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
|
||||
public abstract class DispatchBaseDialog extends Dialog {
|
||||
|
||||
public DispatchBaseDialog(@NonNull Context context) {
|
||||
super(context, R.style.Base_AlertDialog_AppCompat);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
|
||||
} else {
|
||||
getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
|
||||
}
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
|
||||
| WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION
|
||||
| WindowManager.LayoutParams.FLAG_LOCAL_FOCUS_MODE);
|
||||
}
|
||||
|
||||
public abstract void showDialog(DispatchAdasAutoPilotLocReceiverBean dispatchContent);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.dispatch;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean;
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
|
||||
|
||||
public class DispatchCarsDialog extends DispatchBaseDialog {
|
||||
|
||||
private static final int MSG_TYPE_TIMER = 0;
|
||||
private static int TIMER = 10;
|
||||
|
||||
private final TextView tvTimer;
|
||||
private final TextView tvLoc;
|
||||
|
||||
private final Handler handler = new Handler() {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
if (msg.what == MSG_TYPE_TIMER) {
|
||||
if (TIMER > 0) {
|
||||
TIMER--;
|
||||
tvTimer.setText(String.valueOf(TIMER));
|
||||
handler.sendEmptyMessageDelayed(MSG_TYPE_TIMER, 1000L);
|
||||
} else {
|
||||
hideDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public DispatchCarsDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
setContentView(R.layout.dialog_adas_dispatch_cars);
|
||||
setCanceledOnTouchOutside(false);
|
||||
tvTimer = findViewById(R.id.module_adas_dispatch_remind_timer);
|
||||
tvLoc = findViewById(R.id.module_adas_dispatch_remind_loc);
|
||||
Button btnAffirm = (Button) findViewById(R.id.module_adas_dispatch_remind_affirm);
|
||||
Button btnCancel = (Button) findViewById(R.id.module_adas_dispatch_remind_cancel);
|
||||
tvTimer.setText(String.valueOf(TIMER));
|
||||
btnAffirm.setOnClickListener(v -> {
|
||||
CallerFuncBizManager.getBizProvider().dispatchAffirm();
|
||||
dismissDialog();
|
||||
});
|
||||
btnCancel.setOnClickListener(v -> {
|
||||
CallerFuncBizManager.getBizProvider().dispatchCancel(true);
|
||||
dismissDialog();
|
||||
});
|
||||
}
|
||||
|
||||
private void hideDialog() {
|
||||
CallerFuncBizManager.getBizProvider().dispatchCancel(false);
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
private void dismissDialog() {
|
||||
handler.removeMessages(MSG_TYPE_TIMER);
|
||||
TIMER = 10;
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showDialog(DispatchAdasAutoPilotLocReceiverBean dispatchContent) {
|
||||
if (TextUtils.isEmpty(dispatchContent.getEndLocAddress())) {
|
||||
return;
|
||||
}
|
||||
show();
|
||||
handler.sendEmptyMessage(MSG_TYPE_TIMER);
|
||||
tvLoc.setText(dispatchContent.getEndLocAddress());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.dispatch;
|
||||
|
||||
import static com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean.DISPATCH_SOURCE_EZHOU;
|
||||
import static com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean.DISPATCH_SOURCE_HENGYANG;
|
||||
import static com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean.DISPATCH_TYPE_START;
|
||||
import static com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean.DISPATCH_TYPE_STOP;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean;
|
||||
|
||||
public class DispatchDialogManager {
|
||||
|
||||
private static volatile DispatchDialogManager manager;
|
||||
private static final byte[] obj = new byte[0];
|
||||
private final Context mContext;
|
||||
private DispatchBaseDialog dialog;
|
||||
|
||||
private DispatchDialogManager(Context context) {
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
public static DispatchDialogManager getInstance(Context context) {
|
||||
if (manager == null) {
|
||||
synchronized (obj) {
|
||||
if (manager == null) {
|
||||
manager = new DispatchDialogManager(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
return manager;
|
||||
}
|
||||
|
||||
public boolean isShowing() {
|
||||
return dialog != null && dialog.isShowing();
|
||||
}
|
||||
|
||||
public void showDialog(DispatchAdasAutoPilotLocReceiverBean msgData) {
|
||||
if (msgData == null) {
|
||||
return;
|
||||
}
|
||||
switch (msgData.getSource()) {
|
||||
case DISPATCH_SOURCE_HENGYANG:
|
||||
dispatchHengYang(msgData);
|
||||
break;
|
||||
case DISPATCH_SOURCE_EZHOU:
|
||||
dispatchEZhou(msgData);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void dispatchHengYang(DispatchAdasAutoPilotLocReceiverBean msgData) {
|
||||
if (msgData.getType() == DISPATCH_TYPE_START) { //衡阳只有开始调度
|
||||
if (dialog != null && dialog.isShowing()) { //避免下发两次
|
||||
return;
|
||||
}
|
||||
if (dialog == null) {
|
||||
dialog = new DispatchCarsDialog(mContext);
|
||||
}
|
||||
dialog.showDialog(msgData);
|
||||
}
|
||||
}
|
||||
|
||||
private void dispatchEZhou(DispatchAdasAutoPilotLocReceiverBean msgData) {
|
||||
switch (msgData.getType()) {
|
||||
case DISPATCH_TYPE_START:
|
||||
if (dialog != null && dialog.isShowing()) { //避免下发两次
|
||||
return;
|
||||
}
|
||||
if (dialog == null) {
|
||||
dialog = new DispatchAirportDialog(mContext);
|
||||
}
|
||||
dialog.showDialog(msgData);
|
||||
break;
|
||||
case DISPATCH_TYPE_STOP:
|
||||
//语音播报
|
||||
voice();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void voice() {
|
||||
AIAssist.getInstance(mContext).speakTTSVoiceWithLevel("请立即停车!请立即停车!",AIAssist.LEVEL0);
|
||||
}
|
||||
|
||||
public void releaseDialog() {
|
||||
if (dialog != null) {
|
||||
if (dialog.isShowing()) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
dialog = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.traffic.NoticeTrafficDialog;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform;
|
||||
import com.mogo.eagle.core.utilcode.util.BitmapHelper;
|
||||
|
||||
@@ -43,7 +43,7 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
private var playErrorImageView: ImageView? = null
|
||||
private var connectTextView: TextView? = null
|
||||
private val statusChangedListenerForCheckNotice = IMogoStatusChangedListener { descriptor, isTrue ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND) {
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.notice;
|
||||
package com.mogo.eagle.core.function.hmi.ui.notice.traffic;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.notice;
|
||||
package com.mogo.eagle.core.function.hmi.ui.notice.traffic;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||
|
||||
@@ -24,7 +24,7 @@ import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData;
|
||||
import com.mogo.eagle.core.data.notice.NoticeValue;
|
||||
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.notice.CallerNoticeManager;
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform;
|
||||
@@ -153,7 +153,7 @@ public class NoticeTrafficDialog extends BaseFloatDialog implements LifecycleObs
|
||||
* 0不接收 1接受 发起自动驾驶任务,显示引导线
|
||||
*/
|
||||
private void feedBackTraffic(int i) {
|
||||
CallerNoticeManager.getNoticeProvider().feedBackNoticeTraffic(mPushData.getInfoId(), MoGoAiCloudClientConfig.getInstance().getSn(), i);
|
||||
CallerFuncBizManager.getBizProvider().feedBackNoticeTraffic(mPushData.getInfoId(), MoGoAiCloudClientConfig.getInstance().getSn(), i);
|
||||
if (i == 1) {
|
||||
startAutoPilot();
|
||||
}
|
||||
@@ -352,7 +352,7 @@ public class NoticeTrafficDialog extends BaseFloatDialog implements LifecycleObs
|
||||
*/
|
||||
private void requestTrafficInfo() {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "requestTrafficInfo");
|
||||
CallerNoticeManager.getNoticeProvider().requestAccidentInfo(mPushData.getInfoId(), MoGoAiCloudClientConfig.getInstance().getSn(), trafficInfo -> {
|
||||
CallerFuncBizManager.getBizProvider().requestAccidentInfo(mPushData.getInfoId(), MoGoAiCloudClientConfig.getInstance().getSn(), trafficInfo -> {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "交通事故详情::" + trafficInfo);
|
||||
mTrafficStyleInfo = trafficInfo.getResult().getAccidentInfo();
|
||||
infoRefresh(mTrafficStyleInfo);
|
||||
@@ -443,7 +443,7 @@ public class NoticeTrafficDialog extends BaseFloatDialog implements LifecycleObs
|
||||
}
|
||||
|
||||
private final IMogoStatusChangedListener statusChangedListenerForNotice = (descriptor, isTrue) -> {
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND) {
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onStatusChanged==MAIN_PAGE_IS_BACKGROUND");
|
||||
dismiss();
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.notice;
|
||||
package com.mogo.eagle.core.function.hmi.ui.notice.traffic;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.notice;
|
||||
package com.mogo.eagle.core.function.hmi.ui.notice.traffic;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
@@ -17,7 +17,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener.Companion.STATUS_AUTOPILOT_RUNNING
|
||||
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningActionsListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
@@ -48,15 +48,15 @@ class PncActionsView @JvmOverloads constructor(
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerAutopilotPlanningActionsListenerManager.addListener(TAG, this)
|
||||
CallerTrafficLightListenerManager.registerTrafficLightListener(TAG, this)
|
||||
CallerPlanningActionsListenerManager.addListener(TAG, this)
|
||||
CallerTrafficLightListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
CallerAutopilotPlanningActionsListenerManager.removeListener(TAG)
|
||||
CallerTrafficLightListenerManager.unRegisterTrafficLightListener(TAG)
|
||||
CallerPlanningActionsListenerManager.removeListener(TAG)
|
||||
CallerTrafficLightListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
|
||||
@@ -76,7 +76,7 @@ class PncActionsView @JvmOverloads constructor(
|
||||
if (it.state == STATUS_AUTOPILOT_RUNNING) {
|
||||
UiThreadHandler.post {
|
||||
var actions: String? = null
|
||||
planningActionMsg.actionMsg?.let {
|
||||
planningActionMsg.actionMsg?.let { it ->
|
||||
actions = PncActionsHelper.getAction(it.drivingState.number, it.drivingAction.number)
|
||||
|
||||
//如果是存在云端红绿灯数据条件下,设置云端数据
|
||||
|
||||
@@ -17,6 +17,7 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.MenuCompat
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.core.view.*
|
||||
import chassis.Chassis
|
||||
import chassis.ChassisStatesOuterClass
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
@@ -41,13 +42,13 @@ import com.mogo.eagle.core.data.gnss.AccelerationEntity
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.data.obu.ObuStatusInfo
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.data.upgrade.UpgradeVersionEntity
|
||||
import com.mogo.eagle.core.function.api.autopilot.*
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListener
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.RouteStrategy
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.*
|
||||
import com.mogo.eagle.core.function.call.autopilot.*
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsFuncConfigListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
||||
@@ -64,7 +65,6 @@ import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.logcatch.ILogViewListener
|
||||
import com.mogo.eagle.core.function.hmi.ui.logcatch.LogInfoView
|
||||
import com.mogo.eagle.core.function.hmi.ui.upgrade.UpgradeListAdapter
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
|
||||
import com.mogo.eagle.core.utilcode.kotlin.currentPadding
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
@@ -72,15 +72,16 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.permissions.BackgrounderPermission
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.map.MogoMapUIController
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.*
|
||||
import com.zhidao.easysocket.utils.L
|
||||
import com.zhidao.support.adas.high.other.permission.BackgrounderPermission
|
||||
import com.zhjt.mogo_core_function_devatools.env.EnvChangeManager
|
||||
import com.zhjt.mogo_core_function_devatools.env.*
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo_msg.MogoReportMsg
|
||||
@@ -117,11 +118,23 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoObuStatusListener,
|
||||
IMoGoAutopilotStatusListener, IMoGoAutopilotCarStateListener,
|
||||
IMoGoMapLocationListener, IMoGoAutopilotIdentifyListener,
|
||||
IMoGoAutopilotPlanningListener,
|
||||
IMoGoAutopilotVehicleStateListener, IMoGoDevaToolsFuncConfigListener {
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr),
|
||||
IMoGoObuStatusListener,
|
||||
IMoGoAutopilotStatusListener,
|
||||
IMoGoChassisLocationWGS84Listener,
|
||||
IMoGoMapLocationListener,
|
||||
IMoGoAutopilotIdentifyListener,
|
||||
IMoGoPlanningRottingListener,
|
||||
IMoGoPlanningTrajectoryListener,
|
||||
IMoGoDevaToolsFuncConfigListener,
|
||||
IMoGoChassisLamplightListener,
|
||||
IMoGoDevaToolsListener,
|
||||
IMoGoChassisAccStateListener,
|
||||
IMoGoChassisSteeringStateListener,
|
||||
IMoGoChassisGearStateListener,
|
||||
IMoGoChassisBrakeStateListener,
|
||||
IMoGoChassisThrottleStateListener,
|
||||
IMoGoSweeperFutianCleanSystemListener{
|
||||
|
||||
private val TAG = "DebugSettingView"
|
||||
|
||||
@@ -158,12 +171,6 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
private var onlineSelected: Boolean = true
|
||||
private var qaSelected: Boolean = true
|
||||
|
||||
private var upgradeListAdapter: UpgradeListAdapter? = null
|
||||
|
||||
private val upgradeVersionList by lazy {
|
||||
ArrayList<UpgradeVersionEntity>()
|
||||
}
|
||||
|
||||
private val mapUiController by lazy {
|
||||
CallerMapUIServiceManager.getMapUIController()
|
||||
}
|
||||
@@ -205,15 +212,25 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
// 添加 ADAS状态 监听
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
// 添加 ADAS车辆状态&定位 监听
|
||||
CallerAutopilotCarStatusListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
|
||||
// 添加 地图样式改变 监听
|
||||
CallerMapLocationListenerManager.addListener(TAG, this, false)
|
||||
// 添加 域控制器感知数据 监听
|
||||
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
|
||||
// 添加 规划路径相关回调 监听
|
||||
CallerAutopilotPlanningListenerManager.addListener(TAG, this)
|
||||
CallerPlanningRottingListenerManager.addListener(TAG, this)
|
||||
CallerPlanningTrajectoryListenerManager.addListener(TAG, this)
|
||||
//添加 车辆底盘数据回调 监听
|
||||
CallerAutopilotVehicleStateListenerManager.addListener(TAG, this)
|
||||
CallerChassisAccStateListenerManager.addListener(TAG, this)
|
||||
CallerChassisBrakeStateListenerManager.addListener(TAG, this)
|
||||
CallerChassisGearStateListenerManager.addListener(TAG, this)
|
||||
CallerChassisSteeringStateListenerManager.addListener(TAG, this)
|
||||
CallerChassisThrottleStateListenerManager.addListener(TAG, this)
|
||||
|
||||
//添加 开发套件工具接口 监听
|
||||
CallerDevaToolsListenerManager.addListener(TAG, this)
|
||||
//添加 底盘灯光数据 监听
|
||||
CallerChassisLamplightListenerManager.addListener(TAG, this)
|
||||
|
||||
//添加 业务配置监听
|
||||
CallerDevaToolsFuncConfigListenerManager.registerDevaToolsFuncConfigListener(
|
||||
@@ -238,15 +255,24 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
// 移除 ADAS状态 监听
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
// 移除 ADAS车辆状态&定位 监听
|
||||
CallerAutopilotCarStatusListenerManager.removeListener(TAG)
|
||||
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
|
||||
// 移除 地图样式改变 监听
|
||||
CallerMapLocationListenerManager.removeListener(TAG, false)
|
||||
// 移除 域控制器感知数据 监听
|
||||
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
|
||||
// 移除 规划路径相关回调 监听
|
||||
CallerAutopilotPlanningListenerManager.removeListener(TAG)
|
||||
CallerPlanningRottingListenerManager.removeListener(TAG)
|
||||
CallerPlanningTrajectoryListenerManager.removeListener(TAG)
|
||||
// 移除 车辆底盘数据回调 监听
|
||||
CallerAutopilotVehicleStateListenerManager.removeListener(TAG)
|
||||
CallerChassisAccStateListenerManager.removeListener(TAG)
|
||||
CallerChassisBrakeStateListenerManager.removeListener(TAG)
|
||||
CallerChassisGearStateListenerManager.removeListener(TAG)
|
||||
CallerChassisSteeringStateListenerManager.removeListener(TAG)
|
||||
CallerChassisThrottleStateListenerManager.removeListener(TAG)
|
||||
// 移除 开发套件工具接口 监听
|
||||
CallerDevaToolsListenerManager.removeListener(TAG)
|
||||
// 移除 底盘灯光数据 监听
|
||||
CallerChassisLamplightListenerManager.removeListener(TAG)
|
||||
|
||||
// 移除 业务配置监听
|
||||
CallerDevaToolsFuncConfigListenerManager.unRegisterDevaToolsFuncConfigListener( FuncBizConfig.FOUNDATION, TAG)
|
||||
@@ -296,7 +322,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
btnOpenAllGestures.setOnClickListener {
|
||||
MogoMapUIController.getInstance().setAllGesturesEnabled(true)
|
||||
CallerMapUIServiceManager.getMapUIController()?.setAllGesturesEnabled(true)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -472,21 +498,6 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用包管理中心
|
||||
*/
|
||||
btnApkCenter.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
if (isChecked) {
|
||||
buttonView.setCompoundDrawables(null, null, iconDown, null)
|
||||
//展示应用包管理中心
|
||||
apkCenterLayout.visibility = View.VISIBLE
|
||||
} else {
|
||||
buttonView.setCompoundDrawables(null, null, iconRight, null)
|
||||
//隐藏应用包管理中心
|
||||
apkCenterLayout.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
lastVisualAngleMode = mapUiController?.currentMapVisualAngle
|
||||
|
||||
/**
|
||||
@@ -560,8 +571,6 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
setHmiCheckedChangeListener()
|
||||
//日志中心事件点击监听
|
||||
setLogCheckedChangeListener()
|
||||
//APK包管理中心配置
|
||||
setApkCenterListener()
|
||||
|
||||
//OBU配置信息
|
||||
tvObuInfo.text = CallerObuListenerManager.getObuStatusInfoJsonString()
|
||||
@@ -1410,54 +1419,6 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
CallerDevaToolsManager.stopCatchLog()
|
||||
}
|
||||
}
|
||||
CallerDevaToolsListenerManager.registerDevaToolsLogCatchListener(TAG,
|
||||
object : IMoGoDevaToolsListener {
|
||||
override fun onLogCatchStart() {
|
||||
super.onLogCatchStart()
|
||||
tbLogCatch.isChecked = true
|
||||
}
|
||||
|
||||
override fun onLogCatchClose() {
|
||||
super.onLogCatchClose()
|
||||
tbLogCatch.isChecked = false
|
||||
}
|
||||
|
||||
override fun onLogCatch(lineLog: String) {
|
||||
logInfoView?.let {
|
||||
if (logViewAttach) {
|
||||
it.onLogCatch(lineLog)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun fwThreadClose() {
|
||||
refreshTraceInfo()
|
||||
}
|
||||
|
||||
override fun moduleLogChanged(moduleTag: MutableMap<String, SceneModule>) {
|
||||
//模块日志 tag 发生变化,需要更新对应 UI
|
||||
setLogCheckedChangeListener()
|
||||
}
|
||||
|
||||
override fun upgradeVersionUrls(urls: Map<String, String>?) {
|
||||
//版本信息更新
|
||||
urls?.let {
|
||||
upgradeVersionList.clear()
|
||||
it.iterator().forEach { map ->
|
||||
val name =
|
||||
if (map.key.contains("{")) map.key.replace("{", "") else map.key
|
||||
val url = if (map.value.contains("}")) map.value.replace(
|
||||
"}",
|
||||
""
|
||||
) else map.value
|
||||
upgradeVersionList.add(UpgradeVersionEntity(name.trim(), url))
|
||||
}
|
||||
upgradeVersionList.sortByDescending { upgradeVersionEntity -> upgradeVersionEntity.name }
|
||||
upgradeListAdapter?.setDada(dataFilter(upgradeVersionList))
|
||||
upgradeListAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* 展示、关闭日志过滤面板
|
||||
@@ -1589,77 +1550,6 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* APK包管理
|
||||
*/
|
||||
private fun setApkCenterListener() {
|
||||
val layoutManager: LinearLayoutManager = object : LinearLayoutManager(
|
||||
context,
|
||||
VERTICAL, false
|
||||
) {
|
||||
override fun canScrollVertically(): Boolean {
|
||||
// 直接禁止垂直滑动
|
||||
return false
|
||||
}
|
||||
}
|
||||
rvUpgradeVersionList.layoutManager = layoutManager
|
||||
|
||||
upgradeListAdapter = UpgradeListAdapter(context, upgradeVersionList,
|
||||
object : UpgradeListAdapter.ClickListener {
|
||||
override fun downloadApk(name: String, url: String) {
|
||||
//下载包
|
||||
CallerDevaToolsManager.downLoadPackage(name, url)
|
||||
ToastUtils.showLong("开始下载APK,稍后可前往downloads文件夹查看")
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
rvUpgradeVersionList.adapter = upgradeListAdapter
|
||||
|
||||
ivApkSearch.setOnClickListener {
|
||||
val searchStr = etApkSearch.text.toString()
|
||||
if (searchStr.isEmpty()) {
|
||||
ToastUtils.showShort("请输入正确的搜索关键字")
|
||||
} else {
|
||||
CallerDevaToolsManager.getUpgradeVersionUrls(searchStr)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Online
|
||||
cbApkOnline.setOnCheckedChangeListener { _, isChecked ->
|
||||
onlineSelected = isChecked
|
||||
upgradeListAdapter?.setDada(dataFilter(upgradeVersionList))
|
||||
upgradeListAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
//QA
|
||||
cbApkQa.setOnCheckedChangeListener { _, isChecked ->
|
||||
qaSelected = isChecked
|
||||
upgradeListAdapter?.setDada(dataFilter(upgradeVersionList))
|
||||
upgradeListAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据包数据过滤器
|
||||
*/
|
||||
private fun dataFilter(list: ArrayList<UpgradeVersionEntity>): ArrayList<UpgradeVersionEntity> {
|
||||
val tempList = ArrayList<UpgradeVersionEntity>()
|
||||
list.let {
|
||||
it.iterator().forEach { entity ->
|
||||
if (onlineSelected && entity.name.contains("online")) {
|
||||
tempList.add(entity)
|
||||
}
|
||||
if (qaSelected && entity.name.contains("qa")) {
|
||||
tempList.add(entity)
|
||||
}
|
||||
}
|
||||
}
|
||||
return tempList
|
||||
}
|
||||
|
||||
private fun logViewDestroy() {
|
||||
logInfoView?.let {
|
||||
it.dismiss()
|
||||
@@ -2009,7 +1899,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotCarStateData(gnssInfo: MessagePad.GnssInfo?) {
|
||||
override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo?) {
|
||||
mGnssInfo = gnssInfo
|
||||
//实时加速度列表
|
||||
ThreadUtils.runOnUiThread {
|
||||
@@ -2264,5 +2154,31 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
fun showReportListWindow(show: Boolean)
|
||||
}
|
||||
|
||||
override fun onLogCatchStart() {
|
||||
super.onLogCatchStart()
|
||||
tbLogCatch.isChecked = true
|
||||
}
|
||||
|
||||
override fun onLogCatchClose() {
|
||||
super.onLogCatchClose()
|
||||
tbLogCatch.isChecked = false
|
||||
}
|
||||
|
||||
override fun onLogCatch(lineLog: String) {
|
||||
logInfoView?.let {
|
||||
if (logViewAttach) {
|
||||
it.onLogCatch(lineLog)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun fwThreadClose() {
|
||||
refreshTraceInfo()
|
||||
}
|
||||
|
||||
override fun moduleLogChanged(moduleTag: MutableMap<String, SceneModule>) {
|
||||
//模块日志 tag 发生变化,需要更新对应 UI
|
||||
setLogCheckedChangeListener()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,7 +22,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showTurnLight
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.utils.KeyBoardUtil
|
||||
import com.mogo.eagle.core.function.msgbox.MsgBoxConfig
|
||||
@@ -100,9 +99,6 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
sopLayout.setOnClickListener {
|
||||
clickListener?.showSOPSettingView()
|
||||
}
|
||||
viewCheckStatus.setOnClickListener {
|
||||
clickListener?.go2CheckPage()
|
||||
}
|
||||
ivDebugPanel.setOnClickListener {
|
||||
clickListener?.showDebugPanelView()
|
||||
|
||||
@@ -171,6 +167,7 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
actvLoginout.visibility = View.VISIBLE
|
||||
CallerHmiManager.setBusOperationView(toolBusOperationView)
|
||||
|
||||
// TODO 这里判断方式可以替换为使用 AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)等进行替换
|
||||
when (DebugConfig.getProductFlavor()) {
|
||||
"fPadLenovoOchTaxi" -> {
|
||||
//出租车司机
|
||||
@@ -220,7 +217,6 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
interface ClickListener {
|
||||
fun go2CheckPage()
|
||||
fun onClose(v: View)
|
||||
fun showDebugPanelView()
|
||||
fun showFeedbackView()
|
||||
|
||||
@@ -4,11 +4,12 @@ import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.temp.EventLogout
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IOchBusView
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.SharedPrefs
|
||||
import com.mogo.eagle.core.utilcode.util.StringUtils
|
||||
import kotlinx.android.synthetic.main.view_och_bus_operation.view.*
|
||||
@@ -33,7 +34,7 @@ class BusOperationView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun initPersonalIcon() {
|
||||
if("fPadLenovoOchTaxi" == DebugConfig.getProductFlavor()){
|
||||
if(AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
|
||||
ivGotoPersonalInfo.visibility = VISIBLE
|
||||
}else{
|
||||
ivGotoPersonalInfo.visibility = GONE
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.upgrade
|
||||
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView.Adapter
|
||||
import androidx.recyclerview.widget.RecyclerView.ViewHolder
|
||||
import com.mogo.eagle.core.data.upgrade.UpgradeVersionEntity
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.upgrade.UpgradeListAdapter.UpgradeListHolder
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description APK升级包列表适配器
|
||||
* @since: 2022/3/25
|
||||
*/
|
||||
class UpgradeListAdapter: Adapter<UpgradeListHolder> {
|
||||
|
||||
private var context: Context? = null
|
||||
private var data:List<UpgradeVersionEntity>? = null
|
||||
private var clickListener: ClickListener? = null
|
||||
|
||||
constructor(
|
||||
context: Context,
|
||||
data: List<UpgradeVersionEntity>?,
|
||||
clickListener: ClickListener? = null
|
||||
) {
|
||||
this.context = context
|
||||
this.data = data
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
public fun setDada( data: List<UpgradeVersionEntity>?){
|
||||
this.data = data
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): UpgradeListHolder {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_upgrade_version, parent, false)
|
||||
return UpgradeListHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: UpgradeListHolder, position: Int) {
|
||||
data?.let {
|
||||
val upgradeVersionEntity = it[position]
|
||||
holder.tvUpgradeApkName.text=upgradeVersionEntity.name
|
||||
holder.tvUpgradeApkName.setOnClickListener {
|
||||
clickListener?.downloadApk(upgradeVersionEntity.name,upgradeVersionEntity.url)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount() = data?.size ?: 0
|
||||
|
||||
class UpgradeListHolder(itemView: View) : ViewHolder(itemView) {
|
||||
var tvUpgradeApkName: TextView = itemView.findViewById(R.id.tvUpgradeApkName)
|
||||
}
|
||||
|
||||
interface ClickListener{
|
||||
fun downloadApk(name:String,url:String)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -105,17 +105,17 @@ class AutoPilotStatusView @JvmOverloads constructor(
|
||||
when (autopilotStatus) {
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {// 不可自动驾驶,adas与工控机没有链接,或工控机异常
|
||||
setBackgroundResource(R.drawable.module_hmi_autopilot_status_disabled_bg)
|
||||
tvStatusDes.setTextColor(resources.getColor(R.color.module_mogo_autopilot_status_disable))
|
||||
tvStatusDes.setTextColor(resources.getColor(R.color.color_4DFFFFFF))
|
||||
ivStatusIcon.setImageResource(R.drawable.icon_autopilot_status_disabled)
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> {// 可自动驾驶,目前处于人工干预状态
|
||||
setBackgroundResource(R.drawable.module_hmi_autopilot_status_enable_bg)
|
||||
tvStatusDes.setTextColor(resources.getColor(R.color.module_mogo_autopilot_status_enable))
|
||||
tvStatusDes.setTextColor(resources.getColor(R.color.color_white))
|
||||
ivStatusIcon.setImageResource(R.drawable.icon_autopilot_status)
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {// 自动驾驶中
|
||||
setBackgroundResource(R.drawable.module_hmi_autopilot_status_checked_bg)
|
||||
tvStatusDes.setTextColor(resources.getColor(R.color.module_mogo_autopilot_status_enable))
|
||||
tvStatusDes.setTextColor(resources.getColor(R.color.color_white))
|
||||
ivStatusIcon.setImageResource(R.drawable.icon_autopilot_status)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.api.check.IMogoCheckListener
|
||||
import com.mogo.eagle.core.function.call.check.CallerCheckManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import kotlinx.android.synthetic.main.view_check_status.view.*
|
||||
|
||||
/**
|
||||
*@author xiaoyuzhou
|
||||
*@date 2021/8/6 12:25 下午
|
||||
*/
|
||||
class CheckStatusView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMogoCheckListener {
|
||||
private val TAG = "CheckStatusView"
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_check_status, this, true)
|
||||
}
|
||||
|
||||
private fun showErrorIcon() {
|
||||
errorTipImage.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
private fun dismissErrorIcon() {
|
||||
errorTipImage.visibility = View.GONE
|
||||
}
|
||||
|
||||
override fun updateMonitoringStatus(state: Int?) {
|
||||
if (state == 1) {
|
||||
dismissErrorIcon()
|
||||
} else {
|
||||
showErrorIcon()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
//车辆监控
|
||||
if (isInEditMode) {
|
||||
return
|
||||
}
|
||||
CallerCheckManager.registerVehicleMonitoringListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
//车辆监控
|
||||
if (isInEditMode) {
|
||||
return
|
||||
}
|
||||
CallerCheckManager.unregisterListener(TAG)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,8 +5,8 @@ import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.FrameLayout
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.map.MogoMapUIController
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import kotlinx.android.synthetic.main.view_perspective_switch.view.*
|
||||
|
||||
@@ -28,25 +28,17 @@ class PerspectiveSwitchView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
//切换地图的远近视图
|
||||
if (MogoMapUIController.getInstance().currentMapVisualAngle.isLongSight) {
|
||||
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
|
||||
// .visibleAllMarkers()
|
||||
MogoMapUIController.getInstance()
|
||||
.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
|
||||
textSwitch.setText(R.string.module_map_model_normal)
|
||||
} else if (MogoMapUIController.getInstance().currentMapVisualAngle.isMediumSight) {
|
||||
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
|
||||
// .inVisibleWithoutMarkers(DataTypes.TYPE_MARKER_ADAS)
|
||||
MogoMapUIController.getInstance()
|
||||
.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null)
|
||||
textSwitch.setText(R.string.module_map_model_faster)
|
||||
} else {
|
||||
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
|
||||
// .visibleAllMarkers()
|
||||
MogoMapUIController.getInstance()
|
||||
.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
|
||||
textSwitch.setText(R.string.module_map_model_normal)
|
||||
getMapUIController()?.let {
|
||||
if (it.currentMapVisualAngle.isLongSight) {
|
||||
it.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
|
||||
textSwitch.setText(R.string.module_map_model_normal)
|
||||
} else if (it.currentMapVisualAngle.isMediumSight) {
|
||||
it.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null)
|
||||
textSwitch.setText(R.string.module_map_model_faster)
|
||||
} else {
|
||||
it.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null)
|
||||
textSwitch.setText(R.string.module_map_model_faster)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,17 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.*
|
||||
import android.location.Location
|
||||
import android.util.*
|
||||
import android.graphics.Color
|
||||
import android.util.AttributeSet
|
||||
import android.view.Gravity
|
||||
import android.widget.FrameLayout
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.map.*
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
@@ -24,28 +22,23 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : FrameLayout(context, attrs, defStyleAttr),
|
||||
IMogoCarLocationChangedListener2 {
|
||||
val TAG = "SpeedPanelView"
|
||||
private var mMogoServiceApis: IMogoServiceApis =
|
||||
ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS)
|
||||
.navigation(context) as IMogoServiceApis
|
||||
) : FrameLayout(context, attrs, defStyleAttr), IMoGoChassisLocationGCJ02Listener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "SpeedPanelView"
|
||||
}
|
||||
|
||||
var mContext: Context
|
||||
var mSpeedChartView: SpeedChartView
|
||||
|
||||
var mLatLng: Location? = null
|
||||
|
||||
var mSpeedLimmit = 60;
|
||||
|
||||
var mLatLng: MessagePad.GnssInfo? = null
|
||||
var mSpeedLimit = 60
|
||||
|
||||
private val timer by lazy {
|
||||
Timer()
|
||||
}
|
||||
|
||||
init {
|
||||
initEvent(context)
|
||||
|
||||
initEvent()
|
||||
setBackgroundResource(R.drawable.yi_biao_pan_bg_nor)
|
||||
mContext = context
|
||||
mSpeedChartView = SpeedChartView(context)
|
||||
@@ -59,31 +52,31 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
addView(mSpeedChartView)
|
||||
}
|
||||
|
||||
private fun initEvent(context: Context) {
|
||||
private fun initEvent() {
|
||||
setOnLongClickListener {
|
||||
CallerHmiManager.toggleDebugView()
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
private var timerTask : TimerTask? = null
|
||||
private var timerTask: TimerTask? = null
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow() // 注册位置回调
|
||||
mMogoServiceApis.registerCenterApi.registerCarLocationChangedListener(TAG, this)
|
||||
CallerChassisLocationGCJ20ListenerManager.addListener(TAG, this)
|
||||
// 开启定时查询速度
|
||||
timerTask?.cancel()
|
||||
val task = object : TimerTask() {
|
||||
override fun run() {
|
||||
if (mLatLng != null) {
|
||||
|
||||
mSpeedLimmit = MogoMapUIController.getInstance()
|
||||
.getLimitSpeed(mLatLng!!.longitude, mLatLng!!.latitude, mLatLng!!.bearing)
|
||||
mLatLng?.let {
|
||||
mSpeedLimit = CallerMapUIServiceManager.getMapUIController()!!.getLimitSpeed(it.longitude, it.latitude,
|
||||
it.heading.toFloat()
|
||||
)
|
||||
UiThreadHandler.post {
|
||||
val speed = (mLatLng!!.speed * 3.6f).toInt()
|
||||
mSpeedChartView.setArcColor(Color.parseColor(if (speed > mSpeedLimmit) "#DB3137" else "#3E77F6"))
|
||||
val speed = (it.gnssSpeed * 3.6f).toInt()
|
||||
mSpeedChartView.setArcColor(Color.parseColor(if (speed > mSpeedLimit) "#DB3137" else "#3E77F6"))
|
||||
mSpeedChartView.setValues(speed)
|
||||
setBackgroundResource(if (speed > mSpeedLimmit) R.drawable.yi_biao_pan_bg_speeding else R.drawable.yi_biao_pan_bg_nor)
|
||||
setBackgroundResource(if (speed > mSpeedLimit) R.drawable.yi_biao_pan_bg_speeding else R.drawable.yi_biao_pan_bg_nor)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -92,11 +85,16 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
timer.schedule(task, Date(), 100)
|
||||
}
|
||||
|
||||
override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) {
|
||||
gnssInfo?.let {
|
||||
mLatLng = gnssInfo
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
// 解除注册
|
||||
mMogoServiceApis.registerCenterApi
|
||||
.unregisterMogoLocationListener(TAG)
|
||||
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
|
||||
try {
|
||||
timerTask?.cancel()
|
||||
} catch (e: Exception) {
|
||||
@@ -105,8 +103,4 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
|
||||
override fun onCarLocationChanged2(latLng: Location) {
|
||||
mLatLng = latLng
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.BlurMaskFilter;
|
||||
import android.util.AttributeSet;
|
||||
@@ -16,9 +18,11 @@ import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGearStateListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisSteeringStateListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisGearStateListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisSteeringStateListenerManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
@@ -27,14 +31,11 @@ import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import chassis.Chassis;
|
||||
import chassis.ChassisStatesOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
import planning.RoboSweeperTaskIndexOuterClass;
|
||||
import system_master.SystemStatusInfo;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
|
||||
|
||||
/**
|
||||
* @author Jing
|
||||
* @description 方向盘
|
||||
@@ -42,7 +43,9 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS
|
||||
* 档位随CAN数据做切换和高亮显示
|
||||
* @since: 4/7/22
|
||||
*/
|
||||
public class SteeringWheelView extends ConstraintLayout {
|
||||
public class SteeringWheelView extends ConstraintLayout implements
|
||||
IMoGoChassisSteeringStateListener,
|
||||
IMoGoChassisGearStateListener {
|
||||
private static final String TAG = "SteeringWheelView";
|
||||
private ImageView autopilotIV;
|
||||
private TextView steeringTVL;
|
||||
@@ -66,7 +69,8 @@ public class SteeringWheelView extends ConstraintLayout {
|
||||
}
|
||||
initView();
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
|
||||
CallerAutopilotVehicleStateListenerManager.INSTANCE.addListener(TAG, mIMoGoAutopilotVehicleStateListener);
|
||||
CallerChassisGearStateListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerChassisSteeringStateListenerManager.INSTANCE.addListener(TAG, this);
|
||||
tapPositionView.updateWithGear(Chassis.GearPosition.GEAR_R);
|
||||
}
|
||||
|
||||
@@ -164,121 +168,59 @@ public class SteeringWheelView extends ConstraintLayout {
|
||||
}
|
||||
};
|
||||
|
||||
private final IMoGoAutopilotVehicleStateListener mIMoGoAutopilotVehicleStateListener = new IMoGoAutopilotVehicleStateListener() {
|
||||
|
||||
@Override
|
||||
public void onBMSSystemStates(@NonNull ChassisStatesOuterClass.BMSSystemStates bmsSystemStates) {
|
||||
|
||||
/**
|
||||
* 方向盘转向角 左+右-
|
||||
* @param steering
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotSteeringData(float steering) {
|
||||
if (Math.abs(steering) < 1) {
|
||||
steering = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSweeperFutianCleanSystemState(@NonNull ChassisStatesOuterClass.SweeperFuTianTaskSystemStates cleanSystemState) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSweeperFutianTaskIndexData(@NonNull RoboSweeperTaskIndexOuterClass.RoboSweeperTaskIndex roboSweeperTaskIndex) {
|
||||
|
||||
}
|
||||
/**
|
||||
* @param brake 刹车
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotBrake(float brake) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param throttle 油门
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotThrottle(float throttle) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆转向灯
|
||||
* @param lightSwitch
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotLightSwitchData(@org.jetbrains.annotations.Nullable Chassis.LightSwitch lightSwitch) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 刹车灯
|
||||
* @param brakeLight
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotBrakeLightData(boolean brakeLight) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆加速度
|
||||
* @param carAcc
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotAcc(float carAcc) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 方向盘转向角 左+右-
|
||||
* @param steering
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotSteeringData(float steering) {
|
||||
if (Math.abs(steering) < 1) {
|
||||
steering = 0;
|
||||
float steeringValue = steering;
|
||||
ThreadUtils.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (steeringTVL != null && steeringValue > 0) {
|
||||
steeringTVR.setVisibility(View.INVISIBLE);
|
||||
steeringTVL.setVisibility(View.VISIBLE);
|
||||
steeringTVL.setText(String.valueOf((int) steeringValue) + "°");
|
||||
} else if (steeringTVR != null && steeringValue <= 0) {
|
||||
steeringTVL.setVisibility(View.INVISIBLE);
|
||||
steeringTVR.setVisibility(View.VISIBLE);
|
||||
steeringTVR.setText(String.valueOf((int) -steeringValue) + "°");
|
||||
} else {
|
||||
CallerLogger.INSTANCE.d(TAG, "onAutopilotSteeringData error");
|
||||
}
|
||||
animationWithSteeringData(-steeringValue);
|
||||
if (steeringCircularV != null) {
|
||||
steeringCircularV.setProgress((int) (-steeringValue * 100) / 360, 20);
|
||||
}
|
||||
if (steeringCircularVAlpha != null) {
|
||||
steeringCircularVAlpha.setProgress((int) (-steeringValue * 100) / 360, 20);
|
||||
}
|
||||
}
|
||||
float steeringValue = steering;
|
||||
ThreadUtils.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (steeringTVL != null && steeringValue > 0) {
|
||||
steeringTVR.setVisibility(View.INVISIBLE);
|
||||
steeringTVL.setVisibility(View.VISIBLE);
|
||||
steeringTVL.setText(String.valueOf((int) steeringValue) + "°");
|
||||
} else if (steeringTVR != null && steeringValue <= 0) {
|
||||
steeringTVL.setVisibility(View.INVISIBLE);
|
||||
steeringTVR.setVisibility(View.VISIBLE);
|
||||
steeringTVR.setText(String.valueOf((int) -steeringValue) + "°");
|
||||
} else {
|
||||
CallerLogger.INSTANCE.d(TAG, "onAutopilotSteeringData error");
|
||||
}
|
||||
animationWithSteeringData(-steeringValue);
|
||||
if (steeringCircularV != null) {
|
||||
steeringCircularV.setProgress((int) (-steeringValue * 100) / 360, 20);
|
||||
}
|
||||
if (steeringCircularVAlpha != null) {
|
||||
steeringCircularVAlpha.setProgress((int) (-steeringValue * 100) / 360, 20);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 档位
|
||||
* @param gear
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotGearData(@NotNull Chassis.GearPosition gear) {
|
||||
ThreadUtils.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
CallerLogger.INSTANCE.d(TAG, "乘客屏档位" + gear.toString());
|
||||
if (tapPositionView != null) {
|
||||
tapPositionView.updateWithGear(gear);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 档位
|
||||
* @param gear
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotGearData(@NotNull Chassis.GearPosition gear) {
|
||||
ThreadUtils.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
CallerLogger.INSTANCE.d(TAG, "乘客屏档位" + gear.toString());
|
||||
if (tapPositionView != null) {
|
||||
tapPositionView.updateWithGear(gear);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotDataException(long timestamp) {
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 方向盘随CAN数据做方向和角度旋转
|
||||
|
||||
@@ -1,24 +1,18 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.app.NotificationManager
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.app.NotificationCompat
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.data.bindingcar.AdUpgradeStateHelper
|
||||
import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.bindingcar.IMoGoBindingCarListener
|
||||
import com.mogo.eagle.core.function.api.devatools.IMogoDevaToolsUpgradeListener
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingCarListenerManager
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsUpgradeListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showUpgradeDialog
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
@@ -38,7 +32,8 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener,IMoGoBindingCarListener {
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener,
|
||||
IMoGoDevaToolsListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "SystemVersionView"
|
||||
@@ -67,8 +62,7 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
//鹰眼版本视图点击事件
|
||||
ivPadVersion.setOnClickListener {
|
||||
CallerLogger.i("$M_HMI$$TAG", "pad version view clicked")
|
||||
CallerBindingcarManager.getBindingcarProvider().queryAppUpgrade()
|
||||
|
||||
CallerDevaToolsManager.queryAppUpgrade()
|
||||
//弹框和下载回调
|
||||
// showUpgradeDialog(
|
||||
// "",
|
||||
@@ -274,7 +268,7 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
return
|
||||
}
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerBindingCarListenerManager.registerDevaToolsLogCatchListener(TAG,this)
|
||||
CallerDevaToolsListenerManager.addListener(TAG,this)
|
||||
needQueryContainers = true
|
||||
}
|
||||
|
||||
@@ -284,7 +278,7 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
return
|
||||
}
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
CallerBindingCarListenerManager.unRegisterDevaToolsLogCatchListener(TAG)
|
||||
CallerDevaToolsListenerManager.removeListener(TAG)
|
||||
needQueryContainers = false
|
||||
}
|
||||
|
||||
|
||||
@@ -15,10 +15,16 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisBrakeStateListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGearStateListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisSteeringStateListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisThrottleStateListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningActionsListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisBrakeStateListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisGearStateListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisSteeringStateListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisThrottleStateListenerManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
@@ -34,7 +40,11 @@ import planning.RoboSweeperTaskIndexOuterClass;
|
||||
* @description 速度 加速度 档位 刹车 油门状态值
|
||||
* @since: 6/24/22
|
||||
*/
|
||||
public class TrafficDataView extends ConstraintLayout {
|
||||
public class TrafficDataView extends ConstraintLayout implements
|
||||
IMoGoChassisSteeringStateListener,
|
||||
IMoGoChassisGearStateListener ,
|
||||
IMoGoChassisBrakeStateListener,
|
||||
IMoGoChassisThrottleStateListener {
|
||||
private static final String TAG = "TrafficDataView";
|
||||
private TapPositionView tapPositionView;
|
||||
private TextView speedTextView;
|
||||
@@ -102,8 +112,11 @@ public class TrafficDataView extends ConstraintLayout {
|
||||
protected void onAttachedToWindow() {
|
||||
super.onAttachedToWindow();
|
||||
handler.sendEmptyMessageDelayed(MSG_SEND_UPDATE, 1000L);
|
||||
CallerAutopilotVehicleStateListenerManager.INSTANCE.addListener(TAG, mIMoGoAutopilotVehicleStateListener);
|
||||
CallerAutopilotPlanningActionsListenerManager.INSTANCE.addListener(TAG, planningActionMsg -> acceleration = planningActionMsg.getDestinationAcc());
|
||||
CallerChassisSteeringStateListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerChassisGearStateListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerChassisBrakeStateListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerChassisThrottleStateListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerPlanningActionsListenerManager.INSTANCE.addListener(TAG, planningActionMsg -> acceleration = planningActionMsg.getDestinationAcc());
|
||||
}
|
||||
|
||||
private void initView(@NonNull Context context) {
|
||||
@@ -118,94 +131,52 @@ public class TrafficDataView extends ConstraintLayout {
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
CallerAutopilotVehicleStateListenerManager.INSTANCE.removeListener(TAG);
|
||||
CallerAutopilotPlanningActionsListenerManager.INSTANCE.removeListener(TAG);
|
||||
CallerChassisSteeringStateListenerManager.INSTANCE.removeListener(TAG);
|
||||
CallerChassisGearStateListenerManager.INSTANCE.removeListener(TAG);
|
||||
CallerChassisBrakeStateListenerManager.INSTANCE.removeListener(TAG);
|
||||
CallerChassisThrottleStateListenerManager.INSTANCE.removeListener(TAG);
|
||||
CallerPlanningActionsListenerManager.INSTANCE.removeListener(TAG);
|
||||
}
|
||||
|
||||
private final IMoGoAutopilotVehicleStateListener mIMoGoAutopilotVehicleStateListener = new IMoGoAutopilotVehicleStateListener() {
|
||||
@Override
|
||||
public void onBMSSystemStates(@NonNull ChassisStatesOuterClass.BMSSystemStates bmsSystemStates) {
|
||||
|
||||
/**
|
||||
* 方向盘转向角 左+右-
|
||||
* @param steering
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotSteeringData(float steering) {
|
||||
CallerLogger.INSTANCE.d(TAG, "steering原始值====" + steering);
|
||||
if (Math.abs(steering) < 1) {
|
||||
steering = 0;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(TAG, "steering忽略小数点后====" + (int) steering);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSweeperFutianCleanSystemState(@NonNull ChassisStatesOuterClass.SweeperFuTianTaskSystemStates cleanSystemState) {
|
||||
}
|
||||
@Override
|
||||
public void onSweeperFutianTaskIndexData(@NonNull RoboSweeperTaskIndexOuterClass.RoboSweeperTaskIndex roboSweeperTaskIndex) {
|
||||
|
||||
}
|
||||
/**
|
||||
* 车辆转向灯
|
||||
* @param lightSwitch
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotLightSwitchData(@org.jetbrains.annotations.Nullable Chassis.LightSwitch lightSwitch) {
|
||||
if (lightSwitch != null) {
|
||||
CallerLogger.INSTANCE.d(TAG, "车辆转向灯:" + lightSwitch.toString());
|
||||
/**
|
||||
* 档位
|
||||
* @param gear
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotGearData(@NotNull Chassis.GearPosition gear) {
|
||||
CallerLogger.INSTANCE.d(TAG, "司机屏档位" + gear.toString());
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
if (tapPositionView != null) {
|
||||
tapPositionView.updateWithGear(gear);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 刹车灯
|
||||
* @param brakeLight
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotBrakeLightData(boolean brakeLight) {
|
||||
CallerLogger.INSTANCE.d(TAG, "刹车灯:" + brakeLight);
|
||||
}
|
||||
|
||||
/**
|
||||
* 方向盘转向角 左+右-
|
||||
* @param steering
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotSteeringData(float steering) {
|
||||
CallerLogger.INSTANCE.d(TAG, "steering原始值====" + steering);
|
||||
if (Math.abs(steering) < 1) {
|
||||
steering = 0;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(TAG, "steering忽略小数点后====" + (int) steering);
|
||||
}
|
||||
|
||||
/**
|
||||
* 档位
|
||||
* @param gear
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotGearData(@NotNull Chassis.GearPosition gear) {
|
||||
CallerLogger.INSTANCE.d(TAG, "司机屏档位" + gear.toString());
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
if (tapPositionView != null) {
|
||||
tapPositionView.updateWithGear(gear);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotDataException(long timestamp) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotAcc(float carAcc) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotBrake(float brake) {
|
||||
CallerLogger.INSTANCE.d(TAG, "刹车:" + brake);
|
||||
mBrake = brake;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotThrottle(float throttle) {
|
||||
CallerLogger.INSTANCE.d(TAG, "油门:" + throttle);
|
||||
mThrottle = throttle;
|
||||
}
|
||||
|
||||
};
|
||||
@Override
|
||||
public void onAutopilotBrake(float brake) {
|
||||
CallerLogger.INSTANCE.d(TAG, "刹车:" + brake);
|
||||
mBrake = brake;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotThrottle(float throttle) {
|
||||
CallerLogger.INSTANCE.d(TAG, "油门:" + throttle);
|
||||
mThrottle = throttle;
|
||||
}
|
||||
/**
|
||||
* 设置弧形颜色
|
||||
*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.main.utils;
|
||||
package com.mogo.eagle.core.function.main;
|
||||
|
||||
import android.animation.AnimatorSet;
|
||||
import android.animation.ObjectAnimator;
|
||||
@@ -1,283 +0,0 @@
|
||||
package com.mogo.eagle.core.function.main;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||
|
||||
import android.location.Location;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.main.registercenter.MogoRegisterCenterHandler;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.model.MogoPoi;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-04-24
|
||||
* <p>
|
||||
* 事件回调分发中心
|
||||
*/
|
||||
public class EventDispatchCenter implements
|
||||
IMogoMarkerClickListener,
|
||||
IMogoCarLocationChangedListener2,
|
||||
IMogoMapListener,
|
||||
IMogoLocationListener {
|
||||
|
||||
|
||||
private static volatile EventDispatchCenter sInstance;
|
||||
private Runnable mMapLoadedCallback;
|
||||
|
||||
private EventDispatchCenter() {
|
||||
}
|
||||
|
||||
public static EventDispatchCenter getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (EventDispatchCenter.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new EventDispatchCenter();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private static final String TAG = "DispatchCenter";
|
||||
|
||||
@Override
|
||||
public boolean onMarkerClicked(IMogoMarker marker) {
|
||||
IMogoMarkerClickListener listener = MogoRegisterCenterHandler.getInstance().getMarkerListener(marker.getOwner());
|
||||
if (listener != null) {
|
||||
try {
|
||||
return listener.onMarkerClicked(marker);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onMarkerClicked error : " + e);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onStaticMarkerClicked(IMogoMarker marker) {
|
||||
ArrayList<IMogoMarkerClickListener> list = MogoRegisterCenterHandler.getInstance().getStaticMarkerListener(marker.getOwner());
|
||||
if (list == null) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
for (IMogoMarkerClickListener listener : list) {
|
||||
return listener.onStaticMarkerClicked(marker);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onStaticMarkerClicked error : " + e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged2(Location latLng) {
|
||||
|
||||
Iterator<IMogoCarLocationChangedListener> iterator = MogoRegisterCenterHandler.getInstance().getCarLocationChangedListener();
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
MogoLatLng target = null;
|
||||
while (iterator.hasNext()) {
|
||||
IMogoCarLocationChangedListener listener = iterator.next();
|
||||
if (listener instanceof IMogoCarLocationChangedListener2) {
|
||||
try {
|
||||
((IMogoCarLocationChangedListener2) listener).onCarLocationChanged2(latLng);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 地图加载完成回调
|
||||
*
|
||||
* @param callback
|
||||
*/
|
||||
void setMapLoadedCallback(Runnable callback) {
|
||||
this.mMapLoadedCallback = callback;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
if (mMapLoadedCallback != null) {
|
||||
mMapLoadedCallback.run();
|
||||
mMapLoadedCallback = null;
|
||||
}
|
||||
|
||||
Iterator<IMogoMapListener> iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
while (iterator.hasNext()) {
|
||||
IMogoMapListener listener = iterator.next();
|
||||
if (listener != null) {
|
||||
try {
|
||||
listener.onMapLoaded();
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onMapLoaded error : " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTouch(MotionEvent motionEvent) {
|
||||
Iterator<IMogoMapListener> iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
while (iterator.hasNext()) {
|
||||
IMogoMapListener listener = iterator.next();
|
||||
if (listener != null) {
|
||||
try {
|
||||
listener.onTouch(motionEvent);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onTouch error : " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPOIClick(MogoPoi poi) {
|
||||
Iterator<IMogoMapListener> iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
while (iterator.hasNext()) {
|
||||
IMogoMapListener listener = iterator.next();
|
||||
if (listener != null) {
|
||||
try {
|
||||
listener.onPOIClick(poi);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onPOIClick error : " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapClick(MogoLatLng latLng) {
|
||||
Iterator<IMogoMapListener> iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
while (iterator.hasNext()) {
|
||||
IMogoMapListener listener = iterator.next();
|
||||
if (listener != null) {
|
||||
try {
|
||||
listener.onMapClick(latLng);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onMapClick error : " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLockMap(boolean isLock) {
|
||||
Iterator<IMogoMapListener> iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
while (iterator.hasNext()) {
|
||||
IMogoMapListener listener = iterator.next();
|
||||
if (listener != null) {
|
||||
try {
|
||||
listener.onLockMap(isLock);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onLockMap error : " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapModeChanged(EnumMapUI ui) {
|
||||
Iterator<IMogoMapListener> iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
while (iterator.hasNext()) {
|
||||
IMogoMapListener listener = iterator.next();
|
||||
if (listener != null) {
|
||||
try {
|
||||
listener.onMapModeChanged(ui);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onMapModeChanged error :" + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapVisualAngleChanged(VisualAngleMode visualAngleMode) {
|
||||
Iterator<IMogoMapListener> iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
while (iterator.hasNext()) {
|
||||
IMogoMapListener listener = iterator.next();
|
||||
if (listener != null) {
|
||||
try {
|
||||
listener.onMapVisualAngleChanged(visualAngleMode);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onMapVisualAngleChanged error : " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapChanged(MogoLatLng location, float zoom, float tilt, float bearing) {
|
||||
Iterator<IMogoMapListener> iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
while (iterator.hasNext()) {
|
||||
IMogoMapListener listener = iterator.next();
|
||||
if (listener != null) {
|
||||
try {
|
||||
listener.onMapChanged(location, zoom, tilt, bearing);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onMapChanged error :" + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(MogoLocation location) {
|
||||
|
||||
Iterator<IMogoLocationListener> iterator = MogoRegisterCenterHandler.getInstance().getLocationListeners();
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
while (iterator.hasNext()) {
|
||||
IMogoLocationListener listener = iterator.next();
|
||||
if (listener != null) {
|
||||
try {
|
||||
listener.onLocationChanged(location);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onLocationChanged error : " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_LOG_N
|
||||
import static com.mogo.eagle.core.function.main.MainPresenter.MOGO_PERMISSION_REQUEST_CODE;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
@@ -36,17 +35,15 @@ import com.mogo.commons.mvp.BaseFragment;
|
||||
import com.mogo.commons.mvp.MvpActivity;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig;
|
||||
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
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.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView;
|
||||
import com.mogo.eagle.core.function.main.cards.MogoModulesManager;
|
||||
import com.mogo.eagle.core.function.main.service.MogoMainService;
|
||||
import com.mogo.eagle.core.function.main.modules.MogoModulesManager;
|
||||
import com.mogo.eagle.core.function.main.stagetwo.AutopilotStartup;
|
||||
import com.mogo.eagle.core.function.main.utils.DisplayEffectsHelper;
|
||||
import com.mogo.eagle.core.function.main.windowview.FloatingViewHandler;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
@@ -55,17 +52,21 @@ import com.mogo.eagle.core.utilcode.mogo.toast.ResourcesHelper;
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ProcessUtils;
|
||||
import com.mogo.map.listener.IMogoHosListenerRegister;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.rousetime.android_startup.StartupManager;
|
||||
import com.rousetime.android_startup.model.LoggerLevel;
|
||||
import com.rousetime.android_startup.model.StartupConfig;
|
||||
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 com.zhjt.service.chain.ChainLog;
|
||||
import com.zhjt.service.chain.TracingConstants;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -82,7 +83,6 @@ import system_master.SystemStatusInfo;
|
||||
* 描述:加载各个模块
|
||||
*/
|
||||
public class MainActivity extends MvpActivity<MainView, MainPresenter> implements MainView,
|
||||
IMogoLocationListener,
|
||||
IMoGoAutopilotStatusListener {
|
||||
|
||||
protected static final String TAG = "MainActivity";
|
||||
@@ -130,8 +130,8 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
}
|
||||
|
||||
private void injectStatusBar() {
|
||||
FrameLayout decorView =(FrameLayout) this.getWindow().getDecorView();
|
||||
View contentView = ((ViewGroup)decorView.findViewById(android.R.id.content)).getChildAt(0);
|
||||
FrameLayout decorView = (FrameLayout) this.getWindow().getDecorView();
|
||||
View contentView = ((ViewGroup) decorView.findViewById(android.R.id.content)).getChildAt(0);
|
||||
contentView.setFitsSystemWindows(false);
|
||||
decorView.setClipToPadding(false);
|
||||
|
||||
@@ -229,29 +229,25 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
@Override
|
||||
public void loadModules() {
|
||||
final long start = System.currentTimeMillis();
|
||||
|
||||
MogoModulesManager.getInstance().init(this);
|
||||
IMogoHosListenerRegister listenerRegister = CallerMapUIServiceManager.INSTANCE.getHostListenerRegister();
|
||||
if (listenerRegister != null) {
|
||||
listenerRegister.registerHostMapListener(EventDispatchCenter.getInstance());
|
||||
listenerRegister.registerMarkerClickListener(EventDispatchCenter.getInstance());
|
||||
}
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().registerHostMapListener(TAG, new IMogoMapListener() {
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
// 延时加载其他模块
|
||||
getWindow().getDecorView().post(() -> {
|
||||
HdMapBuildConfig.isMapLoaded = true;
|
||||
loadOthersModules();
|
||||
loadFunctionFragment();
|
||||
|
||||
EventDispatchCenter.getInstance().setMapLoadedCallback(() -> {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "map loaded." + Thread.currentThread().getName());
|
||||
// 延时加载其他模块
|
||||
getWindow().getDecorView().post(() -> {
|
||||
loadOthersModules();
|
||||
loadFunctionFragment();
|
||||
// TODO 这里临时兼容进入VR模式,标记状态机。有些业务(OCH)会根据状态判断加载
|
||||
MogoStatusManager.getInstance().setVrMode(TAG, true);
|
||||
// 设置地图样式
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onMapModeChanged(EnumMapUI.MAP_STYLE_DAY_VR);
|
||||
});
|
||||
CallerLogger.INSTANCE.i(M_HMI + TAG, "App launch timer cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
|
||||
// TODO 这里临时兼容进入VR模式,标记状态机。有些业务(OCH)会根据状态判断加载
|
||||
MogoStatusManager.getInstance().setVrMode(TAG, true);
|
||||
// 设置地图样式
|
||||
MogoMapListenerHandler.getInstance().onMapModeChanged(EnumMapUI.MAP_STYLE_DAY_VR);
|
||||
});
|
||||
CallerLogger.INSTANCE.i(M_HMI + TAG, "App launch timer cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
}
|
||||
});
|
||||
|
||||
// 加载地图
|
||||
loadFunctionMapView();
|
||||
}
|
||||
@@ -264,25 +260,15 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
MogoModulesManager.getInstance().loadFunctionModules();
|
||||
mPresenter.delayOperations();
|
||||
MogoModulesManager.getInstance().loadFunctionModulesServer();
|
||||
|
||||
// 启动一些基本的服务:定位等
|
||||
startBaseService();
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "5秒已过,启动基础服务……");
|
||||
MogoModulesManager.getInstance().loadBaseModule();
|
||||
}, 5_000L);
|
||||
if (DebugConfig.isDebug()) {
|
||||
// 启动Native内存泄漏监测
|
||||
startLeakMonitor();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动后台服务
|
||||
*/
|
||||
private void startBaseService() {
|
||||
Intent intentMainService = new Intent(this, MogoMainService.class);
|
||||
startService(intentMainService);
|
||||
|
||||
// USB 摄像头行车记录仪进程
|
||||
// Intent intentCarcorderService = new Intent(this, CarcorderService.class);
|
||||
// startService(intentCarcorderService);
|
||||
checkMonitorDb();
|
||||
}
|
||||
|
||||
private void startLeakMonitor() {
|
||||
@@ -309,6 +295,25 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
LeakMonitor.INSTANCE.start();
|
||||
}
|
||||
|
||||
private void checkMonitorDb() {
|
||||
new Thread(() -> {
|
||||
long limitId = 50001;
|
||||
File file = this.getDatabasePath(MonitorDb.INTERNAL_DB_NAME);
|
||||
try {
|
||||
if (file != null && file.exists()) {
|
||||
List<CpuInfo> cpuList = MonitorDb.getDb(this).monitorDao().getAllCPUById(limitId);
|
||||
List<MemInfo> memList = MonitorDb.getDb(this).monitorDao().getAllMemById(limitId);
|
||||
// 大于5w条清除
|
||||
if (cpuList.size() > 0 || memList.size() > 0) {
|
||||
this.deleteDatabase(MonitorDb.INTERNAL_DB_NAME);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(TAG, e.getMessage());
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_LINK_LOG_NATIVE_LEAK,
|
||||
linkCode = CHAIN_LINK_LEAK,
|
||||
@@ -356,16 +361,11 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
return new MainPresenter(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(MogoLocation location) {
|
||||
EventDispatchCenter.getInstance().onLocationChanged(location);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
MogoStatusManager.getInstance().setMainPageResumeStatus(TAG, true);
|
||||
MogoStatusManager.getInstance().setMainPageIsBackgroundStatus(TAG, true);
|
||||
MogoStatusManager.getInstance().setMainPageIsBackgroundStatus(TAG, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -380,16 +380,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
MogoStatusManager.getInstance().setMainPageIsBackgroundStatus(TAG, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusResponse(@NonNull AutopilotStatusInfo autoPilotStatusInfo) {
|
||||
int status = autoPilotStatusInfo.getIpcConnStatus();
|
||||
@@ -435,11 +425,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.removeListener(TAG);
|
||||
IMogoHosListenerRegister listenerRegister = CallerMapUIServiceManager.INSTANCE.getHostListenerRegister();
|
||||
if (listenerRegister != null) {
|
||||
listenerRegister.unregisterMarkerClickListener();
|
||||
listenerRegister.unregisterHostMapListener();
|
||||
}
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().unregisterHostMapListener(TAG);
|
||||
IMogoMapUIController mapUIController = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
||||
if (mapUIController != null) {
|
||||
mapUIController.destroy();
|
||||
|
||||
@@ -5,18 +5,19 @@ 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.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Process;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.module.intent.IMogoIntentListener;
|
||||
import com.mogo.commons.module.intent.IntentManager;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
@@ -25,12 +26,12 @@ 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.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.MultiDisplayUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.rousetime.android_startup.model.CostTimesModel;
|
||||
@@ -141,9 +142,42 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
* 加载网约车模块
|
||||
*/
|
||||
private void loadOCHModule() {
|
||||
IMoGoFunctionProvider ochProvider = (IMoGoFunctionProvider) ARouter.getInstance()
|
||||
.build("/och/api")
|
||||
.navigation(getContext());
|
||||
IMoGoFunctionProvider ochProvider;
|
||||
// 兼容处理之前联想PAD及小巴车多个设备部署不同APP方案
|
||||
if (!DebugConfig.isMultiDisplay()) {
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
ochProvider = (IMoGoFunctionProvider) ARouter.getInstance()
|
||||
.build("/driver/api")
|
||||
.navigation(getContext());
|
||||
} else {
|
||||
ochProvider = (IMoGoFunctionProvider) ARouter.getInstance()
|
||||
.build("/passenger/api")
|
||||
.navigation(getContext());
|
||||
}
|
||||
}
|
||||
// 处理一个机器多个屏幕方案
|
||||
else {
|
||||
ochProvider = (IMoGoFunctionProvider) ARouter.getInstance()
|
||||
.build("/passenger/api")
|
||||
.navigation(getContext());
|
||||
//
|
||||
// // 启动乘客端Act
|
||||
// if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) ||
|
||||
// AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
|
||||
// MultiDisplayUtils.INSTANCE.startActWithSecond(
|
||||
// this,
|
||||
// PassengerLauncherActivity.class);
|
||||
// }
|
||||
|
||||
// 启动广告视频Atc
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) ||
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
|
||||
MultiDisplayUtils.INSTANCE.startActWithSecond(
|
||||
this,
|
||||
VideoAdAtc.class);
|
||||
}
|
||||
}
|
||||
|
||||
if (ochProvider != null) {
|
||||
ochProvider.createCoverage(this, R.id.module_main_id_och_fragment);
|
||||
}
|
||||
@@ -204,17 +238,17 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
*/
|
||||
@Override
|
||||
public boolean dispatchKeyEvent(KeyEvent event) {
|
||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent code = " + event.getKeyCode() + "--action = " + event.getAction() + "----" + event);
|
||||
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) {
|
||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager","dispatchKeyEvent ---1--- bluetoothName = " + bluetoothName);
|
||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent ---1--- bluetoothName = " + bluetoothName);
|
||||
}
|
||||
if (bluetoothName.equals("MINI_KEYBOARD")) {
|
||||
if (!isPressEnd) {
|
||||
isPressEnd = true;
|
||||
startPressTime = System.currentTimeMillis();
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager","dispatchKeyEvent ---2--- bluetoothName = " + bluetoothName + "--- code = " + event.getKeyCode() + "--action = " + event.getAction());
|
||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent ---2--- bluetoothName = " + bluetoothName + "--- code = " + event.getKeyCode() + "--action = " + event.getAction());
|
||||
if (event.getKeyCode() == KeyEvent.KEYCODE_A) { //单击 -1,长按无操作,AB组合-2
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
pressADownTime = System.currentTimeMillis();
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.mogo.eagle.core.function.main;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||
|
||||
import android.app.NotificationManager;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
import android.os.Process;
|
||||
|
||||
@@ -17,18 +17,15 @@ import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.module.MogoModule;
|
||||
import com.mogo.commons.module.MogoModulePaths;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.function.api.chat.biz.ChatConsts;
|
||||
import com.mogo.eagle.core.function.api.devatools.IMogoDevaToolsUpgradeListener;
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsUpgradeListenerManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.function.msgbox.db.MsgBoxDb;
|
||||
import com.mogo.eagle.core.function.overview.OverviewDb;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
@@ -37,20 +34,15 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.ProcessUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.SPUtils;
|
||||
import com.mogo.map.MapApiPath;
|
||||
import com.zhidao.support.obu.ami.AmiClientManager;
|
||||
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;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 默认初始化一些基础服务配置
|
||||
* 默认初始化一些基础服务配置 todo 分离 overView业务 和 msgBox去各自模块中 --- 扶风
|
||||
*/
|
||||
public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
|
||||
@@ -65,34 +57,35 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
}
|
||||
start = System.currentTimeMillis();
|
||||
connectAmiIp();
|
||||
initOverviewDb();
|
||||
// Crash 日志收集
|
||||
initCrashConfig();
|
||||
initLogConfig();
|
||||
initTipToast();
|
||||
initModules();
|
||||
if (DebugConfig.isDebug()) {
|
||||
initKoom();
|
||||
}
|
||||
//查询是否有版本的更新
|
||||
queryAppUpgrade();
|
||||
clearMessageBoxTable();
|
||||
checkMonitorDb();
|
||||
if (ProcessUtils.isMainProcess(this)) {
|
||||
initOverviewDb();
|
||||
if (DebugConfig.isDebug()) {
|
||||
initKoom();
|
||||
}
|
||||
clearMessageBoxTable();
|
||||
CallerMsgBoxManager.INSTANCE.queryAllMessages(this);
|
||||
}
|
||||
upgradeProgressListener();
|
||||
CallerMsgBoxManager.INSTANCE.queryAllMessages(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldInit() {
|
||||
CallerLogger.INSTANCE.w(M_HMI + TAG, "evaluate shouldInit() with: " + ProcessUtils.getProcessName(Process.myPid()));
|
||||
return ProcessUtils.isMainProcess(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void queryAppUpgrade() {
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
CallerBindingcarManager.getBindingcarProvider().queryAppUpgrade();
|
||||
CallerDevaToolsManager.INSTANCE.queryAppUpgrade();
|
||||
}
|
||||
},9000);
|
||||
}
|
||||
@@ -104,47 +97,40 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date currDate = new Date(System.currentTimeMillis());
|
||||
String currTimeStr = format.format(currDate);
|
||||
if (lastLaunchTimeStr != null && !lastLaunchTimeStr.isEmpty()) {
|
||||
boolean isSameDay = currTimeStr.equals(lastLaunchTimeStr);
|
||||
// 超过一天需要清除消息盒子中的数据,并把时间戳存入SP
|
||||
if (!isSameDay) {
|
||||
try {
|
||||
if (lastLaunchTimeStr != null && !lastLaunchTimeStr.isEmpty()) {
|
||||
boolean isSameDay = currTimeStr.equals(lastLaunchTimeStr);
|
||||
// 超过一天需要清除消息盒子中的数据,并把时间戳存入SP
|
||||
if (!isSameDay) {
|
||||
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);
|
||||
}
|
||||
} 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();
|
||||
}
|
||||
|
||||
private void checkMonitorDb() {
|
||||
new Thread(() -> {
|
||||
long limitId = 50001;
|
||||
List<CpuInfo> cpuList = MonitorDb.getDb(this).monitorDao().getAllCPUById(limitId);
|
||||
List<MemInfo> memList = MonitorDb.getDb(this).monitorDao().getAllMemById(limitId);
|
||||
// 大于5w条清除
|
||||
if (cpuList.size() > 0 || memList.size() > 0) {
|
||||
this.deleteDatabase(MonitorDb.INTERNAL_DB_NAME);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(TAG, e.getMessage());
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
// TODO 李小鹏 这里需要将逻辑抽离出去,单独使用更新服务控制
|
||||
private void upgradeProgressListener() {
|
||||
final NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
|
||||
builder.setSmallIcon(R.mipmap.icon1001);
|
||||
// builder.setSmallIcon(R.mipmap.icon1001);//todo emArrow 更换图标,去除地图下载图标的依赖关系
|
||||
builder.setContentTitle("下载");
|
||||
builder.setContentText("正在下载");
|
||||
final NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
||||
CallerDevaToolsUpgradeListenerManager.INSTANCE.registerDevaToolsUpgradeListener(TAG, new IMogoDevaToolsUpgradeListener() {
|
||||
CallerDevaToolsUpgradeListenerManager.INSTANCE.addListener(TAG, new IMogoDevaToolsUpgradeListener() {
|
||||
@Override
|
||||
public void onStart(@Nullable String url) {
|
||||
|
||||
@@ -223,35 +209,19 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
|
||||
private void initModules() {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "initModules");
|
||||
//och模块
|
||||
MogoModulePaths.addModuleFunction(new MogoModule("/och/api", "IMoGoFunctionProvider"));
|
||||
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MapApiPath.PATH, "CustomMapApiBuilder"));
|
||||
// MogoModulePaths.addBaseModule(new MogoModule(V2XConst.PATH_V2X_UI, V2XConst.MODULE_NAME));
|
||||
|
||||
// OBU 模块
|
||||
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_V2X_OBU_MOGO, "IMoGoObuProvider"));
|
||||
// 超视距,路测、行车记录仪监控
|
||||
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_AI_MONITORING, "IMoGoMonitoringProvider"));
|
||||
// 云公告发布
|
||||
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_AI_NOTICE, "IMoGoNoticeProvider"));
|
||||
// BIZ
|
||||
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_FUNC_BIZ, "IMoGoNoticeProvider"));
|
||||
// 车聊聊,IM
|
||||
MogoModulePaths.addModuleFunctionServer(new MogoModule(ChatConsts.CHAT_PROVIDER_PATH, ChatConsts.CHAT_MODULE_NAME));
|
||||
// 调度
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_AI_DISPATCH, "IDispatchProvider"));
|
||||
// V2X 模块
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_V2X_MODULE, "V2XProvider"));
|
||||
// 自动驾驶系统检测模块
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_CHECK, "CheckProvider"));
|
||||
// 绑定车辆
|
||||
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_BINDING_CAR, "IMoGoBindingcarProvider"));
|
||||
|
||||
// 司机身份专属模块
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
// 地图数据收集模块
|
||||
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_MAP_DATA_COLLECT_PROVIDER, "MoGoMapDataCollector"));
|
||||
}
|
||||
|
||||
CallerLogger.INSTANCE.i(M_HMI + TAG, "App launch timer cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
}
|
||||
|
||||
@@ -259,9 +229,9 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
protected void attachBaseContext(Context base) {
|
||||
super.attachBaseContext(base);
|
||||
/*如果是主进程**/
|
||||
if (ProcessUtils.isMainProcess(this)) {
|
||||
// if (ProcessUtils.isMainProcess(this)) {
|
||||
AppLaunchTimeUtils.beginTimeCalculate(AppLaunchTimeUtils.COLD_START);
|
||||
}
|
||||
// }
|
||||
BoostMultiDex.install(base);
|
||||
AbsMogoApplication.sApp = this;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mogo.eagle.core.function.main;
|
||||
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
|
||||
@@ -0,0 +1,426 @@
|
||||
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_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;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
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.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.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;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.rousetime.android_startup.model.CostTimesModel;
|
||||
import com.zhjt.service.chain.ChainLog;
|
||||
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;
|
||||
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils;
|
||||
|
||||
/**
|
||||
* 针对作为Launcher的情况,做个性化操作
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class PassengerLauncherActivity extends MainActivity implements IMogoIntentListener, IMoGoSkinModeChangeListener {
|
||||
private static final String TAG = "PassengerLauncherActivity";
|
||||
protected boolean mIsHomeKeyDown = false;
|
||||
private final static Handler handlerV2XEvent = new Handler();
|
||||
private static Runnable runnableV2XEvent;
|
||||
|
||||
private volatile double accelerated;//加速度
|
||||
private Timer timerHorn;
|
||||
private Timer timerAcc;
|
||||
|
||||
private BluetoothMonitorReceiver mBluetoothReceiver = null;
|
||||
private BluetoothAdapter mBluetoothAdapter;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EventBus.getDefault().register(this);
|
||||
CallerLogger.INSTANCE.i(M_HMI + TAG, "onCreate");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
initBluetooth();
|
||||
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
|
||||
if (!mBluetoothAdapter.isEnabled()) {
|
||||
mBluetoothAdapter.enable();
|
||||
}
|
||||
mBluetoothAdapter.startDiscovery();
|
||||
showBondedDevice(mBluetoothAdapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
super.initViews();
|
||||
// 这里在初始化完GUI后,做一些个性化的定制
|
||||
// 小巴车的乘客屏幕
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) &&
|
||||
AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
FrameLayout frameLayout = findViewById(R.id.module_main_id_map_fragment_container);
|
||||
frameLayout.setPadding(0, 0, AutoSizeUtils.dp2px(getContext(),700), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
IntentManager.getInstance().registerIntentListener(Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this);
|
||||
// 添加换肤监听
|
||||
CallerSkinModeListenerManager.INSTANCE.addListener(TAG, this);
|
||||
//ActivityLifecycleManager.getInstance().setAppActive(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
mIsHomeKeyDown = false;
|
||||
unregisterReceiver(this.mBluetoothReceiver);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
IntentManager.getInstance().unregisterIntentListener(Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this);
|
||||
//ActivityLifecycleManager.getInstance().setAppActive(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onIntentReceived(String intentStr, Intent intent) {
|
||||
if (TextUtils.equals(Intent.ACTION_CLOSE_SYSTEM_DIALOGS, intentStr)) {
|
||||
mIsHomeKeyDown = intent.getBooleanExtra("isHomeKeyDown", true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadOthersModules() {
|
||||
super.loadOthersModules();
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "loadOthersModules");
|
||||
loadOCHModule();
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载网约车模块
|
||||
*/
|
||||
private void loadOCHModule() {
|
||||
IMoGoFunctionProvider ochProvider = (IMoGoFunctionProvider) ARouter.getInstance()
|
||||
.build("/passenger/api")
|
||||
.navigation(getContext());
|
||||
if (ochProvider != null) {
|
||||
ochProvider.createCoverage(this, R.id.module_main_id_och_fragment);
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(sticky = true)
|
||||
public void handleStartUp(List<CostTimesModel> costTimesModels) {
|
||||
for (CostTimesModel costModel : costTimesModels) {
|
||||
traceStartUp(costModel.toString());
|
||||
}
|
||||
EventBus.getDefault().removeStickyEvent(costTimesModels);
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_LINK_LOG_CONNECT_STATUS,
|
||||
linkCode = CHAIN_LINK_INIT,
|
||||
endpoint = TracingConstants.Endpoint.PAD,
|
||||
nodeAliasCode = CHAIN_ALIAS_CODE_START_UP,
|
||||
paramIndexes = {0},
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
private void traceStartUp(String content) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, content);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
stopCountDown();
|
||||
try {
|
||||
// acc off 之后会出现进程还在,但是页面被杀的情况,这个直接杀掉进程,然后让整个进程重启
|
||||
Process.killProcess(Process.myPid());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 移除换肤监听
|
||||
CallerSkinModeListenerManager.INSTANCE.removeListener(TAG);
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
private void stopCountDown() {
|
||||
if (runnableV2XEvent != null) {
|
||||
handlerV2XEvent.removeCallbacks(runnableV2XEvent);
|
||||
runnableV2XEvent = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
private long startPressTime = 0; //开始按减时间
|
||||
private boolean isPressEnd = false; //按键是否结束
|
||||
private boolean isCombinationKey = false; //是否是组合按键
|
||||
|
||||
private long pressADownTime = 0;
|
||||
private long pressAUpTime = 0;
|
||||
private long pressBDownTime = 0;
|
||||
private long pressBUpTime = 0;
|
||||
private long pressCDownTime = 0;
|
||||
private long pressCUpTime = 0;
|
||||
private long pressDDownTime = 0;
|
||||
private long pressDUpTime = 0;
|
||||
private long pressEDownTime = 0;
|
||||
private long pressEUpTime = 0;
|
||||
|
||||
|
||||
/**
|
||||
* 魔方按键分发 提测前注释 ToastUtils TODO
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean dispatchKeyEvent(KeyEvent event) {
|
||||
// Log.d(TAG, "dispatchKeyEvent code = " + event.getKeyCode() + "--action = " + event.getAction() + "----" + event);
|
||||
String bluetoothName = SharedPrefsMgr.getInstance(getContext()).getString("BLUETOOTH");
|
||||
if (!isPressEnd) {
|
||||
Log.e(TAG, "dispatchKeyEvent bluetoothName = " + bluetoothName);
|
||||
}
|
||||
if (bluetoothName.equals("MINI_KEYBOARD")) {
|
||||
if (!isPressEnd) {
|
||||
isPressEnd = true;
|
||||
startPressTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
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);
|
||||
if ((pressADownTime - startPressTime) > 350 && (pressADownTime - startPressTime) < 1800 && pressBDownTime > 0) {
|
||||
ToastUtils.showShort("方块 A 按AB组合 -2 ");
|
||||
sendAcc(true, -2);
|
||||
isCombinationKey = true;
|
||||
}
|
||||
if (!isCombinationKey) {
|
||||
if ((pressADownTime - startPressTime) > 1900) {
|
||||
ToastUtils.showShort("方块 长按A 无 操作 ");
|
||||
}
|
||||
}
|
||||
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
||||
pressAUpTime = System.currentTimeMillis();
|
||||
isPressEnd = false;
|
||||
isCombinationKey = false;
|
||||
Log.e(TAG, "dispatchKeyEvent A up pressAUpTime = " + pressAUpTime + "---" + (pressAUpTime - startPressTime) + "--pressBDownTime = " + pressBDownTime);
|
||||
if ((pressAUpTime - startPressTime) < 300) {
|
||||
ToastUtils.showShort("方块 单击A -1 ");
|
||||
sendAcc(true, -1);
|
||||
}
|
||||
pressAUpTime = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
} 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);
|
||||
if ((pressBDownTime - startPressTime) > 350 && (pressBDownTime - startPressTime) < 1800 && pressADownTime > 0) {
|
||||
ToastUtils.showShort("方块 B 按AB组合 ");
|
||||
sendAcc(true, -2);
|
||||
isCombinationKey = true;
|
||||
}
|
||||
if (!isCombinationKey) {
|
||||
if ((pressBDownTime - startPressTime) > 1900) {
|
||||
ToastUtils.showShort("方块 长按B =1 ");
|
||||
sendAcc(true, +1);
|
||||
}
|
||||
}
|
||||
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
||||
pressBUpTime = System.currentTimeMillis();
|
||||
isPressEnd = false;
|
||||
isCombinationKey = false;
|
||||
Log.e(TAG, "dispatchKeyEvent B up pressBUpTime = " + pressBUpTime + "--差-" + (pressBUpTime - startPressTime) + "--pressADownTime = " + pressADownTime);
|
||||
if ((pressBUpTime - startPressTime) < 300) {
|
||||
ToastUtils.showShort("方块 单击B 0 ");
|
||||
sendAcc(false, 0.0);
|
||||
}
|
||||
pressBDownTime = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if (event.getKeyCode() == KeyEvent.KEYCODE_C) { //单击左变道,长按无操作
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
pressCDownTime = System.currentTimeMillis();
|
||||
if (!isCombinationKey) {
|
||||
if ((pressCDownTime - startPressTime) > 1900) {
|
||||
ToastUtils.showShort("方块 长按C 无操作 ");
|
||||
}
|
||||
}
|
||||
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
||||
pressCUpTime = System.currentTimeMillis();
|
||||
isPressEnd = false;
|
||||
isCombinationKey = false;
|
||||
if ((pressCUpTime - startPressTime) < 300) {
|
||||
ToastUtils.showShort("方块 单击C ← 向左变道 ");
|
||||
CallerAutoPilotManager.INSTANCE.sendOperatorChangeLaneLeft();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else if (event.getKeyCode() == KeyEvent.KEYCODE_D) { //单击向右变道,双击无操作
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
pressDDownTime = System.currentTimeMillis();
|
||||
if (!isCombinationKey) {
|
||||
if ((pressDDownTime - startPressTime) > 1900) {
|
||||
ToastUtils.showShort("方块 长按D 无操作 ");
|
||||
}
|
||||
}
|
||||
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
||||
pressDUpTime = System.currentTimeMillis();
|
||||
isPressEnd = false;
|
||||
isCombinationKey = false;
|
||||
if ((pressDUpTime - startPressTime) < 300) {
|
||||
ToastUtils.showShort("方块 单击D → 向右变道 ");
|
||||
CallerAutoPilotManager.INSTANCE.sendOperatorChangeLaneRight();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if (event.getKeyCode() == KeyEvent.KEYCODE_E) { //单击启动自驾,长按鸣笛
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
pressEDownTime = System.currentTimeMillis();
|
||||
if (!isCombinationKey) {
|
||||
if ((pressEDownTime - startPressTime) > 1900) {
|
||||
ToastUtils.showShort("方块 长按E 鸣笛 ");
|
||||
CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(1);
|
||||
if (timerHorn == null) {
|
||||
timerHorn = new Timer();
|
||||
}
|
||||
timerHorn.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(2);
|
||||
timerHorn = null;
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
||||
pressEUpTime = System.currentTimeMillis();
|
||||
isPressEnd = false;
|
||||
isCombinationKey = false;
|
||||
if ((pressEUpTime - startPressTime) < 300) {
|
||||
ToastUtils.showShort("方块 单击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) {
|
||||
if (isSend) {
|
||||
accelerated = acc;
|
||||
if (timerAcc == null) {
|
||||
timerAcc = new Timer();
|
||||
timerAcc.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
CallerAutoPilotManager.INSTANCE.sendOperatorSetAcceleratedSpeed(accelerated);
|
||||
}
|
||||
}, 0, 500);
|
||||
}
|
||||
} else {
|
||||
if (timerAcc != null) {
|
||||
timerAcc.cancel();
|
||||
timerAcc = null;
|
||||
}
|
||||
CallerAutoPilotManager.INSTANCE.sendOperatorSetAcceleratedSpeed(acc);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化蓝牙广播
|
||||
*/
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.mogo.eagle.core.function.main
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import com.mogo.eagle.core.widget.TextureVideoView
|
||||
|
||||
/**
|
||||
* 视频广告
|
||||
*/
|
||||
class VideoAdAtc : AppCompatActivity() {
|
||||
|
||||
private lateinit var svpFrame: TextureVideoView
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_video_ad_atc)
|
||||
|
||||
svpFrame = findViewById(R.id.svp_frame)
|
||||
|
||||
val url = "android.resource://" + packageName + "/" + R.raw.mogo_ad
|
||||
svpFrame.videoPath = url
|
||||
svpFrame.start()
|
||||
|
||||
BarUtils.hideStatusBarAndSticky(this.window)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.main.cards;
|
||||
package com.mogo.eagle.core.function.main.modules;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.main.cards;
|
||||
package com.mogo.eagle.core.function.main.modules;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
package com.mogo.eagle.core.function.main.monitoring;
|
||||
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
|
||||
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.check.CallerCheckManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 车辆监控,暂时隐藏该功能
|
||||
* @since: 8/16/21
|
||||
*/
|
||||
public class VehicleMonitoring implements Handler.Callback {
|
||||
|
||||
private static final String TAG = "VehicleMonitoring";
|
||||
private final Context mContext;
|
||||
private final Handler mHandler = new Handler(this);
|
||||
//自动驾驶状态下**分钟间隔弹框提示一次 后期根据需求做修改,暂定30秒自检一次
|
||||
private static final long AUTO_CHECK_STATUS_DELAY = 30 * 1000;
|
||||
//非自动驾驶测试数据 后期根据需求做修改
|
||||
private static final long MANUAL_CHECK_STATUS_DELAY = 30 * 1000;
|
||||
//自动驾驶状态
|
||||
private static int AutopilotStatus = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState();
|
||||
|
||||
public VehicleMonitoring(Context context) {
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
public void vehicleCheck() {
|
||||
//暂时隐藏自检功能
|
||||
/**
|
||||
*
|
||||
if (AutopilotStatus == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "自动驾驶中...");
|
||||
mHandler.sendEmptyMessageDelayed(AutopilotStatus, AUTO_CHECK_STATUS_DELAY);
|
||||
} else {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "非自动驾驶状态");
|
||||
//非自动驾驶状态只展示一次
|
||||
mHandler.sendEmptyMessageDelayed(AutopilotStatus, MANUAL_CHECK_STATUS_DELAY);
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleMessage(Message msg) {
|
||||
// AutopilotStatus = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState();
|
||||
// switch (msg.what) {
|
||||
// case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING:
|
||||
// vehicleMonitor();
|
||||
// mHandler.sendEmptyMessageDelayed(AutopilotStatus, AUTO_CHECK_STATUS_DELAY);
|
||||
// return true;
|
||||
// case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE:
|
||||
// case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE:
|
||||
// vehicleMonitor();
|
||||
// mHandler.sendEmptyMessageDelayed(AutopilotStatus, MANUAL_CHECK_STATUS_DELAY);
|
||||
// return true;
|
||||
// default:
|
||||
// }
|
||||
return false;
|
||||
}
|
||||
|
||||
public void vehicleMonitor() {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "vehicleMonitor");
|
||||
CallerCheckManager.checkMonitor(mContext);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
package com.mogo.eagle.core.function.main.registercenter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-09
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
@Route(path = MogoServicePaths.PATH_REGISTER_CENTER)
|
||||
public class MogoRegisterCenter implements IMogoRegisterCenter {
|
||||
|
||||
@Override
|
||||
public void registerMogoMapListener(String moduleName, IMogoMapListener listener) {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoMapListener(moduleName, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoMapListener(String moduleName) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoMapListener(moduleName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoLocationListener(String moduleName, IMogoLocationListener listener) {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoLocationListener(moduleName, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<IMogoLocationListener> getLocationListeners() {
|
||||
return MogoRegisterCenterHandler.getInstance().getLocationListeners();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoLocationListener(String moduleName) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoLocationListener(moduleName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoMarkerClickListener(String moduleName, IMogoMarkerClickListener listener) {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoMarkerClickListener(moduleName, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoMarkerClickListener(String moduleName) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoMarkerClickListener(moduleName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoStaticMarkerClickListener(String tag, IMogoMarkerClickListener listener) {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoStaticMarkerClickListener(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoStaticMarkerClickListener(String tag, IMogoMarkerClickListener listener ) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoStaticMarkerClickListener(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCarLocationChangedListener(String tag, IMogoCarLocationChangedListener listener) {
|
||||
MogoRegisterCenterHandler.getInstance().registerCarLocationChangedListener(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterCarLocationChangedListener(String tag, IMogoCarLocationChangedListener listener) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterCarLocationChangedListener(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
}
|
||||
}
|
||||
@@ -1,137 +0,0 @@
|
||||
package com.mogo.eagle.core.function.main.registercenter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-09
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class MogoRegisterCenterHandler implements IMogoRegisterCenter {
|
||||
|
||||
private static volatile MogoRegisterCenterHandler sInstance;
|
||||
|
||||
private final Map<String, IMogoMapListener> mMap = new HashMap<>();
|
||||
private final Map<String, IMogoLocationListener> mLocation = new HashMap<>();
|
||||
private final Map<String, IMogoMarkerClickListener> mMarker = new HashMap<>();
|
||||
private final Map<String, ArrayList<IMogoMarkerClickListener>> mStaticMarker = new HashMap<>();
|
||||
private final Map<String, IMogoCarLocationChangedListener> mCarLocations = new ConcurrentHashMap<>();
|
||||
|
||||
private MogoRegisterCenterHandler() {
|
||||
}
|
||||
|
||||
public static MogoRegisterCenterHandler getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (MogoRegisterCenterHandler.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new MogoRegisterCenterHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoMapListener(String tag, IMogoMapListener listener) {
|
||||
mMap.put(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoMapListener(String tag) {
|
||||
mMap.remove(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoLocationListener(String tag, IMogoLocationListener listener) {
|
||||
mLocation.put(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoLocationListener(String tag) {
|
||||
mLocation.remove(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoMarkerClickListener(String tag, IMogoMarkerClickListener listener) {
|
||||
mMarker.put(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoMarkerClickListener(String tag) {
|
||||
mMarker.remove(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoStaticMarkerClickListener(String tag, IMogoMarkerClickListener listener) {
|
||||
ArrayList<IMogoMarkerClickListener> list = mStaticMarker.get(tag);
|
||||
if (list == null) {
|
||||
list = new ArrayList<>();
|
||||
list.add(listener);
|
||||
mStaticMarker.put(tag, list);
|
||||
}
|
||||
list.add(listener);
|
||||
mStaticMarker.put(tag, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoStaticMarkerClickListener(String tag, IMogoMarkerClickListener listener) {
|
||||
ArrayList<IMogoMarkerClickListener> list = mStaticMarker.get(tag);
|
||||
if (list == null) {
|
||||
return;
|
||||
}
|
||||
list.remove(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCarLocationChangedListener(String tag, IMogoCarLocationChangedListener listener) {
|
||||
mCarLocations.put(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterCarLocationChangedListener(String tag, IMogoCarLocationChangedListener listener) {
|
||||
mCarLocations.remove(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
}
|
||||
|
||||
public IMogoMarkerClickListener getMarkerListener(String tag) {
|
||||
return mMarker.get(tag);
|
||||
}
|
||||
|
||||
public ArrayList<IMogoMarkerClickListener> getStaticMarkerListener(String tag){
|
||||
return mStaticMarker.get(tag);
|
||||
}
|
||||
|
||||
public Iterator<IMogoMapListener> getMapListeners() {
|
||||
return mMap.values().iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<IMogoLocationListener> getLocationListeners() {
|
||||
return mLocation.values().iterator();
|
||||
}
|
||||
|
||||
public Iterator<IMogoCarLocationChangedListener> getCarLocationChangedListener() {
|
||||
return mCarLocations.values().iterator();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
package com.mogo.eagle.core.function.main.service;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.os.IBinder;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.function.main.EventDispatchCenter;
|
||||
import com.mogo.eagle.core.function.main.cards.MogoModulesManager;
|
||||
import com.mogo.eagle.core.function.main.monitoring.VehicleMonitoring;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.navi.MogoCarLocationChangedListenerRegister;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/10
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
@Route(path = "/service/base/info")
|
||||
class MogoMainService extends Service implements IMogoLocationListener {
|
||||
|
||||
private static final String TAG = "MogoMainService";
|
||||
|
||||
/**
|
||||
* 主模块管控定位,可以向各个模块发送统一定位信息
|
||||
*/
|
||||
private IMogoLocationClient mLocationClient;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "基本服务启动");
|
||||
initAndStartLocation();
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "5秒已过,启动基础服务……");
|
||||
loadBaseModules();
|
||||
initGpsSimulatorListener();
|
||||
HdMapBuildConfig.isMapLoaded = true;
|
||||
}, 5_000L
|
||||
);
|
||||
// 车辆检测
|
||||
VehicleMonitoring monitoring = new VehicleMonitoring(this);
|
||||
monitoring.vehicleCheck();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
return START_NOT_STICKY;
|
||||
}
|
||||
|
||||
private void initAndStartLocation() {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "开始定位");
|
||||
mLocationClient = CallerMapUIServiceManager.INSTANCE.getSingletonLocationClient(AbsMogoApplication.getApp());
|
||||
if (mLocationClient != null) {
|
||||
mLocationClient.addLocationListener(this);
|
||||
mLocationClient.start(2_000L);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化自车定位监听
|
||||
*/
|
||||
private void initGpsSimulatorListener() {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "注册自车位置监听");
|
||||
MogoCarLocationChangedListenerRegister.getInstance().registerCarLocationChangedListener(EventDispatchCenter.getInstance());
|
||||
}
|
||||
|
||||
private void loadBaseModules() {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "加载基本模块");
|
||||
MogoModulesManager.getInstance().loadBaseModule();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(MogoLocation location) {
|
||||
EventDispatchCenter.getInstance().onLocationChanged(location);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mLocationClient != null) {
|
||||
mLocationClient.removeLocationListener(this);
|
||||
mLocationClient.stop();
|
||||
mLocationClient.destroy();
|
||||
mLocationClient = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/color_E63B4577" />
|
||||
<corners android:radius="@dimen/module_services_dispatch_airport_dialog_corner" />
|
||||
|
||||
</shape>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/color_3E7BFE" />
|
||||
<corners android:radius="@dimen/module_services_dispatch_airport_dialog_affirm_corner" />
|
||||
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="@dimen/module_services_dispatch_cars_dialog_corner"/>
|
||||
<solid android:color="@color/color_E63B4577"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:bottomLeftRadius="@dimen/module_services_dispatch_cars_dialog_corner"/>
|
||||
<solid android:color="@color/color_E63B4577"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:bottomRightRadius="@dimen/module_services_dispatch_cars_dialog_corner"/>
|
||||
<solid android:color="@color/color_E63B4577"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/color_E63B4577" />
|
||||
<corners android:bottomLeftRadius="@dimen/module_services_dispatch_cars_dialog_corner" />
|
||||
</shape>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/color_E63B4577" />
|
||||
<corners android:bottomRightRadius="@dimen/module_services_dispatch_cars_dialog_corner" />
|
||||
</shape>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
|
||||
<solid android:color="@color/color_4D000000"/>
|
||||
</shape>
|
||||
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--<selector xmlns:android="http://schemas.android.com/apk/res/android">-->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="135"
|
||||
android:endColor="#80000000"
|
||||
android:startColor="#80000000"
|
||||
android:type="linear" />
|
||||
<corners android:radius="@dimen/module_push_ui_bkg_corner" />
|
||||
</shape>
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="@dimen/dp_768"
|
||||
android:layout_height="@dimen/dp_432">
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/road_video_bg"
|
||||
tools:context="com.mogo.eagle.core.function.main.VideoAdAtc">
|
||||
|
||||
|
||||
<com.serenegiant.usb.widget.UVCCameraTextureView
|
||||
android:id="@+id/carcorderPreview"
|
||||
<com.mogo.eagle.core.widget.TextureVideoView
|
||||
android:id="@+id/svp_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,122 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="@dimen/module_services_dispatch_airport_dialog_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_adas_dispatch">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_services_dispatch_dialog_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/module_services_dispatch_airport_dialog_title_margin_top"
|
||||
android:text="@string/dispatch_dialog_title"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_services_dispatch_airport_dialog_title_size"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/module_services_dispatch_airport_dialog_first_column_margin_left"
|
||||
android:layout_marginTop="@dimen/module_services_dispatch_airport_dialog_startloc_margin_top"
|
||||
android:text="@string/dispatch_dialog_start_loc"
|
||||
android:textSize="@dimen/module_services_dispatch_airport_dialog_next_level_title_size" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_services_dispatch_dialog_start_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/module_services_dispatch_airport_dialog_first_column_margin_left"
|
||||
android:layout_marginTop="@dimen/module_services_dispatch_airport_dialog_startloc_content_margin_top"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_services_dispatch_airport_dialog_title_size"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/module_services_dispatch_airport_dialog_first_column_margin_left"
|
||||
android:layout_marginTop="@dimen/module_services_dispatch_airport_dialog_endloc_margin_top"
|
||||
android:text="@string/dispatch_dialog_end_loc"
|
||||
android:textSize="@dimen/module_services_dispatch_airport_dialog_next_level_title_size" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_services_dispatch_dialog_end_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/module_services_dispatch_airport_dialog_first_column_margin_left"
|
||||
android:layout_marginTop="@dimen/module_services_dispatch_airport_dialog_endloc_content_margin_top"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_services_dispatch_airport_dialog_title_size"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/module_services_dispatch_airport_dialog_first_column_margin_left"
|
||||
android:layout_marginTop="@dimen/module_services_dispatch_airport_dialog_task_margin_top"
|
||||
android:text="@string/dispatch_dialog_task_info"
|
||||
android:textSize="@dimen/module_services_dispatch_airport_dialog_next_level_title_size" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_services_dispatch_dialog_task_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/module_services_dispatch_airport_dialog_first_column_margin_left"
|
||||
android:layout_marginEnd="@dimen/module_services_dispatch_airport_dialog_first_column_margin_left"
|
||||
android:layout_marginTop="@dimen/module_services_dispatch_airport_dialog_task_content_margin_top"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_services_dispatch_airport_dialog_task_content_size" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/module_services_dispatch_airport_dialog_last_column_margin_left"
|
||||
android:layout_marginTop="@dimen/module_services_dispatch_airport_dialog_startloc_margin_top"
|
||||
android:text="@string/dispatch_dialog_task_time"
|
||||
android:textSize="@dimen/module_services_dispatch_airport_dialog_next_level_title_size" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_services_dispatch_dialog_task_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/module_services_dispatch_airport_dialog_last_column_margin_left"
|
||||
android:layout_marginTop="@dimen/module_services_dispatch_airport_dialog_startloc_content_margin_top"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_services_dispatch_airport_dialog_title_size"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/module_services_dispatch_airport_dialog_last_column_margin_left"
|
||||
android:layout_marginTop="@dimen/module_services_dispatch_airport_dialog_endloc_margin_top"
|
||||
android:text="@string/dispatch_dialog_flight_info"
|
||||
android:textSize="@dimen/module_services_dispatch_airport_dialog_next_level_title_size" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_services_dispatch_dialog_flight_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/module_services_dispatch_airport_dialog_last_column_margin_left"
|
||||
android:layout_marginTop="@dimen/module_services_dispatch_airport_dialog_endloc_content_margin_top"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_services_dispatch_airport_dialog_title_size"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/module_services_dispatch_dialog_confirm"
|
||||
android:layout_width="@dimen/module_services_dispatch_airport_dialog_affirm_width"
|
||||
android:layout_height="@dimen/module_services_dispatch_airport_dialog_affirm_height"
|
||||
android:layout_below="@+id/module_services_dispatch_dialog_task_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/module_services_dispatch_airport_dialog_margin_top"
|
||||
android:layout_marginBottom="@dimen/module_services_dispatch_airport_dialog_margin_bottom"
|
||||
android:background="@drawable/bg_adas_dispatch_affirm"
|
||||
android:gravity="center"
|
||||
android:text="@string/dispatch_dialog_affirm"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_services_dispatch_airport_dialog_title_size"
|
||||
android:textStyle="bold" />
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="@dimen/module_services_dispatch_cars_dialog_width"
|
||||
android:layout_height="@dimen/module_services_dispatch_cars_dialog_height"
|
||||
android:background="@drawable/bg_dispatch_cars">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_adas_dispatch_remind_timer"
|
||||
android:layout_width="@dimen/module_services_dispatch_cars_dialog_timer_size"
|
||||
android:layout_height="@dimen/module_services_dispatch_cars_dialog_timer_size"
|
||||
android:layout_margin="@dimen/module_services_dispatch_cars_dialog_timer_margin"
|
||||
android:background="@drawable/bg_dispatch_timer"
|
||||
android:gravity="center"
|
||||
android:text="10"
|
||||
android:textColor="@color/color_8E9DD4"
|
||||
android:textSize="@dimen/module_services_dispatch_cars_dialog_timer_txt_size"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/module_services_dispatch_cars_dialog_title_margin_top"
|
||||
android:text="@string/dispatch_cars_remind_title"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_services_dispatch_cars_dialog_title_size"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/module_services_dispatch_cars_dialog_content_margin_top"
|
||||
android:text="@string/dispatch_cars_remind_content"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_services_dispatch_cars_dialog_content_size"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_adas_dispatch_remind_loc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/module_services_dispatch_cars_dialog_loc_margin_top"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/color_1F9BFE"
|
||||
android:textSize="@dimen/module_services_dispatch_cars_dialog_loc_size"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/color_66B8BFE8"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/module_adas_dispatch_remind_affirm"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/module_adas_dispatch_remind_affirm"
|
||||
android:layout_width="@dimen/module_services_dispatch_cars_dialog_btn_width"
|
||||
android:layout_height="@dimen/module_services_dispatch_cars_dialog_line_margin_bottom"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/bg_dispatch_left_corner"
|
||||
android:text="@string/dispatch_cars_affirm"
|
||||
android:textColor="@color/color_1F9BFE"
|
||||
android:textSize="@dimen/module_services_dispatch_cars_dialog_title_size"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<View
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="@dimen/module_services_dispatch_cars_dialog_line_margin_bottom"
|
||||
android:layout_marginStart="@dimen/module_services_dispatch_cars_dialog_btn_width"
|
||||
android:background="@color/color_66B8BFE8"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/module_adas_dispatch_remind_cancel"
|
||||
android:layout_width="@dimen/module_services_dispatch_cars_dialog_btn_width"
|
||||
android:layout_height="@dimen/module_services_dispatch_cars_dialog_line_margin_bottom"
|
||||
android:gravity="center"
|
||||
android:text="@string/dispatch_cars_cancel"
|
||||
android:textColor="@color/color_AFB3C7"
|
||||
android:background="@drawable/bg_dispatch_right_corner"
|
||||
android:textSize="@dimen/module_services_dispatch_cars_dialog_title_size"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,26 +0,0 @@
|
||||
<?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="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvUpgradeApkName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/color_FF2966EC"
|
||||
android:padding="10dp"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#F0F0F0"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginBottom="3dp"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@@ -36,7 +36,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginStart="61dp"
|
||||
android:layout_marginBottom="49dp"
|
||||
android:textColor="@color/v2x_white"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="42dp"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
@@ -47,29 +47,6 @@
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_check_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/v_second_group">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/check"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone">
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.CheckStatusView
|
||||
android:id="@+id/viewCheckStatus"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_centerHorizontal="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheck"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="42dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:text="@string/check_vehicle_detection"
|
||||
android:textColor="@color/color_FFA7B6F0"
|
||||
android:textSize="32dp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/debug"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -5,21 +5,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<!--车辆检测入口-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/moduleHmiCheck"-->
|
||||
<!-- android:layout_width="@dimen/module_hmi_check_size"-->
|
||||
<!-- android:layout_height="@dimen/module_hmi_check_size"-->
|
||||
<!-- android:background="@drawable/module_ext_check"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="检测"-->
|
||||
<!-- android:textColor="#fff"-->
|
||||
<!-- android:textSize="@dimen/module_switch_text_size"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintRight_toRightOf="parent"-->
|
||||
<!-- android:visibility="gone"-->
|
||||
<!-- />-->
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivCheckIcon"
|
||||
android:layout_width="150dp"
|
||||
|
||||
@@ -2273,99 +2273,6 @@
|
||||
android:textSize="@dimen/dp_24" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/btnApkCenter"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:drawableEnd="@drawable/icon_right"
|
||||
android:padding="@dimen/dp_20"
|
||||
android:textOff="应用包管理中心"
|
||||
android:textOn="应用包管理中心"
|
||||
android:textSize="@dimen/dp_24"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/apkCenterLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivApkSearch"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/icon_search"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/etApkSearch"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="@dimen/dp_30"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:background="@drawable/debug_setting_edit_bg"
|
||||
android:gravity="center"
|
||||
android:hint="请输入搜索关键字如版本号等"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivApkSearch"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/ivApkSearch"
|
||||
app:layout_constraintTop_toTopOf="@id/ivApkSearch" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbApkOnline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:padding="@dimen/dp_10"
|
||||
android:text="Online"
|
||||
android:textColor="#000"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/cbApkQa"
|
||||
app:layout_constraintTop_toBottomOf="@id/ivApkSearch" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbApkQa"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:padding="@dimen/dp_10"
|
||||
android:text="QA"
|
||||
android:textColor="#000"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintLeft_toRightOf="@id/cbApkOnline"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/ivApkSearch" />
|
||||
|
||||
<View
|
||||
android:id="@+id/apkSearchDivider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:background="#F0F0F0"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbApkQa" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvUpgradeVersionList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:nestedScrollingEnabled="false"
|
||||
app:layout_constraintTop_toBottomOf="@id/apkSearchDivider" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="@dimen/module_switch_margin_left"
|
||||
android:text="@string/module_map_model_normal"
|
||||
android:textColor="@color/module_ext_color_voice_text"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="@dimen/module_switch_text_size" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
Binary file not shown.
@@ -39,10 +39,7 @@
|
||||
<color name="foreground_info">#FF333333</color>
|
||||
<color name="foreground_warn">#FFCCCCCC</color>
|
||||
|
||||
<color name="color_FF2966EC">#FF2966EC</color>
|
||||
<color name="color_FFA7B6F0">#FFA7B6F0</color>
|
||||
<color name="color_B3FFFFFF">#B3FFFFFF</color>
|
||||
<color name="color_99000000">#99000000</color>
|
||||
|
||||
|
||||
|
||||
<color name="version_latest_start_color">#6D7BAF</color>
|
||||
@@ -74,4 +71,7 @@
|
||||
|
||||
<color name="hmi_check_keyboard_input_field">#FF282F62</color>
|
||||
<color name="bus_autopilot_text_color_normal">#FFFFFF</color>
|
||||
|
||||
|
||||
|
||||
</resources>
|
||||
@@ -76,4 +76,40 @@
|
||||
<dimen name="hmi_take_over_request_width">810dp</dimen>
|
||||
<dimen name="hmi_take_over_request_height">560dp</dimen>
|
||||
<dimen name="hmi_take_over_request_m_top">524dp</dimen>
|
||||
|
||||
<dimen name="module_services_dispatch_airport_dialog_width">1263dp</dimen>
|
||||
<dimen name="module_services_dispatch_airport_dialog_height">1173dp</dimen>
|
||||
<dimen name="module_services_dispatch_airport_dialog_corner">32dp</dimen>
|
||||
<dimen name="module_services_dispatch_airport_dialog_next_level_title_size">38dp</dimen>
|
||||
<dimen name="module_services_dispatch_airport_dialog_title_size">48dp</dimen>
|
||||
<dimen name="module_services_dispatch_airport_dialog_task_content_size">42dp</dimen>
|
||||
<dimen name="module_services_dispatch_airport_dialog_title_margin_top">55dp</dimen>
|
||||
<dimen name="module_services_dispatch_airport_dialog_startloc_margin_top">219dp</dimen>
|
||||
<dimen name="module_services_dispatch_airport_dialog_startloc_content_margin_top">288dp</dimen>
|
||||
<dimen name="module_services_dispatch_airport_dialog_endloc_margin_top">415dp</dimen>
|
||||
<dimen name="module_services_dispatch_airport_dialog_endloc_content_margin_top">484dp</dimen>
|
||||
<dimen name="module_services_dispatch_airport_dialog_task_margin_top">621dp</dimen>
|
||||
<dimen name="module_services_dispatch_airport_dialog_task_content_margin_top">690dp</dimen>
|
||||
<dimen name="module_services_dispatch_airport_dialog_first_column_margin_left">100dp</dimen>
|
||||
<dimen name="module_services_dispatch_airport_dialog_last_column_margin_left">852dp</dimen>
|
||||
<dimen name="module_services_dispatch_airport_dialog_margin_top">86dp</dimen>
|
||||
<dimen name="module_services_dispatch_airport_dialog_margin_bottom">80dp</dimen>
|
||||
<dimen name="module_services_dispatch_airport_dialog_affirm_width">700dp</dimen>
|
||||
<dimen name="module_services_dispatch_airport_dialog_affirm_height">140dp</dimen>
|
||||
<dimen name="module_services_dispatch_airport_dialog_affirm_corner">70dp</dimen>
|
||||
|
||||
<dimen name="module_services_dispatch_cars_dialog_width">950dp</dimen>
|
||||
<dimen name="module_services_dispatch_cars_dialog_height">540dp</dimen>
|
||||
<dimen name="module_services_dispatch_cars_dialog_corner">32dp</dimen>
|
||||
<dimen name="module_services_dispatch_cars_dialog_title_size">48dp</dimen>
|
||||
<dimen name="module_services_dispatch_cars_dialog_title_margin_top">55dp</dimen>
|
||||
<dimen name="module_services_dispatch_cars_dialog_content_size">38dp</dimen>
|
||||
<dimen name="module_services_dispatch_cars_dialog_content_margin_top">179dp</dimen>
|
||||
<dimen name="module_services_dispatch_cars_dialog_loc_size">54dp</dimen>
|
||||
<dimen name="module_services_dispatch_cars_dialog_loc_margin_top">251dp</dimen>
|
||||
<dimen name="module_services_dispatch_cars_dialog_line_margin_bottom">152dp</dimen>
|
||||
<dimen name="module_services_dispatch_cars_dialog_btn_width">474.5dp</dimen>
|
||||
<dimen name="module_services_dispatch_cars_dialog_timer_margin">20dp</dimen>
|
||||
<dimen name="module_services_dispatch_cars_dialog_timer_size">46dp</dimen>
|
||||
<dimen name="module_services_dispatch_cars_dialog_timer_txt_size">24dp</dimen>
|
||||
</resources>
|
||||
@@ -53,4 +53,16 @@
|
||||
<string name="to_binding_car">是否绑定车机?</string>
|
||||
|
||||
<string name="status_bar_tag">蘑菇星云</string>
|
||||
|
||||
<string name="dispatch_dialog_title">您有新的工作任务</string>
|
||||
<string name="dispatch_dialog_start_loc">开始地点:</string>
|
||||
<string name="dispatch_dialog_end_loc">结束地点:</string>
|
||||
<string name="dispatch_dialog_task_time">任务时间:</string>
|
||||
<string name="dispatch_dialog_task_info">任务内容:</string>
|
||||
<string name="dispatch_dialog_flight_info">航班信息:</string>
|
||||
<string name="dispatch_dialog_affirm">接受任务</string>
|
||||
<string name="dispatch_cars_remind_title">调度确认</string>
|
||||
<string name="dispatch_cars_remind_content">车辆将开启自动驾驶,并行驶至:</string>
|
||||
<string name="dispatch_cars_affirm">确认</string>
|
||||
<string name="dispatch_cars_cancel">取消</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user