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/model/SweeperOrderModel.java # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperLimitingVelocityView.java # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java # OCH/mogo-och-sweeper/src/main/res/drawable/sweeper_list_left_top_line.xml # app/src/main/java/com/mogo/launcher/stageone/ConfigStartUp.kt # 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-hmi/src/main/res/layout/fragment_hmi.xml
This commit is contained in:
@@ -28,11 +28,9 @@ import com.mogo.eagle.core.data.map.MogoLocation;
|
|||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
|
||||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
|
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
|
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
|
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
|
|
||||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||||
@@ -286,7 +284,7 @@ public class BusPassengerModel {
|
|||||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||||
|
|
||||||
// 注销定位监听
|
// 注销定位监听
|
||||||
CallerMapLocationListenerManager.INSTANCE.removeListener(TAG,false);
|
CallerChassisLocationGCJ20ListenerManager.INSTANCE.removeListener(TAG);
|
||||||
|
|
||||||
MogoAiCloudSocketManager.getInstance(mContext)
|
MogoAiCloudSocketManager.getInstance(mContext)
|
||||||
.unregisterLifecycleListener(10010);
|
.unregisterLifecycleListener(10010);
|
||||||
|
|||||||
@@ -26,6 +26,16 @@
|
|||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"/>
|
app:layout_constraintTop_toTopOf="parent"/>
|
||||||
|
|
||||||
|
<!--Vip车辆标志-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
||||||
|
android:layout_width="@dimen/module_vip_width"
|
||||||
|
android:layout_height="@dimen/module_vip_height"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:marginStart="@dimen/dp_640"
|
||||||
|
app:marginTop="@dimen/dp_80"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"/>
|
||||||
|
|
||||||
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout
|
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout
|
||||||
android:id="@+id/arrive_station_shadow"
|
android:id="@+id/arrive_station_shadow"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import androidx.constraintlayout.widget.Group;
|
|||||||
import com.mogo.commons.mvp.IView;
|
import com.mogo.commons.mvp.IView;
|
||||||
import com.mogo.commons.mvp.MvpFragment;
|
import com.mogo.commons.mvp.MvpFragment;
|
||||||
import com.mogo.commons.mvp.Presenter;
|
import com.mogo.commons.mvp.Presenter;
|
||||||
import com.mogo.eagle.core.data.config.HmiBuildConfig;
|
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||||
@@ -188,9 +187,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
|||||||
|
|
||||||
if (mBadcaseBtn != null) {
|
if (mBadcaseBtn != null) {
|
||||||
CallerDevaToolsManager.INSTANCE.initBadCase(mBadcaseBtn);
|
CallerDevaToolsManager.INSTANCE.initBadCase(mBadcaseBtn);
|
||||||
if (!HmiBuildConfig.isShowBadCaseView) {
|
CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this);
|
||||||
CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mAICollectBtn = findViewById(R.id.module_mogo_och_ai_collet_rl);
|
mAICollectBtn = findViewById(R.id.module_mogo_och_ai_collet_rl);
|
||||||
@@ -229,9 +226,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
|||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
if (!HmiBuildConfig.isShowBadCaseView) {
|
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
|
||||||
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
|
|
||||||
}
|
|
||||||
EventBus.getDefault().unregister(this);
|
EventBus.getDefault().unregister(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,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.CallerAutoPilotStatusListenerManager;
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
|
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
|
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
|
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||||
@@ -331,7 +330,7 @@ public class BusOrderModel {
|
|||||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||||
|
|
||||||
// 注销定位监听
|
// 注销定位监听
|
||||||
CallerMapLocationListenerManager.INSTANCE.removeListener(TAG,false);
|
CallerChassisLocationGCJ20ListenerManager.INSTANCE.removeListener(TAG);
|
||||||
|
|
||||||
//自动驾驶路线规划接口
|
//自动驾驶路线规划接口
|
||||||
CallerPlanningRottingListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
|
CallerPlanningRottingListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
|
||||||
|
|||||||
@@ -21,6 +21,38 @@
|
|||||||
android:layout_height="match_parent"/>
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
<!--Vip车辆标志-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
||||||
|
android:layout_width="@dimen/module_vip_width"
|
||||||
|
android:layout_height="@dimen/module_vip_height"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:marginStart="@dimen/dp_640"
|
||||||
|
app:marginTop="@dimen/dp_80" />
|
||||||
|
|
||||||
|
<!--超视距-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.widget.CameraView
|
||||||
|
android:id="@+id/ivCameraIcon"
|
||||||
|
android:layout_width="120dp"
|
||||||
|
android:layout_height="120dp"
|
||||||
|
android:layout_marginTop="45dp"
|
||||||
|
android:layout_marginEnd="40dp"
|
||||||
|
app:layout_constraintRight_toLeftOf="@id/viewTrafficLightVr"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<!--红绿灯-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
|
||||||
|
android:id="@+id/viewTrafficLightVr"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/hmi_traffic_light_layout_margin_top"
|
||||||
|
android:layout_marginEnd="@dimen/hmi_traffic_light_layout_margin_right"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/module_mogo_och_autopilot_status"
|
android:id="@+id/module_mogo_och_autopilot_status"
|
||||||
android:layout_width="@dimen/module_mogo_och_autopilot_status_bg_width"
|
android:layout_width="@dimen/module_mogo_och_autopilot_status_bg_width"
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import android.content.Context
|
|||||||
import com.mogo.eagle.core.data.BaseData
|
import com.mogo.eagle.core.data.BaseData
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
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.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
|
||||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils
|
import com.mogo.eagle.core.utilcode.util.NetworkUtils
|
||||||
import com.mogo.eagle.core.utilcode.util.SharedPrefs
|
import com.mogo.eagle.core.utilcode.util.SharedPrefs
|
||||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||||
@@ -66,7 +65,7 @@ object OchCommonLoginModel : IMoGoChassisLocationGCJ02Listener {
|
|||||||
mContext = null
|
mContext = null
|
||||||
iTaxiLoginCallback = null
|
iTaxiLoginCallback = null
|
||||||
// 注销到达起始站围栏监听
|
// 注销到达起始站围栏监听
|
||||||
CallerMapLocationListenerManager.removeListener(TAG, false)
|
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -37,18 +37,25 @@ android {
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: "libs", include: ["*.jar"])
|
implementation fileTree(dir: "libs", include: ["*.jar"])
|
||||||
implementation rootProject.ext.dependencies.androidxappcompat
|
implementation rootProject.ext.dependencies.androidxappcompat
|
||||||
|
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||||
|
implementation rootProject.ext.dependencies.rxjava
|
||||||
|
implementation rootProject.ext.dependencies.rxandroid
|
||||||
|
|
||||||
implementation rootProject.ext.dependencies.arouter
|
implementation rootProject.ext.dependencies.arouter
|
||||||
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||||
|
|
||||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||||
implementation rootProject.ext.dependencies.mogoutils
|
implementation rootProject.ext.dependencies.mogoutils
|
||||||
implementation rootProject.ext.dependencies.mogocommons
|
implementation rootProject.ext.dependencies.mogocommons
|
||||||
implementation rootProject.ext.dependencies.mogo_core_data
|
implementation rootProject.ext.dependencies.mogo_core_data
|
||||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||||
|
implementation rootProject.ext.dependencies.mogo_core_function_hmi
|
||||||
}else {
|
}else {
|
||||||
implementation project(":core:mogo-core-utils")
|
implementation project(":core:mogo-core-utils")
|
||||||
implementation project(":foudations:mogo-commons")
|
implementation project(":foudations:mogo-commons")
|
||||||
implementation project(':core:mogo-core-data')
|
implementation project(':core:mogo-core-data')
|
||||||
implementation project(':core:mogo-core-function-call')
|
implementation project(':core:mogo-core-function-call')
|
||||||
|
implementation project(':core:function-impl:mogo-core-function-hmi')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.mogo.och.bus">
|
package="com.mogo.och.noop">
|
||||||
|
|
||||||
/
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
package com.mogo.och.bus;
|
|
||||||
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
import androidx.fragment.app.Fragment;
|
|
||||||
import androidx.fragment.app.FragmentActivity;
|
|
||||||
|
|
||||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
|
||||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
|
||||||
import com.mogo.commons.module.status.StatusDescriptor;
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author congtaowang
|
|
||||||
* @since 2021/1/15
|
|
||||||
* <p>
|
|
||||||
* 描述
|
|
||||||
*/
|
|
||||||
@Route(path = OCHConstants.PATH)
|
|
||||||
public class MogoOCHNoop implements IMogoOCH , IMogoStatusChangedListener {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void createCoverage(FragmentActivity activity, int containerId) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public Fragment createCoverage(@Nullable FragmentActivity activity, @Nullable Integer containerId) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
public String getFunctionName() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroy() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void init(Context context) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mogo.och.bus;
|
package com.mogo.och.noop;
|
||||||
|
|
||||||
import androidx.annotation.IdRes;
|
import androidx.annotation.IdRes;
|
||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
@@ -20,5 +20,7 @@ interface IMogoOCH extends IMoGoFunctionProvider {
|
|||||||
* @param activity
|
* @param activity
|
||||||
* @param containerId 容器ID
|
* @param containerId 容器ID
|
||||||
*/
|
*/
|
||||||
void createCoverage(FragmentActivity activity, @IdRes int containerId);
|
default void createCoverage(FragmentActivity activity, @IdRes int containerId){
|
||||||
|
|
||||||
|
};
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package com.mogo.och.noop
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
|
import androidx.fragment.app.FragmentActivity
|
||||||
|
import com.alibaba.android.arouter.facade.annotation.Route
|
||||||
|
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.utilcode.mogo.logger.CallerLogger.d
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author congtaowang
|
||||||
|
* @since 2021/1/15
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
@Route(path = OCHConstants.PATH)
|
||||||
|
class MoGoOCHNoopProvider : IMogoOCH {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private const val TAG = "MogoOCHNoopProvider"
|
||||||
|
}
|
||||||
|
|
||||||
|
override val functionName: String
|
||||||
|
get() = TAG
|
||||||
|
|
||||||
|
private var fragment: OchNoopFragment? = null
|
||||||
|
private var containerId = 0
|
||||||
|
private var activity: FragmentActivity? = null
|
||||||
|
|
||||||
|
override fun init(context: Context) {
|
||||||
|
MogoStatusManager.getInstance().registerStatusChangedListener(
|
||||||
|
TAG, StatusDescriptor.VR_MODE, statusChangedListener
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
private val statusChangedListener =
|
||||||
|
IMogoStatusChangedListener { descriptor: StatusDescriptor, isTrue: Boolean ->
|
||||||
|
if (descriptor == StatusDescriptor.VR_MODE) {
|
||||||
|
// 进入vr模式默认显示网约车小巴fragment
|
||||||
|
if (isTrue) {
|
||||||
|
showFragment()
|
||||||
|
} else {
|
||||||
|
hideFragment()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun showFragment() {
|
||||||
|
activity?.let {
|
||||||
|
if (fragment == null) {
|
||||||
|
d(TAG, "准备add fragment======")
|
||||||
|
val fragmentByTag = it.supportFragmentManager.findFragmentByTag(TAG)
|
||||||
|
fragment = if (fragmentByTag is OchNoopFragment) {
|
||||||
|
fragmentByTag
|
||||||
|
} else {
|
||||||
|
OchNoopFragment()
|
||||||
|
}
|
||||||
|
if (!fragment!!.isAdded) {
|
||||||
|
it.supportFragmentManager.beginTransaction()
|
||||||
|
.add(containerId, fragment!!, TAG).commitAllowingStateLoss()
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
d(TAG, "准备show fragment")
|
||||||
|
fragment?.let { noopFragment ->
|
||||||
|
it.supportFragmentManager.beginTransaction().show(noopFragment)
|
||||||
|
.commitAllowingStateLoss()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun hideFragment() {
|
||||||
|
if (fragment != null) {
|
||||||
|
d(TAG, "准备hide fragment")
|
||||||
|
activity?.supportFragmentManager?.beginTransaction()?.hide(fragment!!)
|
||||||
|
?.commitAllowingStateLoss()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun createCoverage(activity: FragmentActivity?, containerId: Int?): Fragment? {
|
||||||
|
this.containerId = containerId!!
|
||||||
|
this.activity = activity
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mogo.och.bus;
|
package com.mogo.och.noop;
|
||||||
|
|
||||||
public
|
public
|
||||||
/**
|
/**
|
||||||
@@ -12,5 +12,5 @@ class OCHConstants {
|
|||||||
/**
|
/**
|
||||||
* arouter 路由地址
|
* arouter 路由地址
|
||||||
*/
|
*/
|
||||||
public static final String PATH = "/driver/api";
|
public static final String PATH = "/och/noop/api";
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.mogo.och.noop
|
||||||
|
|
||||||
|
import com.mogo.commons.mvp.IView
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@author xiaoyuzhou
|
||||||
|
*@date 2021/8/4 3:38 下午
|
||||||
|
*/
|
||||||
|
interface OchNoopContract {
|
||||||
|
|
||||||
|
interface View : IView {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
package com.mogo.och.noop
|
||||||
|
|
||||||
|
import android.view.View
|
||||||
|
import com.mogo.commons.mvp.MvpFragment
|
||||||
|
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||||
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||||
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||||
|
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
|
||||||
|
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
|
||||||
|
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
|
||||||
|
import com.mogo.och.bus.R
|
||||||
|
import kotlinx.android.synthetic.main.fragment_hmi.*
|
||||||
|
|
||||||
|
class OchNoopFragment : MvpFragment<OchNoopContract.View?, OchNoopPresenter?>(),
|
||||||
|
OchNoopContract.View {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private const val TAG = "OchNoopFragment"
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getLayoutId(): Int {
|
||||||
|
return R.layout.och_noop_fragment_hmi
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getTagName(): String {
|
||||||
|
return TAG
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun createPresenter(): OchNoopPresenter {
|
||||||
|
return OchNoopPresenter(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun initViews() {
|
||||||
|
|
||||||
|
//设置StatusBar初始状态
|
||||||
|
CallerHmiViewControlListenerManager.updateStatusBarRightView(
|
||||||
|
StatusBarView.TAG,
|
||||||
|
FunctionBuildConfig.isDemoMode,
|
||||||
|
"demoMode",
|
||||||
|
DemoModeView(requireContext())
|
||||||
|
)
|
||||||
|
|
||||||
|
viewShowDebugView.setOnLongClickListener {
|
||||||
|
ToggleDebugView.toggleDebugView.toggle(requireContext())
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
cbMsgBoxDriver.setOnCheckedChangeListener { _, isChecked ->
|
||||||
|
if (isChecked) {
|
||||||
|
viewDriverMsgBoxList.visibility = View.VISIBLE
|
||||||
|
viewDriverMsgBoxList.notifyData()
|
||||||
|
viewDriverMsgBoxBubble.visibility = View.GONE
|
||||||
|
viewDriverMsgBoxBubble.isShowData(false)
|
||||||
|
CallerHmiManager.updateDriverMsgBoxTipView(false)
|
||||||
|
} else {
|
||||||
|
viewDriverMsgBoxList.visibility = View.GONE
|
||||||
|
viewDriverMsgBoxBubble.visibility = View.VISIBLE
|
||||||
|
viewDriverMsgBoxBubble.isShowData(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cbMsgBoxPassenger.setOnCheckedChangeListener { _, isChecked ->
|
||||||
|
if (isChecked) {
|
||||||
|
viewPassengerMsgBoxList.visibility = View.VISIBLE
|
||||||
|
viewPassengerMsgBoxBubble.visibility = View.GONE
|
||||||
|
viewPassengerMsgBoxBubble.isShowData(false)
|
||||||
|
CallerHmiManager.updatePassengerMsgBoxTipView(false)
|
||||||
|
} else {
|
||||||
|
viewPassengerMsgBoxList.visibility = View.GONE
|
||||||
|
viewPassengerMsgBoxBubble.visibility = View.VISIBLE
|
||||||
|
viewPassengerMsgBoxBubble.isShowData(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package com.mogo.och.noop
|
||||||
|
|
||||||
|
import com.mogo.commons.mvp.Presenter
|
||||||
|
|
||||||
|
class OchNoopPresenter(view: OchNoopContract.View?) :
|
||||||
|
Presenter<OchNoopContract.View?>(view) {
|
||||||
|
|
||||||
|
}
|
||||||
318
OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml
Normal file
318
OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml
Normal file
@@ -0,0 +1,318 @@
|
|||||||
|
<?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"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/clHmiContainer"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/viewShowDebugView"
|
||||||
|
android:layout_width="@dimen/dp_400"
|
||||||
|
android:layout_height="@dimen/dp_100"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<!--V2X预警红色边框-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
|
||||||
|
android:id="@+id/flV2XWarningView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingTop="72dp">
|
||||||
|
<!--脉速表-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.widget.SpeedPanelView
|
||||||
|
android:id="@+id/viewSpeedChart"
|
||||||
|
android:layout_width="@dimen/module_ext_speed_width"
|
||||||
|
android:layout_height="@dimen/module_ext_speed_height"
|
||||||
|
android:layout_marginLeft="@dimen/module_mogo_autopilot_status_margin_left"
|
||||||
|
android:layout_marginTop="@dimen/module_ext_arcView_top"
|
||||||
|
android:elevation="@dimen/dp_10"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<!--Vip车辆标志-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
||||||
|
android:layout_width="@dimen/module_vip_width"
|
||||||
|
android:layout_height="@dimen/module_vip_height"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<!--接管提示-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.takeover.TakeOverView
|
||||||
|
android:id="@+id/clTakeOverView"
|
||||||
|
android:layout_width="@dimen/hmi_take_over_request_width"
|
||||||
|
android:layout_height="@dimen/hmi_take_over_request_height"
|
||||||
|
android:layout_marginTop="@dimen/hmi_take_over_request_m_top"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<!--自动驾驶按钮及状态-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.widget.AutoPilotStatusView
|
||||||
|
android:id="@+id/viewAutopilotStatus"
|
||||||
|
android:layout_width="@dimen/module_mogo_autopilot_status_bg_width"
|
||||||
|
android:layout_height="@dimen/module_mogo_autopilot_status_bg_height"
|
||||||
|
android:layout_marginTop="@dimen/module_mogo_autopilot_status_margin_top"
|
||||||
|
android:elevation="@dimen/dp_10"
|
||||||
|
app:layout_constraintLeft_toLeftOf="@+id/viewSpeedChart"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/viewSpeedChart"
|
||||||
|
app:layout_goneMarginStart="@dimen/module_mogo_autopilot_status_margin_left" />
|
||||||
|
|
||||||
|
<!--超视距-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.widget.CameraView
|
||||||
|
android:id="@+id/ivCameraIcon"
|
||||||
|
android:layout_width="120dp"
|
||||||
|
android:layout_height="120dp"
|
||||||
|
android:layout_marginTop="45dp"
|
||||||
|
android:layout_marginEnd="40dp"
|
||||||
|
app:layout_constraintRight_toLeftOf="@id/viewTrafficLightVr"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<!--红绿灯-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
|
||||||
|
android:id="@+id/viewTrafficLightVr"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/hmi_traffic_light_layout_margin_top"
|
||||||
|
android:layout_marginEnd="@dimen/hmi_traffic_light_layout_margin_right"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<!--地图视角切换-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.widget.PerspectiveSwitchView
|
||||||
|
android:id="@+id/viewPerspectiveSwitch"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="50dp"
|
||||||
|
android:layout_marginBottom="40dp"
|
||||||
|
android:elevation="@dimen/dp_10"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<!--隐藏态下的 美化模式按钮-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.switch.DemoModeHiddenSwitch
|
||||||
|
android:id="@+id/viewDemoModeSwitch"
|
||||||
|
android:layout_width="120dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:layout_marginStart="40dp"
|
||||||
|
android:layout_marginBottom="200dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<!--工具箱-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.tools.ToolsImageView
|
||||||
|
android:id="@+id/ivToolsView"
|
||||||
|
android:layout_width="@dimen/module_hmi_check_size"
|
||||||
|
android:layout_height="@dimen/module_hmi_check_size"
|
||||||
|
android:layout_marginStart="25dp"
|
||||||
|
android:layout_marginBottom="40dp"
|
||||||
|
android:elevation="@dimen/dp_10"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/viewPerspectiveSwitch"
|
||||||
|
app:layout_goneMarginStart="50dp" />
|
||||||
|
|
||||||
|
<!--问题反馈-->
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ivBadCaseTools"
|
||||||
|
android:layout_width="120dp"
|
||||||
|
android:layout_height="120dp"
|
||||||
|
android:layout_marginStart="50dp"
|
||||||
|
android:layout_marginBottom="40dp"
|
||||||
|
android:src="@drawable/bad_case_selector"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/ivToolsView" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ivAiCollectTools"
|
||||||
|
android:layout_width="120dp"
|
||||||
|
android:layout_height="120dp"
|
||||||
|
android:layout_marginStart="50dp"
|
||||||
|
android:layout_marginBottom="40dp"
|
||||||
|
android:src="@drawable/ai_collect_selector"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/ivBadCaseTools" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/viewUpgradeTips"
|
||||||
|
android:layout_width="22dp"
|
||||||
|
android:layout_height="22dp"
|
||||||
|
android:background="@drawable/version_upgrade_tips_background"
|
||||||
|
android:translationZ="30dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintCircle="@id/ivToolsView"
|
||||||
|
app:layout_constraintCircleAngle="45"
|
||||||
|
app:layout_constraintCircleRadius="60dp"
|
||||||
|
tools:ignore="MissingConstraints" />
|
||||||
|
|
||||||
|
<!--限速牌子-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
|
||||||
|
android:id="@+id/viewLimitingVelocity"
|
||||||
|
android:layout_width="120dp"
|
||||||
|
android:layout_height="120dp"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
android:layout_marginEnd="40dp"
|
||||||
|
android:background="@drawable/bg_waring_limiting_velocity"
|
||||||
|
android:elevation="@dimen/dp_10"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="60"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="60dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
|
||||||
|
app:layout_goneMarginEnd="40dp"
|
||||||
|
app:layout_goneMarginTop="40dp"
|
||||||
|
tools:visibility="gone" />
|
||||||
|
|
||||||
|
<!--消息盒子司机端选择入口-->
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/cbMsgBoxDriver"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="150dp"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:layout_marginEnd="25dp"
|
||||||
|
android:background="@drawable/selector_msg_box"
|
||||||
|
android:button="@null"
|
||||||
|
android:visibility="visible"
|
||||||
|
app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon" />
|
||||||
|
|
||||||
|
<!--司机端消息提示-->
|
||||||
|
<View
|
||||||
|
android:id="@+id/MsgBoxTipView"
|
||||||
|
android:layout_width="8dp"
|
||||||
|
android:layout_height="8dp"
|
||||||
|
android:background="@drawable/version_upgrade_tips_background"
|
||||||
|
android:translationZ="30dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintCircle="@id/cbMsgBoxDriver"
|
||||||
|
app:layout_constraintCircleAngle="40"
|
||||||
|
app:layout_constraintCircleRadius="32dp"
|
||||||
|
tools:ignore="MissingConstraints" />
|
||||||
|
|
||||||
|
<!--消息盒子乘客端选择入口-->
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/cbMsgBoxPassenger"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:layout_marginStart="320dp"
|
||||||
|
android:layout_marginBottom="50dp"
|
||||||
|
android:background="@drawable/selector_msg_box_p"
|
||||||
|
android:button="@null"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent" />
|
||||||
|
|
||||||
|
<!--乘客端消息提示-->
|
||||||
|
<View
|
||||||
|
android:id="@+id/MsgBoxPTipView"
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="15dp"
|
||||||
|
android:background="@drawable/version_upgrade_tips_background"
|
||||||
|
android:translationZ="30dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintCircle="@id/cbMsgBoxPassenger"
|
||||||
|
app:layout_constraintCircleAngle="40"
|
||||||
|
app:layout_constraintCircleRadius="50dp"
|
||||||
|
tools:ignore="MissingConstraints" />
|
||||||
|
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView
|
||||||
|
android:id="@+id/viewDriverMsgBoxList"
|
||||||
|
android:layout_width="864px"
|
||||||
|
android:layout_height="746px"
|
||||||
|
android:layout_marginEnd="40dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver" />
|
||||||
|
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView
|
||||||
|
android:id="@+id/viewDriverMsgBoxBubble"
|
||||||
|
android:layout_width="864px"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="40dp"
|
||||||
|
android:visibility="visible"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver" />
|
||||||
|
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxBubbleView
|
||||||
|
android:id="@+id/viewPassengerMsgBoxBubble"
|
||||||
|
android:layout_width="650px"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/cbMsgBoxPassenger"
|
||||||
|
app:layout_constraintLeft_toLeftOf="@id/cbMsgBoxPassenger"
|
||||||
|
app:layout_constraintRight_toRightOf="@id/cbMsgBoxPassenger" />
|
||||||
|
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxListView
|
||||||
|
android:id="@+id/viewPassengerMsgBoxList"
|
||||||
|
android:layout_width="650px"
|
||||||
|
android:layout_height="750px"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/cbMsgBoxPassenger"
|
||||||
|
app:layout_constraintLeft_toLeftOf="@id/cbMsgBoxPassenger"
|
||||||
|
app:layout_constraintRight_toRightOf="@id/cbMsgBoxPassenger" />
|
||||||
|
|
||||||
|
<!--左右转向灯-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.turnlight.TurnLightViewStatus
|
||||||
|
android:id="@+id/turnLightView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="42dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<!--刹车ui-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.turnlight.BrakeViewStatus
|
||||||
|
android:id="@+id/brakeView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="42dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<!--pnc行为决策-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="@dimen/dp_110"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<!--APP、MAP版本-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.widget.VersionNameView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="45dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/statusBarContainer"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="30dp"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/viewLimitingVelocity"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/viewLimitingVelocity"
|
||||||
|
app:layout_goneMarginEnd="40dp"
|
||||||
|
app:layout_goneMarginTop="30dp" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -10,12 +10,15 @@ import com.mogo.commons.mvp.IView;
|
|||||||
import com.mogo.commons.mvp.MvpFragment;
|
import com.mogo.commons.mvp.MvpFragment;
|
||||||
import com.mogo.commons.mvp.Presenter;
|
import com.mogo.commons.mvp.Presenter;
|
||||||
import com.mogo.eagle.core.data.config.HmiBuildConfig;
|
import com.mogo.eagle.core.data.config.HmiBuildConfig;
|
||||||
|
import com.mogo.eagle.core.data.constants.DataTypes;
|
||||||
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
|
||||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
||||||
import com.mogo.map.listener.IMogoMapListener;
|
import com.mogo.map.listener.IMogoMapListener;
|
||||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||||
@@ -28,6 +31,12 @@ import com.mogo.och.sweeper.ui.popwindow.MenuPopWindow;
|
|||||||
import com.mogo.och.sweeper.view.SweeperCurrentTaskInfoView;
|
import com.mogo.och.sweeper.view.SweeperCurrentTaskInfoView;
|
||||||
import com.mogo.och.sweeper.view.SweeperTrafficDataView;
|
import com.mogo.och.sweeper.view.SweeperTrafficDataView;
|
||||||
import com.mogo.och.sweeper.view.SweeperWorkModeView;
|
import com.mogo.och.sweeper.view.SweeperWorkModeView;
|
||||||
|
import com.mogo.och.sweeper.bean.SweeperRoutesResult;
|
||||||
|
import com.mogo.och.sweeper.constant.SweeperConst;
|
||||||
|
import com.mogo.och.sweeper.model.SweeperOrderModel;
|
||||||
|
import com.mogo.och.sweeper.util.BDRouteDataTestUtils;
|
||||||
|
import com.mogo.och.sweeper.view.SlidePanelView;
|
||||||
|
import com.mogo.och.sweeper.view.SweeperTrafficDataView;
|
||||||
|
|
||||||
import androidx.constraintlayout.widget.Group;
|
import androidx.constraintlayout.widget.Group;
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
@@ -133,9 +142,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
|||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
if (!HmiBuildConfig.isShowBadCaseView) {
|
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
|
||||||
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initListener() {
|
private void initListener() {
|
||||||
|
|||||||
@@ -33,7 +33,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.CallerAutoPilotStatusListenerManager;
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
|
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
|
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
|
|
||||||
import com.mogo.eagle.core.function.call.v2x.CallLimitingVelocityListenerManager;
|
import com.mogo.eagle.core.function.call.v2x.CallLimitingVelocityListenerManager;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||||
@@ -255,7 +254,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
|||||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||||
|
|
||||||
// 注销定位监听
|
// 注销定位监听
|
||||||
CallerMapLocationListenerManager.INSTANCE.removeListener(TAG,false);
|
CallerChassisLocationGCJ20ListenerManager.INSTANCE.removeListener(TAG);
|
||||||
|
|
||||||
MogoAiCloudSocketManager.getInstance(mContext)
|
MogoAiCloudSocketManager.getInstance(mContext)
|
||||||
.unregisterLifecycleListener(10010);
|
.unregisterLifecycleListener(10010);
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ import java.lang.ref.WeakReference;
|
|||||||
* @author tongchenfei
|
* @author tongchenfei
|
||||||
*/
|
*/
|
||||||
public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFragment, BaseTaxiPassengerPresenter>
|
public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFragment, BaseTaxiPassengerPresenter>
|
||||||
implements IMogoMapListener, TaxiPassengerTaxiView, ITPClickStartAutopilotCallback, IMoGoHmiViewProxy.IViewNotificationProvider {
|
implements IMogoMapListener, TaxiPassengerTaxiView, ITPClickStartAutopilotCallback{
|
||||||
|
|
||||||
static final String TAG = "TaxiPassengerBaseFragment";
|
static final String TAG = "TaxiPassengerBaseFragment";
|
||||||
|
|
||||||
@@ -91,8 +91,6 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
|||||||
mTrafficLightView = findViewById(R.id.traffic_light_view);
|
mTrafficLightView = findViewById(R.id.traffic_light_view);
|
||||||
CallerHmiManager.INSTANCE.setProxyTrafficLightView(mTrafficLightView);
|
CallerHmiManager.INSTANCE.setProxyTrafficLightView(mTrafficLightView);
|
||||||
|
|
||||||
CallerHmiManager.INSTANCE.setNotificationViewProvider(this);
|
|
||||||
|
|
||||||
mMapswitchBtn = findViewById(R.id.module_och_taxi_swich_map_iv);
|
mMapswitchBtn = findViewById(R.id.module_och_taxi_swich_map_iv);
|
||||||
updateSwitchMapIcon();
|
updateSwitchMapIcon();
|
||||||
initListener();
|
initListener();
|
||||||
@@ -104,12 +102,6 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
|||||||
EmptyService.Companion.startService(getContext());
|
EmptyService.Companion.startService(getContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
|
||||||
@Override
|
|
||||||
public IViewNotification getNotificationView() {
|
|
||||||
return new TaxiPassengerV2XNotificationView(getContext());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateSwitchMapIcon() {
|
private void updateSwitchMapIcon() {
|
||||||
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
|
|||||||
@@ -28,6 +28,16 @@
|
|||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<!--Vip车辆标志-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
||||||
|
android:layout_width="@dimen/module_vip_width"
|
||||||
|
android:layout_height="@dimen/module_vip_height"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:marginStart="@dimen/dp_540"
|
||||||
|
app:marginTop="@dimen/dp_40"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/module_och_taxi_swich_map_iv"
|
android:id="@+id/module_och_taxi_swich_map_iv"
|
||||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||||
|
|||||||
@@ -93,8 +93,6 @@ class TaxiProvider implements IMogoOCH , IMogoStatusChangedListener {
|
|||||||
public Fragment createCoverage(@Nullable FragmentActivity fragmentActivity, @Nullable Integer integer) {
|
public Fragment createCoverage(@Nullable FragmentActivity fragmentActivity, @Nullable Integer integer) {
|
||||||
this.mActivity = fragmentActivity;
|
this.mActivity = fragmentActivity;
|
||||||
this.mContainerId = integer;
|
this.mContainerId = integer;
|
||||||
|
|
||||||
// UiThreadHandler.postDelayed(() -> stepIntoVrMode(), 5_000L);
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,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.CallerAutoPilotStatusListenerManager;
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
|
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
|
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
|
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||||
@@ -263,7 +262,7 @@ public class TaxiModel {
|
|||||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||||
|
|
||||||
// 注销地图监听
|
// 注销地图监听
|
||||||
CallerMapLocationListenerManager.INSTANCE.removeListener(TAG,false);
|
CallerChassisLocationGCJ20ListenerManager.INSTANCE.removeListener(TAG);
|
||||||
|
|
||||||
OCHSocketMessageManager.INSTANCE.releaseSocketMessageListener(OCHSocketMessageManager.msgMonitorType);
|
OCHSocketMessageManager.INSTANCE.releaseSocketMessageListener(OCHSocketMessageManager.msgMonitorType);
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import androidx.fragment.app.FragmentTransaction;
|
|||||||
import com.mogo.commons.mvp.IView;
|
import com.mogo.commons.mvp.IView;
|
||||||
import com.mogo.commons.mvp.MvpFragment;
|
import com.mogo.commons.mvp.MvpFragment;
|
||||||
import com.mogo.commons.mvp.Presenter;
|
import com.mogo.commons.mvp.Presenter;
|
||||||
import com.mogo.eagle.core.data.config.HmiBuildConfig;
|
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||||
@@ -202,9 +201,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
|||||||
mBadcaseBtn = findViewById(R.id.module_och_taxi_badcase_ll);
|
mBadcaseBtn = findViewById(R.id.module_och_taxi_badcase_ll);
|
||||||
if (mBadcaseBtn != null) {
|
if (mBadcaseBtn != null) {
|
||||||
CallerDevaToolsManager.INSTANCE.initBadCase(mBadcaseBtn);
|
CallerDevaToolsManager.INSTANCE.initBadCase(mBadcaseBtn);
|
||||||
if (!HmiBuildConfig.isShowBadCaseView) {
|
CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this);
|
||||||
CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mAICollectBtn = findViewById(R.id.module_och_taxi_ai_collect_ll);
|
mAICollectBtn = findViewById(R.id.module_och_taxi_ai_collect_ll);
|
||||||
@@ -292,9 +289,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
|||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
if (!HmiBuildConfig.isShowBadCaseView) {
|
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
|
||||||
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -79,6 +79,38 @@
|
|||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<!--Vip车辆标志-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
||||||
|
android:layout_width="@dimen/module_vip_width"
|
||||||
|
android:layout_height="@dimen/module_vip_height"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:marginStart="@dimen/dp_640"
|
||||||
|
app:marginTop="@dimen/dp_80"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"/>
|
||||||
|
|
||||||
|
<!--超视距-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.widget.CameraView
|
||||||
|
android:id="@+id/ivCameraIcon"
|
||||||
|
android:layout_width="120dp"
|
||||||
|
android:layout_height="120dp"
|
||||||
|
android:layout_marginTop="45dp"
|
||||||
|
android:layout_marginEnd="40dp"
|
||||||
|
app:layout_constraintRight_toLeftOf="@id/viewTrafficLightVr"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<!--红绿灯-->
|
||||||
|
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
|
||||||
|
android:id="@+id/viewTrafficLightVr"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/hmi_traffic_light_layout_margin_top"
|
||||||
|
android:layout_marginEnd="@dimen/hmi_traffic_light_layout_margin_right"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/module_mogo_och_station_panel_container"
|
android:id="@+id/module_mogo_och_station_panel_container"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@@ -3,66 +3,68 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
app:bgColor="@android:color/transparent"
|
||||||
|
app:blurRadius="20dp"
|
||||||
app:shadowColor="#C7151D4C"
|
app:shadowColor="#C7151D4C"
|
||||||
app:shadowRadius="42dp"
|
app:shadowRadius="42dp"
|
||||||
app:blurRadius="20dp"
|
|
||||||
app:xOffset="0dp"
|
app:xOffset="0dp"
|
||||||
app:yOffset="0dp"
|
app:yOffset="0dp">
|
||||||
app:bgColor="@android:color/transparent">
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/fragment_container"
|
android:id="@+id/fragment_container"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/module_och_taxi_order_status_change_test_bar"
|
android:id="@+id/module_och_taxi_order_status_change_test_bar"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent">
|
app:layout_constraintLeft_toLeftOf="parent">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/test_bar_current_order_id"
|
android:id="@+id/test_bar_current_order_id"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="@dimen/dp_24"
|
android:textColor="@android:color/white"
|
||||||
android:textColor="@android:color/white"/>
|
android:textSize="@dimen/dp_24" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/test_bar_current_line_id"
|
android:id="@+id/test_bar_current_line_id"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="@dimen/dp_24"
|
android:textColor="@android:color/white"
|
||||||
android:textColor="@android:color/white"/>
|
android:textSize="@dimen/dp_24" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/test_bar_current_traj_md5"
|
android:id="@+id/test_bar_current_traj_md5"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="@dimen/dp_24"
|
android:textColor="@android:color/white"
|
||||||
android:textColor="@android:color/white"/>
|
android:textSize="@dimen/dp_24" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/test_bar_current_stop_md5"
|
android:id="@+id/test_bar_current_stop_md5"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="@dimen/dp_24"
|
android:textColor="@android:color/white"
|
||||||
android:textColor="@android:color/white"/>
|
android:textSize="@dimen/dp_24" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/test_bar_current_traj_md5_dpqp"
|
android:id="@+id/test_bar_current_traj_md5_dpqp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="@dimen/dp_24"
|
android:textColor="@android:color/white"
|
||||||
android:textColor="@android:color/white"/>
|
android:textSize="@dimen/dp_24" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/test_bar_current_stop_md5_dpqp"
|
android:id="@+id/test_bar_current_stop_md5_dpqp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="@dimen/dp_24"
|
android:textColor="@android:color/white"
|
||||||
android:textColor="@android:color/white"/>
|
android:textSize="@dimen/dp_24" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/test_bar_to_start"
|
android:id="@+id/test_bar_to_start"
|
||||||
@@ -70,19 +72,20 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="到达上车点"
|
android:text="到达上车点"
|
||||||
android:textSize="@dimen/dp_24" />
|
android:textSize="@dimen/dp_24" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/test_bar_start_service_confirm"
|
android:id="@+id/test_bar_start_service_confirm"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="@dimen/dp_24"
|
android:text="开启服务"
|
||||||
android:text="开启服务"/>
|
android:textSize="@dimen/dp_24" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/test_bar_on_the_way_to_end"
|
android:id="@+id/test_bar_on_the_way_to_end"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="@dimen/dp_24"
|
android:text="开启自动驾驶"
|
||||||
android:text="开启自动驾驶"/>
|
android:textSize="@dimen/dp_24" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/test_bar_to_end"
|
android:id="@+id/test_bar_to_end"
|
||||||
|
|||||||
@@ -39,14 +39,14 @@ if (!isAndroidTestBuild()) {
|
|||||||
apply plugin: 'apm-plugin'
|
apply plugin: 'apm-plugin'
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (!isAndroidTestBuild()) {
|
if (!isAndroidTestBuild()) {
|
||||||
// apply plugin: 'bytex.threadOpt'
|
apply plugin: 'bytex.threadOpt'
|
||||||
// thread_opt {
|
thread_opt {
|
||||||
// enable !isReleaseBuild
|
enable true
|
||||||
// enableInDebug !isReleaseBuild
|
enableInDebug true
|
||||||
// logLevel "DEBUG"
|
logLevel "DEBUG"
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
|
|
||||||
if (!isAndroidTestBuild()) {
|
if (!isAndroidTestBuild()) {
|
||||||
apply plugin: 'LancetX'
|
apply plugin: 'LancetX'
|
||||||
@@ -55,13 +55,12 @@ if (!isAndroidTestBuild()) {
|
|||||||
enableInDebug true
|
enableInDebug true
|
||||||
|
|
||||||
weaveGroup {
|
weaveGroup {
|
||||||
leak_canary_crash_fix {
|
|
||||||
enable !isReleaseBuild
|
|
||||||
}
|
|
||||||
|
|
||||||
anr_fix {
|
anr_fix {
|
||||||
enable true
|
enable true
|
||||||
}
|
}
|
||||||
|
crash_fix {
|
||||||
|
enable true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -354,7 +353,6 @@ dependencies {
|
|||||||
androidTestImplementation rootProject.ext.dependencies.androidx_runner
|
androidTestImplementation rootProject.ext.dependencies.androidx_runner
|
||||||
androidTestImplementation rootProject.ext.dependencies.androidx_espresso_core
|
androidTestImplementation rootProject.ext.dependencies.androidx_espresso_core
|
||||||
androidTestImplementation rootProject.ext.dependencies.localbroadcastmanager
|
androidTestImplementation rootProject.ext.dependencies.localbroadcastmanager
|
||||||
androidTestImplementation rootProject.ext.dependencies.mogo_v2x
|
|
||||||
|
|
||||||
// if (isAndroidTestBuild()) {
|
// if (isAndroidTestBuild()) {
|
||||||
// implementation "com.mogo.thread.opt:lib:${THREAD_OPT_VERSION}"
|
// implementation "com.mogo.thread.opt:lib:${THREAD_OPT_VERSION}"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -13,6 +13,7 @@ import com.mogo.launcher.stageone.APMStartup;
|
|||||||
import com.mogo.launcher.stageone.ARouterStartUp;
|
import com.mogo.launcher.stageone.ARouterStartUp;
|
||||||
import com.mogo.launcher.stageone.ConfigStartUp;
|
import com.mogo.launcher.stageone.ConfigStartUp;
|
||||||
import com.mogo.launcher.stageone.HttpDnsStartUp;
|
import com.mogo.launcher.stageone.HttpDnsStartUp;
|
||||||
|
import com.mogo.launcher.stageone.ThreadOptStartup;
|
||||||
import com.rousetime.android_startup.StartupListener;
|
import com.rousetime.android_startup.StartupListener;
|
||||||
import com.rousetime.android_startup.StartupManager;
|
import com.rousetime.android_startup.StartupManager;
|
||||||
import com.rousetime.android_startup.model.LoggerLevel;
|
import com.rousetime.android_startup.model.LoggerLevel;
|
||||||
@@ -63,52 +64,13 @@ public class MogoApplication extends MainMoGoApplication {
|
|||||||
.addStartup(new APMStartup())
|
.addStartup(new APMStartup())
|
||||||
.addStartup(new ConfigStartUp())
|
.addStartup(new ConfigStartUp())
|
||||||
.addStartup(new ARouterStartUp())
|
.addStartup(new ARouterStartUp())
|
||||||
|
.addStartup(new ThreadOptStartup())
|
||||||
.setConfig(config)
|
.setConfig(config)
|
||||||
.build(this)
|
.build(this)
|
||||||
.start()
|
.start()
|
||||||
.await();
|
.await();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void attachBaseContext(Context base) {
|
|
||||||
super.attachBaseContext(base);
|
|
||||||
// ThreadConfig.Builder builder = new ThreadConfig.Builder().listener(new ThreadConfig.TaskExecuteListener() {
|
|
||||||
// @Override
|
|
||||||
// public boolean isEnabled() {
|
|
||||||
// return true; // 如果返回true,会有后续的回调;如果返回false, 不会有后续的回调
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onExecutorBefore(@NonNull Runnable runnable, @NonNull ThreadConfig.TaskType type) {
|
|
||||||
// //每个任务执行前回调
|
|
||||||
//// if (type == ThreadConfig.TaskType.HandlerThread) {
|
|
||||||
////
|
|
||||||
////
|
|
||||||
//// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onExecutorAfter(@NonNull Runnable runnable, @NonNull ThreadConfig.TaskType type) {
|
|
||||||
// //每个任务执行后回调
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * @param core 线程池的核心数
|
|
||||||
// * @param max 线程池的最大线程数
|
|
||||||
// * @param active 线程池正在活跃的任务数
|
|
||||||
// * @param completed 线程池已完成的任务数
|
|
||||||
// */
|
|
||||||
// @Override
|
|
||||||
// public void onExecutorStateChanged(@NonNull ThreadPoolExecutor pool, int core, int max, int active, long completed) {
|
|
||||||
// //线程池在执行过程,状态变化回调
|
|
||||||
// //Log.d("POOL", "core:" + core + ";max:" + max + ";active:" + active + ";completed:" + completed);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// builder.loggable(false);
|
|
||||||
// ThreadManager.INSTANCE.init(builder);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initCrashConfig() {
|
protected void initCrashConfig() {
|
||||||
CrashSystem crashSystem = CrashSystem.getInstance(this);
|
CrashSystem crashSystem = CrashSystem.getInstance(this);
|
||||||
@@ -122,4 +84,4 @@ public class MogoApplication extends MainMoGoApplication {
|
|||||||
super.initLogConfig();
|
super.initLogConfig();
|
||||||
Logger.init(BuildConfig.DEBUG ? LogLevel.DEBUG : LogLevel.OFF);
|
Logger.init(BuildConfig.DEBUG ? LogLevel.DEBUG : LogLevel.OFF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
32
app/src/main/java/com/mogo/launcher/lancet/CrashFix.kt
Normal file
32
app/src/main/java/com/mogo/launcher/lancet/CrashFix.kt
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
package com.mogo.launcher.lancet
|
||||||
|
|
||||||
|
import android.content.ComponentName
|
||||||
|
import android.content.Intent
|
||||||
|
import androidx.annotation.*
|
||||||
|
import com.knightboost.lancet.api.Origin
|
||||||
|
import com.knightboost.lancet.api.Scope.ALL
|
||||||
|
import com.knightboost.lancet.api.Scope.LEAF
|
||||||
|
import com.knightboost.lancet.api.annotations.*
|
||||||
|
|
||||||
|
@Keep
|
||||||
|
@Weaver
|
||||||
|
@Group("crash_fix")
|
||||||
|
class CrashFix {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修正Android8.0及之后,后台启动Service引起的崩溃
|
||||||
|
* java.lang.IllegalStateException: Not allowed to start service Intent {
|
||||||
|
* act=com.zhidao.cosupload.service.UPLOAD_ACTION cmp=com.mogo.launcher.f/com.zhidao.cosupload.service.UploadService }: app is in background uid UidRecord{6443b7b u0a404 LAST bg:+1m15s362ms idle change:idle procs:1 seq(0,0,0)}
|
||||||
|
*/
|
||||||
|
@Insert(mayCreateSuper = true)
|
||||||
|
@TargetClass("android.content.Context", scope = LEAF)
|
||||||
|
@TargetMethod(methodName = "startService")
|
||||||
|
fun fixStartServiceCrash(intent: Intent): ComponentName? {
|
||||||
|
return try {
|
||||||
|
Origin.call() as ComponentName?
|
||||||
|
} catch (t: Throwable) {
|
||||||
|
t.printStackTrace()
|
||||||
|
null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -22,6 +22,6 @@ class APMStartup : AndroidStartup<Boolean?>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun dependenciesByName(): List<String> {
|
override fun dependenciesByName(): List<String> {
|
||||||
return listOf("com.mogo.launcher.stageone.ARouterStartUp", "com.mogo.launcher.stageone.ConfigStartUp")
|
return listOf("com.mogo.launcher.stageone.ARouterStartUp", "com.mogo.launcher.stageone.ThreadOptStartup")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -31,4 +31,8 @@ class ARouterStartUp : AndroidStartup<String>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun waitOnMainThread() = false
|
override fun waitOnMainThread() = false
|
||||||
|
|
||||||
|
override fun dependenciesByName(): List<String>? {
|
||||||
|
return listOf("com.mogo.launcher.stageone.ThreadOptStartup")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -93,18 +93,6 @@ class ConfigStartUp : AndroidStartup<Boolean>() {
|
|||||||
// 配置BuglyAppID:MoGoEagleEye
|
// 配置BuglyAppID:MoGoEagleEye
|
||||||
CrashReportConstants.buglyAppID = "ac71228f85"
|
CrashReportConstants.buglyAppID = "ac71228f85"
|
||||||
|
|
||||||
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) ||
|
|
||||||
AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)||
|
|
||||||
AppIdentityModeUtils.isSweeper(FunctionBuildConfig.appIdentityMode)) {
|
|
||||||
//控制HMI展示元素 将不用手动调用setXXXXXViewVisibility
|
|
||||||
HmiBuildConfig.isShowSpeedView = false
|
|
||||||
HmiBuildConfig.isShowAutopilotStatusView = false
|
|
||||||
HmiBuildConfig.isShowPerspectiveSwitchView = false
|
|
||||||
HmiBuildConfig.isShowToolsView = false
|
|
||||||
HmiBuildConfig.isShowBadCaseView = false
|
|
||||||
HmiBuildConfig.isShowUpgradeTipsView = false
|
|
||||||
}
|
|
||||||
|
|
||||||
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
|
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
|
||||||
HdMapBuildConfig.currentCarVrIconRes = R.raw.chuzuche
|
HdMapBuildConfig.currentCarVrIconRes = R.raw.chuzuche
|
||||||
} else if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
} else if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||||
@@ -117,21 +105,13 @@ class ConfigStartUp : AndroidStartup<Boolean>() {
|
|||||||
|
|
||||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||||
//是否显示 红绿等
|
|
||||||
HmiBuildConfig.isShowTrafficLightView = false
|
|
||||||
//是否显示 限速UI
|
//是否显示 限速UI
|
||||||
HmiBuildConfig.isShowLimitingVelocityView = false
|
HmiBuildConfig.isShowLimitingVelocityView = false
|
||||||
//是否显示 路侧监控
|
|
||||||
HmiBuildConfig.isShowCameraView = false
|
|
||||||
//白天模式
|
//白天模式
|
||||||
FunctionBuildConfig.skinMode = 1
|
FunctionBuildConfig.skinMode = 1
|
||||||
} else if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
|
} else if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
|
||||||
//是否显示 红绿等
|
|
||||||
HmiBuildConfig.isShowTrafficLightView = false
|
|
||||||
//是否显示 限速UI
|
//是否显示 限速UI
|
||||||
HmiBuildConfig.isShowLimitingVelocityView = false
|
HmiBuildConfig.isShowLimitingVelocityView = false
|
||||||
//是否显示 路侧监控
|
|
||||||
HmiBuildConfig.isShowCameraView = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,4 +153,8 @@ class ConfigStartUp : AndroidStartup<Boolean>() {
|
|||||||
MapAutoApi.init(context, mapParams)
|
MapAutoApi.init(context, mapParams)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun dependenciesByName(): List<String> {
|
||||||
|
return listOf("com.mogo.launcher.stageone.ThreadOptStartup")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -70,7 +70,8 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
|
|||||||
|
|
||||||
override fun dependenciesByName(): List<String> {
|
override fun dependenciesByName(): List<String> {
|
||||||
return listOf(
|
return listOf(
|
||||||
"com.mogo.launcher.stageone.APMStartup"
|
"com.mogo.launcher.stageone.APMStartup",
|
||||||
|
"com.mogo.launcher.stageone.ThreadOptStartup"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,7 +218,8 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
|
|||||||
// 异步初始化NetConfig
|
// 异步初始化NetConfig
|
||||||
asyncInit()
|
asyncInit()
|
||||||
// HttpDns ttl回调 --- socketTTL
|
// HttpDns ttl回调 --- socketTTL
|
||||||
registerSocketHttpDnsTTL()
|
// registerSocketHttpDnsTTL()
|
||||||
|
startSocketService()
|
||||||
// 开启每5s/次定位上报
|
// 开启每5s/次定位上报
|
||||||
uploadLocPerFiveSecond()
|
uploadLocPerFiveSecond()
|
||||||
gotToken = true
|
gotToken = true
|
||||||
@@ -276,7 +278,6 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
|
|||||||
SceneConstant.M_MAIN + TAG,
|
SceneConstant.M_MAIN + TAG,
|
||||||
"获取缓存Dns IP : $dnsCacheIp , 原缓存 IP : $cacheIp"
|
"获取缓存Dns IP : $dnsCacheIp , 原缓存 IP : $cacheIp"
|
||||||
)
|
)
|
||||||
startSocketService()
|
|
||||||
cacheIp = dnsCacheIp
|
cacheIp = dnsCacheIp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -296,8 +297,8 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
|
|||||||
object : IMoGoMapLocationListener {
|
object : IMoGoMapLocationListener {
|
||||||
override fun onLocationChanged(
|
override fun onLocationChanged(
|
||||||
location: MogoLocation?, from: Int, isGps: Boolean) {
|
location: MogoLocation?, from: Int, isGps: Boolean) {
|
||||||
location?.let {
|
location?.let { loc ->
|
||||||
MogoLocationInfoServices.getInstance().provideLocation(it)
|
MogoLocationInfoServices.getInstance().provideLocation(loc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -377,5 +378,4 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
|
|||||||
MogoAiCloudSocketManager.getInstance(context)
|
MogoAiCloudSocketManager.getInstance(context)
|
||||||
.init(context, DebugConfig.getSocketAppId(), lat, lon)
|
.init(context, DebugConfig.getSocketAppId(), lat, lon)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.mogo.launcher.stageone
|
||||||
|
|
||||||
|
import android.content.*
|
||||||
|
import com.mogo.thread.ext.core.*
|
||||||
|
import com.mogo.thread.ext.core.config.*
|
||||||
|
import com.rousetime.android_startup.*
|
||||||
|
import java.io.*
|
||||||
|
import java.text.SimpleDateFormat
|
||||||
|
import java.util.*
|
||||||
|
import java.util.concurrent.TimeUnit.SECONDS
|
||||||
|
|
||||||
|
class ThreadOptStartup: AndroidStartup<Boolean>() {
|
||||||
|
|
||||||
|
override fun create(context: Context): Boolean {
|
||||||
|
ThreadManager
|
||||||
|
.init(ThreadConfig.Builder()
|
||||||
|
.maxKeepAliveTime(5, SECONDS)
|
||||||
|
/*.dump(DumpConfig.Builder()
|
||||||
|
.dumpLogFilePath(File(context.getExternalFilesDir(null), "thread_dump_log_${ SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.ROOT).format(Date()) }.txt").absolutePath)
|
||||||
|
.dumpPeriod(5, SECONDS)
|
||||||
|
.threadRunThreshold(10, SECONDS)
|
||||||
|
.build())*/)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun callCreateOnMainThread(): Boolean {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun waitOnMainThread(): Boolean {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,6 +15,7 @@ import com.zhidao.adas.client.bean.FSMFunctionStates;
|
|||||||
import com.zhidao.adas.client.bean.GlobalPathResp;
|
import com.zhidao.adas.client.bean.GlobalPathResp;
|
||||||
import com.zhidao.adas.client.bean.GnssInfo;
|
import com.zhidao.adas.client.bean.GnssInfo;
|
||||||
import com.zhidao.adas.client.bean.MogoReportMessage;
|
import com.zhidao.adas.client.bean.MogoReportMessage;
|
||||||
|
import com.zhidao.adas.client.bean.ObuWarningData;
|
||||||
import com.zhidao.adas.client.bean.OriginalPointCloudData;
|
import com.zhidao.adas.client.bean.OriginalPointCloudData;
|
||||||
import com.zhidao.adas.client.bean.PerceptionTrafficLight;
|
import com.zhidao.adas.client.bean.PerceptionTrafficLight;
|
||||||
import com.zhidao.adas.client.bean.PlanningDecisionState;
|
import com.zhidao.adas.client.bean.PlanningDecisionState;
|
||||||
@@ -125,6 +126,7 @@ public class DataDistribution {
|
|||||||
public final List<DataShow> listFSMFunctionStates = new ArrayList<>();
|
public final List<DataShow> listFSMFunctionStates = new ArrayList<>();
|
||||||
public final List<DataShow> listRoboSweeperTaskIndex = new ArrayList<>();
|
public final List<DataShow> listRoboSweeperTaskIndex = new ArrayList<>();
|
||||||
public final List<DataShow> listBagManagerCmd = new ArrayList<>();
|
public final List<DataShow> listBagManagerCmd = new ArrayList<>();
|
||||||
|
public final List<DataShow> listObuWarningData = new ArrayList<>();
|
||||||
|
|
||||||
private long listTrajectorySize = 0;
|
private long listTrajectorySize = 0;
|
||||||
private long listTrackedObjectsSize = 0;
|
private long listTrackedObjectsSize = 0;
|
||||||
@@ -148,6 +150,7 @@ public class DataDistribution {
|
|||||||
private long listFSMFunctionStatesSize = 0;
|
private long listFSMFunctionStatesSize = 0;
|
||||||
private long listRoboSweeperTaskIndexSize = 0;
|
private long listRoboSweeperTaskIndexSize = 0;
|
||||||
private long listBagManagerCmdSize = 0;
|
private long listBagManagerCmdSize = 0;
|
||||||
|
private long listObuWarningDataSize = 0;
|
||||||
|
|
||||||
public String cutDown(String str) {
|
public String cutDown(String str) {
|
||||||
if (isCutDown && str.length() > 650) {
|
if (isCutDown && str.length() > 650) {
|
||||||
@@ -199,6 +202,14 @@ public class DataDistribution {
|
|||||||
if (listener != null && Constants.TITLE.RECEIVE_PLANNING_DECISION_STATE.equals(listener.first)) {
|
if (listener != null && Constants.TITLE.RECEIVE_PLANNING_DECISION_STATE.equals(listener.first)) {
|
||||||
listener.second.onRefresh();
|
listener.second.onRefresh();
|
||||||
}
|
}
|
||||||
|
} else if (data instanceof ObuWarningData) {
|
||||||
|
listObuWarningData.add(0, new DataShow(listObuWarningDataSize++, time + str));
|
||||||
|
if (listObuWarningData.size() > LIST_SIZE) {
|
||||||
|
listObuWarningData.remove(listObuWarningData.size() - 1);
|
||||||
|
}
|
||||||
|
if (listener != null && Constants.TITLE.RECEIVE_OBU_WARNING_DATA.equals(listener.first)) {
|
||||||
|
listener.second.onRefresh();
|
||||||
|
}
|
||||||
} else if (data instanceof GnssInfo) {
|
} else if (data instanceof GnssInfo) {
|
||||||
listGnssInfo.add(0, new DataShow(listGnssInfoSize++, time + str));
|
listGnssInfo.add(0, new DataShow(listGnssInfoSize++, time + str));
|
||||||
if (listGnssInfo.size() > LIST_SIZE) {
|
if (listGnssInfo.size() > LIST_SIZE) {
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.zhidao.adas.client.bean;
|
||||||
|
|
||||||
|
import com.google.protobuf.TextFormat;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
|
||||||
|
import mogo.telematics.pad.MessagePad;
|
||||||
|
import mogo.v2x.ObuWarningEvent;
|
||||||
|
|
||||||
|
public class ObuWarningData extends BaseInfo {
|
||||||
|
public final ObuWarningEvent.ObuWarningData bean;
|
||||||
|
|
||||||
|
public ObuWarningData(MessagePad.Header header, ObuWarningEvent.ObuWarningData bean, SimpleDateFormat sdf) {
|
||||||
|
super("接收", bean.getSerializedSize(), header, sdf);
|
||||||
|
this.bean = bean;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -132,6 +132,8 @@ public class InfoFragment extends BaseFragment {
|
|||||||
adapter.setData(DataDistribution.getInstance().listArrivalNotification);
|
adapter.setData(DataDistribution.getInstance().listArrivalNotification);
|
||||||
} else if (Constants.TITLE.RECEIVE_STATUS_QUERY_RESP.equals(title)) {
|
} else if (Constants.TITLE.RECEIVE_STATUS_QUERY_RESP.equals(title)) {
|
||||||
adapter.setData(DataDistribution.getInstance().listStatusInfo);
|
adapter.setData(DataDistribution.getInstance().listStatusInfo);
|
||||||
|
} else if (Constants.TITLE.RECEIVE_OBU_WARNING_DATA.equals(title)) {
|
||||||
|
adapter.setData(DataDistribution.getInstance().listObuWarningData);
|
||||||
} else if (Constants.TITLE.RECEIVE_RECORD_DATA_CONFIG_RESP.equals(title)) {
|
} else if (Constants.TITLE.RECEIVE_RECORD_DATA_CONFIG_RESP.equals(title)) {
|
||||||
adapter.setData(DataDistribution.getInstance().listRecordDataConfig);
|
adapter.setData(DataDistribution.getInstance().listRecordDataConfig);
|
||||||
} else if (Constants.TITLE.RECEIVE_GLOBAL_PATH_RESP.equals(title)) {
|
} else if (Constants.TITLE.RECEIVE_GLOBAL_PATH_RESP.equals(title)) {
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ import com.zhidao.adas.client.bean.GlobalPathResp;
|
|||||||
import com.zhidao.adas.client.bean.GnssInfo;
|
import com.zhidao.adas.client.bean.GnssInfo;
|
||||||
import com.zhidao.adas.client.bean.IPCConnectState;
|
import com.zhidao.adas.client.bean.IPCConnectState;
|
||||||
import com.zhidao.adas.client.bean.MogoReportMessage;
|
import com.zhidao.adas.client.bean.MogoReportMessage;
|
||||||
|
import com.zhidao.adas.client.bean.ObuWarningData;
|
||||||
import com.zhidao.adas.client.bean.OriginalPointCloudData;
|
import com.zhidao.adas.client.bean.OriginalPointCloudData;
|
||||||
import com.zhidao.adas.client.bean.PerceptionTrafficLight;
|
import com.zhidao.adas.client.bean.PerceptionTrafficLight;
|
||||||
import com.zhidao.adas.client.bean.PlanningDecisionState;
|
import com.zhidao.adas.client.bean.PlanningDecisionState;
|
||||||
@@ -121,6 +122,7 @@ import chassis.ChassisStatesOuterClass;
|
|||||||
import function_state_management.FunctionStates;
|
import function_state_management.FunctionStates;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import mogo.telematics.pad.MessagePad;
|
import mogo.telematics.pad.MessagePad;
|
||||||
|
import mogo.v2x.ObuWarningEvent;
|
||||||
import mogo_msg.MogoReportMsg;
|
import mogo_msg.MogoReportMsg;
|
||||||
import perception.TrafficLightOuterClass;
|
import perception.TrafficLightOuterClass;
|
||||||
import planning.RoboSweeperTaskIndexOuterClass;
|
import planning.RoboSweeperTaskIndexOuterClass;
|
||||||
@@ -650,6 +652,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
|||||||
titleFragmentData.add(Constants.TITLE.RECEIVE_GLOBAL_PATH_RESP);
|
titleFragmentData.add(Constants.TITLE.RECEIVE_GLOBAL_PATH_RESP);
|
||||||
titleFragmentData.add(Constants.TITLE.RECEIVE_ARRIVAL_NOTIFICATION);
|
titleFragmentData.add(Constants.TITLE.RECEIVE_ARRIVAL_NOTIFICATION);
|
||||||
titleFragmentData.add(Constants.TITLE.RECEIVE_STATUS_QUERY_RESP);
|
titleFragmentData.add(Constants.TITLE.RECEIVE_STATUS_QUERY_RESP);
|
||||||
|
titleFragmentData.add(Constants.TITLE.RECEIVE_OBU_WARNING_DATA);
|
||||||
titleFragmentData.add(Constants.TITLE.RECEIVE_SWEEPER_TASK_INDEX_DATA);
|
titleFragmentData.add(Constants.TITLE.RECEIVE_SWEEPER_TASK_INDEX_DATA);
|
||||||
titleFragmentData.add(Constants.TITLE.RECEIVE_WARN);
|
titleFragmentData.add(Constants.TITLE.RECEIVE_WARN);
|
||||||
titleFragmentData.add(Constants.TITLE.RECEIVE_ERROR);
|
titleFragmentData.add(Constants.TITLE.RECEIVE_ERROR);
|
||||||
@@ -1028,6 +1031,12 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
|||||||
DataDistribution.getInstance().addData(base);
|
DataDistribution.getInstance().addData(base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onObuWarningData(MessagePad.Header header, ObuWarningEvent.ObuWarningData obuWarningData) {
|
||||||
|
ObuWarningData base = new ObuWarningData(header, obuWarningData, sdf);
|
||||||
|
DataDistribution.getInstance().addData(base);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFunctionStates(MessagePad.Header header, FunctionStates.FSMFunctionStates functionStates) {
|
public void onFunctionStates(MessagePad.Header header, FunctionStates.FSMFunctionStates functionStates) {
|
||||||
FSMFunctionStates base = new FSMFunctionStates(header, functionStates, sdf);
|
FSMFunctionStates base = new FSMFunctionStates(header, functionStates, sdf);
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ public class Constants {
|
|||||||
String RECEIVE_WARN = MessageType.TYPE_RECEIVE_WARN.desc;
|
String RECEIVE_WARN = MessageType.TYPE_RECEIVE_WARN.desc;
|
||||||
String RECEIVE_ARRIVAL_NOTIFICATION = MessageType.TYPE_RECEIVE_ARRIVAL_NOTIFICATION.desc;
|
String RECEIVE_ARRIVAL_NOTIFICATION = MessageType.TYPE_RECEIVE_ARRIVAL_NOTIFICATION.desc;
|
||||||
String RECEIVE_STATUS_QUERY_RESP = MessageType.TYPE_RECEIVE_STATUS_QUERY_RESP.desc;
|
String RECEIVE_STATUS_QUERY_RESP = MessageType.TYPE_RECEIVE_STATUS_QUERY_RESP.desc;
|
||||||
|
String RECEIVE_OBU_WARNING_DATA = MessageType.TYPE_RECEIVE_OBU_WARNING_DATA.desc;
|
||||||
String RECEIVE_ERROR = "错误数据";
|
String RECEIVE_ERROR = "错误数据";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ import chassis.ChassisStatesOuterClass;
|
|||||||
import chassis.VehicleStateOuterClass;
|
import chassis.VehicleStateOuterClass;
|
||||||
import function_state_management.FunctionStates;
|
import function_state_management.FunctionStates;
|
||||||
import mogo.telematics.pad.MessagePad;
|
import mogo.telematics.pad.MessagePad;
|
||||||
|
import mogo.v2x.ObuWarningEvent;
|
||||||
import mogo_msg.MogoReportMsg;
|
import mogo_msg.MogoReportMsg;
|
||||||
import perception.TrafficLightOuterClass;
|
import perception.TrafficLightOuterClass;
|
||||||
import planning.RoboSweeperTaskIndexOuterClass;
|
import planning.RoboSweeperTaskIndexOuterClass;
|
||||||
@@ -547,6 +548,11 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onObuWarningData(MessagePad.Header header, ObuWarningEvent.ObuWarningData obuWarningData) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFunctionStates(MessagePad.Header header, FunctionStates.FSMFunctionStates functionStates) {
|
public void onFunctionStates(MessagePad.Header header, FunctionStates.FSMFunctionStates functionStates) {
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ buildscript {
|
|||||||
classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}"
|
classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}"
|
||||||
classpath "com.mogo.cloud:bizconfig:${BIZCONFIG_VERSION}"
|
classpath "com.mogo.cloud:bizconfig:${BIZCONFIG_VERSION}"
|
||||||
classpath 'com.volcengine:apm_insight_plugin:1.4.1'
|
classpath 'com.volcengine:apm_insight_plugin:1.4.1'
|
||||||
// classpath "com.mogo.thread.opt:plg:${THREAD_OPT_VERSION}"
|
classpath "com.mogo.thread.opt:plg:${THREAD_OPT_VERSION}"
|
||||||
classpath 'com.mogo.cloud:systrace:1.0.1'
|
classpath 'com.mogo.cloud:systrace:1.0.1'
|
||||||
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18'
|
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18'
|
||||||
classpath 'com.mogo.sticky:service:1.0.8'
|
classpath 'com.mogo.sticky:service:1.0.8'
|
||||||
|
|||||||
@@ -183,8 +183,6 @@ ext {
|
|||||||
mogo_core_utils : "com.mogo.eagle.core:utils:${MOGO_CORE_UTILS_VERSION}",
|
mogo_core_utils : "com.mogo.eagle.core:utils:${MOGO_CORE_UTILS_VERSION}",
|
||||||
mogo_core_network : "com.mogo.eagle.core:network:${MOGO_CORE_NETWORK_VERSION}",
|
mogo_core_network : "com.mogo.eagle.core:network:${MOGO_CORE_NETWORK_VERSION}",
|
||||||
|
|
||||||
//========================= V2X SDK =========================
|
|
||||||
mogo_v2x : "com.mogo.v2x:v2x:${MOGO_V2X_SDK_VERSION}",
|
|
||||||
|
|
||||||
life_cycle_scope : "androidx.lifecycle:lifecycle-runtime-ktx:2.2.0",
|
life_cycle_scope : "androidx.lifecycle:lifecycle-runtime-ktx:2.2.0",
|
||||||
view_model_scope : "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0",
|
view_model_scope : "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0",
|
||||||
|
|||||||
@@ -10,6 +10,11 @@ import com.mogo.eagle.function.biz.dispatch.DispatchAutoPilotManager.Companion.d
|
|||||||
import com.mogo.eagle.function.biz.monitoring.CronTaskManager.Companion.cronTaskManager
|
import com.mogo.eagle.function.biz.monitoring.CronTaskManager.Companion.cronTaskManager
|
||||||
import com.mogo.eagle.function.biz.notice.NoticeSocketManager.Companion.noticeSocketManager
|
import com.mogo.eagle.function.biz.notice.NoticeSocketManager.Companion.noticeSocketManager
|
||||||
import com.mogo.eagle.function.biz.notice.network.NoticeNetWorkManager
|
import com.mogo.eagle.function.biz.notice.network.NoticeNetWorkManager
|
||||||
|
import com.mogo.eagle.function.biz.v2x.speedlimit.SpeedLimitDataManager
|
||||||
|
import com.mogo.eagle.function.biz.v2x.speedlimit.SpeedLimitDispatcher
|
||||||
|
import com.mogo.eagle.function.biz.v2x.trafficlight.core.MogoTrafficLightManager
|
||||||
|
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightDispatcher
|
||||||
|
import com.mogo.eagle.function.biz.v2x.vip.VipCarManager
|
||||||
|
|
||||||
@Route(path = MogoServicePaths.PATH_FUNC_BIZ)
|
@Route(path = MogoServicePaths.PATH_FUNC_BIZ)
|
||||||
class FuncBizProvider : IMoGoFuncBizProvider {
|
class FuncBizProvider : IMoGoFuncBizProvider {
|
||||||
@@ -21,6 +26,13 @@ class FuncBizProvider : IMoGoFuncBizProvider {
|
|||||||
noticeSocketManager.init(context)
|
noticeSocketManager.init(context)
|
||||||
dispatchAutoPilotManager.init(context)
|
dispatchAutoPilotManager.init(context)
|
||||||
cronTaskManager.startCronTask()
|
cronTaskManager.startCronTask()
|
||||||
|
|
||||||
|
MogoTrafficLightManager.INSTANCE.initServer(context)
|
||||||
|
TrafficLightDispatcher.INSTANCE.initServer(context) //todo 红绿灯中心模块放入dataCenter
|
||||||
|
VipCarManager.INSTANCE.initServer(context)
|
||||||
|
SpeedLimitDataManager.getInstance().start()
|
||||||
|
SpeedLimitDispatcher.INSTANCE.initLimit(context)
|
||||||
|
// RedLightWarningManager.INSTANCE.listenTrafficLight()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun feedBackNoticeTraffic(infoId: String, sn: String, accept: Int) {
|
override fun feedBackNoticeTraffic(infoId: String, sn: String, accept: Int) {
|
||||||
@@ -62,5 +74,9 @@ class FuncBizProvider : IMoGoFuncBizProvider {
|
|||||||
noticeSocketManager.release()
|
noticeSocketManager.release()
|
||||||
dispatchAutoPilotManager.release()
|
dispatchAutoPilotManager.release()
|
||||||
cronTaskManager.release()
|
cronTaskManager.release()
|
||||||
|
|
||||||
|
VipCarManager.INSTANCE.destroy()
|
||||||
|
TrafficLightDispatcher.INSTANCE.destroy()
|
||||||
|
// RedLightWarningManager.INSTANCE.onDestroy()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -30,7 +30,7 @@ class DispatchServiceModel private constructor() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private var mAdasApiService: IDispatchAdasApiService =
|
private var mAdasApiService: IDispatchAdasApiService =
|
||||||
MoGoRetrofitFactory.getInstance(HostConst.DATA_SERVICE_HOST).create(
|
MoGoRetrofitFactory.getInstance(HostConst.getEagleHost()).create(
|
||||||
IDispatchAdasApiService::class.java
|
IDispatchAdasApiService::class.java
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ interface IDispatchAdasApiService {
|
|||||||
* @return [BaseData]
|
* @return [BaseData]
|
||||||
*/
|
*/
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST("/dataService/autoDriver/receiveCarPreSetPath")
|
@POST("eagle-eye-dns/eagle-eye-dns/dataService/autoDriver/receiveCarPreSetPath")
|
||||||
fun uploadAutopilotRoute(@FieldMap parameters: Map<String, Any>): Observable<BaseData>
|
fun uploadAutopilotRoute(@FieldMap parameters: Map<String, Any>): Observable<BaseData>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -24,7 +24,7 @@ interface IDispatchAdasApiService {
|
|||||||
* @return [BaseData]
|
* @return [BaseData]
|
||||||
*/
|
*/
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST("/dataService/autoDriver/receiverDestSiteResult")
|
@POST("eagle-eye-dns/dataService/autoDriver/receiverDestSiteResult")
|
||||||
fun uploadDispatchResult(@FieldMap parameters: MutableMap<String, Any>): Observable<BaseData>
|
fun uploadDispatchResult(@FieldMap parameters: MutableMap<String, Any>): Observable<BaseData>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -34,6 +34,6 @@ interface IDispatchAdasApiService {
|
|||||||
* @return [BaseData]
|
* @return [BaseData]
|
||||||
*/
|
*/
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST("/dataService/autoDriver/receiveAutopilotState")
|
@POST("eagle-eye-dns/dataService/autoDriver/receiveAutopilotState")
|
||||||
fun uploadAutopilotState(@FieldMap parameters: MutableMap<String, Any>): Observable<BaseData>
|
fun uploadAutopilotState(@FieldMap parameters: MutableMap<String, Any>): Observable<BaseData>
|
||||||
}
|
}
|
||||||
@@ -7,12 +7,12 @@ import com.mogo.commons.constants.HostConst
|
|||||||
import com.mogo.commons.utils.RetryWithDelay
|
import com.mogo.commons.utils.RetryWithDelay
|
||||||
import com.mogo.eagle.core.data.camera.CameraEntity
|
import com.mogo.eagle.core.data.camera.CameraEntity
|
||||||
import com.mogo.eagle.core.data.camera.ReqLiveCarBean
|
import com.mogo.eagle.core.data.camera.ReqLiveCarBean
|
||||||
|
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.hmi.CallerHmiManager
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
|
||||||
import com.mogo.eagle.function.biz.monitoring.net.ICameraListServices
|
|
||||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MONITOR
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MONITOR
|
||||||
|
import com.mogo.eagle.function.biz.monitoring.net.ICameraListServices
|
||||||
import io.reactivex.Observable
|
import io.reactivex.Observable
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||||
import io.reactivex.disposables.Disposable
|
import io.reactivex.disposables.Disposable
|
||||||
@@ -90,8 +90,8 @@ class CronTaskManager {
|
|||||||
* 请求路口一定范围内的设备信息(包含:摄像头、灯)
|
* 请求路口一定范围内的设备信息(包含:摄像头、灯)
|
||||||
*/
|
*/
|
||||||
private fun requestDeviceList() {
|
private fun requestDeviceList() {
|
||||||
CallerMapLocationListenerManager.getCurrentLocation()?.let { location ->
|
CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()?.let { location ->
|
||||||
disposable = MoGoRetrofitFactory.getInstance(HostConst.CITY_HOST)
|
disposable = MoGoRetrofitFactory.getInstance(HostConst.getEagleHost())
|
||||||
.create(ICameraListServices::class.java)
|
.create(ICameraListServices::class.java)
|
||||||
.getDeviceList(location.longitude, location.latitude, 500)
|
.getDeviceList(location.longitude, location.latitude, 500)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
@@ -124,8 +124,8 @@ class CronTaskManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun requestCarCameraList() {
|
private fun requestCarCameraList() {
|
||||||
CallerMapLocationListenerManager.getCurrentLocation()?.let { location ->
|
CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()?.let { location ->
|
||||||
carDisposable = MoGoRetrofitFactory.getInstance(HostConst.CITY_HOST)
|
carDisposable = MoGoRetrofitFactory.getInstance(HostConst.getEagleHost())
|
||||||
.create(ICameraListServices::class.java)
|
.create(ICameraListServices::class.java)
|
||||||
.getCarCameraList(ReqLiveCarBean(location.longitude, location.latitude))
|
.getCarCameraList(ReqLiveCarBean(location.longitude, location.latitude))
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
@@ -193,7 +193,7 @@ class CronTaskManager {
|
|||||||
streamDisposable?.let {
|
streamDisposable?.let {
|
||||||
if (!it.isDisposed) it.dispose()
|
if (!it.isDisposed) it.dispose()
|
||||||
}
|
}
|
||||||
streamDisposable = MoGoRetrofitFactory.getInstance(HostConst.CITY_HOST)
|
streamDisposable = MoGoRetrofitFactory.getInstance(HostConst.getEagleHost())
|
||||||
.create(ICameraListServices::class.java)
|
.create(ICameraListServices::class.java)
|
||||||
.reqOpenCameraStream(cameraIp)
|
.reqOpenCameraStream(cameraIp)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
@@ -222,7 +222,7 @@ class CronTaskManager {
|
|||||||
streamDisposable2?.let {
|
streamDisposable2?.let {
|
||||||
if (!it.isDisposed) it.dispose()
|
if (!it.isDisposed) it.dispose()
|
||||||
}
|
}
|
||||||
streamDisposable2 = MoGoRetrofitFactory.getInstance(HostConst.CITY_HOST)
|
streamDisposable2 = MoGoRetrofitFactory.getInstance(HostConst.getEagleHost())
|
||||||
.create(ICameraListServices::class.java)
|
.create(ICameraListServices::class.java)
|
||||||
.reqOpenCameraStreamWithRetry(cameraIp)
|
.reqOpenCameraStreamWithRetry(cameraIp)
|
||||||
.flatMap {
|
.flatMap {
|
||||||
|
|||||||
@@ -9,21 +9,21 @@ interface ICameraListServices {
|
|||||||
@GET("/yycp-smartTransportationAiCloud-service/eagle/device/list")
|
@GET("/yycp-smartTransportationAiCloud-service/eagle/device/list")
|
||||||
fun getCameraList(@Query("roadId") roadId: String?): Single<CameraListInfo?>
|
fun getCameraList(@Query("roadId") roadId: String?): Single<CameraListInfo?>
|
||||||
|
|
||||||
@POST("/yycp-launcherSnapshot/car/queryLiveCarByLocal")
|
@POST("eagle-eye-dns/yycp-launcherSnapshot/car/queryLiveCarByLocal")
|
||||||
fun getCarCameraList(@Body reqBody: ReqLiveCarBean): Single<LiveCarCameraInfo?>
|
fun getCarCameraList(@Body reqBody: ReqLiveCarBean): Single<LiveCarCameraInfo?>
|
||||||
|
|
||||||
@GET("/openStream/{cameraIp}")
|
@GET("/openStream/{cameraIp}")
|
||||||
fun openCameraStream(@Path("cameraIp") cameraIp: String): Single<CameraStreamEntity>
|
fun openCameraStream(@Path("cameraIp") cameraIp: String): Single<CameraStreamEntity>
|
||||||
|
|
||||||
@GET("/camera-stream/stream/camera/openStream")
|
@GET("eagle-eye-dns/camera-stream/stream/camera/openStream")
|
||||||
fun reqOpenCameraStream(@Query("ip") cameraIp: String): Single<OpenCameraStreamEntity>
|
fun reqOpenCameraStream(@Query("ip") cameraIp: String): Single<OpenCameraStreamEntity>
|
||||||
|
|
||||||
@GET("/mec-etl-server/crossing/geo/device")
|
@GET("eagle-eye-dns/mec-etl-server/crossing/geo/device")
|
||||||
fun getDeviceList(
|
fun getDeviceList(
|
||||||
@Query("lon") lon: Double, @Query("lat") lat: Double,
|
@Query("lon") lon: Double, @Query("lat") lat: Double,
|
||||||
@Query("radiusMeter") radiusMeter: Int
|
@Query("radiusMeter") radiusMeter: Int
|
||||||
): Single<CameraListInfo?>
|
): Single<CameraListInfo?>
|
||||||
|
|
||||||
@GET("/camera-stream/stream/camera/openStream")
|
@GET("eagle-eye-dns/camera-stream/stream/camera/openStream")
|
||||||
fun reqOpenCameraStreamWithRetry(@Query("ip") cameraIp: String): Observable<OpenCameraStreamEntity>
|
fun reqOpenCameraStreamWithRetry(@Query("ip") cameraIp: String): Observable<OpenCameraStreamEntity>
|
||||||
}
|
}
|
||||||
@@ -27,7 +27,7 @@ public interface INoticeApiService {
|
|||||||
* @return {@link NoticeTrafficStyleInfo}
|
* @return {@link NoticeTrafficStyleInfo}
|
||||||
*/
|
*/
|
||||||
@Headers("Content-Type:application/json;charset=UTF-8")
|
@Headers("Content-Type:application/json;charset=UTF-8")
|
||||||
@POST("/deva/accidentInfoManage/queryMyAccidentHandleInfo/server/v1")
|
@POST("eagle-eye-dns/deva/accidentInfoManage/queryMyAccidentHandleInfo/server/v1")
|
||||||
Observable<NoticeTrafficStyleInfo> getAccidentInfo(@Body RequestBody requestBody);
|
Observable<NoticeTrafficStyleInfo> getAccidentInfo(@Body RequestBody requestBody);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,7 +36,7 @@ public interface INoticeApiService {
|
|||||||
* @param accidentParameters 请求数据(infoID事故ID;sn;status接受状态 0否 1是)
|
* @param accidentParameters 请求数据(infoID事故ID;sn;status接受状态 0否 1是)
|
||||||
* @return {@link BaseData}
|
* @return {@link BaseData}
|
||||||
*/
|
*/
|
||||||
@GET("/deva/accidentInfoManage/policeUpdateTroubleStatus")
|
@GET("eagle-eye-dns/deva/accidentInfoManage/policeUpdateTroubleStatus")
|
||||||
Observable<BaseData> sendAcceptStatus(@QueryMap Map<String, String> accidentParameters);
|
Observable<BaseData> sendAcceptStatus(@QueryMap Map<String, String> accidentParameters);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import android.util.ArrayMap;
|
|||||||
import com.mogo.cloud.network.NetConstants;
|
import com.mogo.cloud.network.NetConstants;
|
||||||
import com.mogo.cloud.network.RetrofitFactory;
|
import com.mogo.cloud.network.RetrofitFactory;
|
||||||
import com.mogo.cloud.passport.MoGoAiCloudClient;
|
import com.mogo.cloud.passport.MoGoAiCloudClient;
|
||||||
|
import com.mogo.commons.constants.HostConst;
|
||||||
import com.mogo.eagle.core.data.BaseData;
|
import com.mogo.eagle.core.data.BaseData;
|
||||||
import com.mogo.eagle.core.data.notice.NoticeNormalDetail;
|
import com.mogo.eagle.core.data.notice.NoticeNormalDetail;
|
||||||
import com.mogo.eagle.core.data.notice.NoticeRequest;
|
import com.mogo.eagle.core.data.notice.NoticeRequest;
|
||||||
@@ -34,7 +35,7 @@ public class NoticeNetWorkManager {
|
|||||||
private final INoticeApiService mNoticeApiService;
|
private final INoticeApiService mNoticeApiService;
|
||||||
|
|
||||||
private NoticeNetWorkManager() {
|
private NoticeNetWorkManager() {
|
||||||
mNoticeApiService = RetrofitFactory.INSTANCE.getInstance(NetConstants.DEVA_HOST)
|
mNoticeApiService = RetrofitFactory.INSTANCE.getInstance(HostConst.getEagleHost())
|
||||||
.create(INoticeApiService.class);
|
.create(INoticeApiService.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mogo.eagle.core.function.v2x.redlightwarning
|
package com.mogo.eagle.function.biz.v2x.redlightwarning
|
||||||
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_IVP
|
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_IVP
|
||||||
@@ -16,16 +16,15 @@ import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
|||||||
import com.mogo.eagle.core.function.api.vip.IMoGoVipSetListener
|
import com.mogo.eagle.core.function.api.vip.IMoGoVipSetListener
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
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.hmi.CallerHmiManager
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||||
import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager
|
import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager
|
||||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.MogoTrafficLightManager
|
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||||
import com.mogo.eagle.core.utilcode.util.LocationUtils
|
import com.mogo.eagle.core.utilcode.util.LocationUtils
|
||||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||||
|
import com.mogo.eagle.function.biz.v2x.trafficlight.core.MogoTrafficLightManager
|
||||||
import com.zhjt.service_biz.BizConfig
|
import com.zhjt.service_biz.BizConfig
|
||||||
import mogo.telematics.pad.MessagePad
|
import mogo.telematics.pad.MessagePad
|
||||||
import kotlin.math.abs
|
import kotlin.math.abs
|
||||||
@@ -275,7 +274,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
|||||||
fun onDestroy() {
|
fun onDestroy() {
|
||||||
CallVipSetListenerManager.removeListener(TAG)
|
CallVipSetListenerManager.removeListener(TAG)
|
||||||
CallerTrafficLightListenerManager.removeListener(TAG)
|
CallerTrafficLightListenerManager.removeListener(TAG)
|
||||||
CallerMapLocationListenerManager.removeListener(TAG, false)
|
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) {
|
override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mogo.eagle.core.function.v2x.speedlimit;
|
package com.mogo.eagle.function.biz.v2x.speedlimit;
|
||||||
|
|
||||||
import static com.mogo.eagle.core.data.config.HmiBuildConfig.isShowObuLimitSpeedView;
|
import static com.mogo.eagle.core.data.config.HmiBuildConfig.isShowObuLimitSpeedView;
|
||||||
import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.BIZ_SLW;
|
import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.BIZ_SLW;
|
||||||
@@ -61,15 +61,16 @@ public class SpeedLimitDataManager implements IMoGoChassisLocationGCJ02Listener
|
|||||||
|
|
||||||
@BizConfig(biz = V2I, dependentBizNode = "", bizNode = BIZ_SLW)
|
@BizConfig(biz = V2I, dependentBizNode = "", bizNode = BIZ_SLW)
|
||||||
private void getSpeedLimit() {
|
private void getSpeedLimit() {
|
||||||
if (!isShowObuLimitSpeedView) {
|
// if (!isShowObuLimitSpeedView) {
|
||||||
int speedLimit = CallerMapUIServiceManager.INSTANCE.getMapUIController().getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), (float) mLocation.getHeading());
|
int speedLimit = CallerMapUIServiceManager.INSTANCE.getMapUIController().getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), (float) mLocation.getHeading());
|
||||||
UiThreadHandler.post(() -> {
|
UiThreadHandler.post(() -> {
|
||||||
if (speedLimit > 0) {
|
if (speedLimit > 0) {
|
||||||
CallerHmiManager.INSTANCE.showLimitingVelocity(speedLimit);
|
// CallerHmiManager.INSTANCE.showLimitingVelocity(speedLimit, 1);
|
||||||
CallLimitingVelocityListenerManager.INSTANCE.invokeOnLimitingVelocityChange(speedLimit);
|
CallLimitingVelocityListenerManager.INSTANCE.invokeOnLimitingVelocityChange(speedLimit);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package com.mogo.eagle.function.biz.v2x.speedlimit
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import com.mogo.eagle.core.function.api.v2x.LimitingVelocityListener
|
||||||
|
import com.mogo.eagle.core.function.api.v2x.ObuLimitingSpeedListener
|
||||||
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
||||||
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||||
|
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||||
|
import com.mogo.eagle.core.function.call.v2x.CallLimitingVelocityListenerManager
|
||||||
|
import com.mogo.eagle.core.function.call.v2x.CallObuLimitingSpeedListenerManager
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lixiaopeng
|
||||||
|
* @description 对多个限速进行调度(map,rsu ...)
|
||||||
|
* @since: 2023/1/12
|
||||||
|
*/
|
||||||
|
class SpeedLimitDispatcher : LimitingVelocityListener, ObuLimitingSpeedListener {
|
||||||
|
companion object {
|
||||||
|
const val TAG = "SpeedLimitDispatcher"
|
||||||
|
val INSTANCE: SpeedLimitDispatcher by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||||
|
SpeedLimitDispatcher()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private var mContext: Context? = null
|
||||||
|
|
||||||
|
//是否有AI获取红绿灯灯态
|
||||||
|
private var hasObuStatus: Boolean = false
|
||||||
|
|
||||||
|
|
||||||
|
fun initLimit(context: Context) {
|
||||||
|
mContext = context
|
||||||
|
//注册监听MAP的限速
|
||||||
|
CallLimitingVelocityListenerManager.addListener(TAG, this)
|
||||||
|
//注册监听OBU的限速
|
||||||
|
CallObuLimitingSpeedListenerManager.addListener(TAG, this)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地图限速数据
|
||||||
|
*/
|
||||||
|
override fun onLimitingVelocityChange(limitingVelocity: Int) {
|
||||||
|
// CallerHmiManager.disableLimitingVelocity()
|
||||||
|
if (!hasObuStatus) {
|
||||||
|
CallerHmiManager.showLimitingVelocity(limitingVelocity, 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* obu限速
|
||||||
|
*/
|
||||||
|
override fun onObuLimitingSpeedChange(limitingSpeed: Int) {
|
||||||
|
// CallerHmiManager.disableLimitingVelocity()
|
||||||
|
if (limitingSpeed > 0) {
|
||||||
|
hasObuStatus = true
|
||||||
|
CallerHmiManager.showLimitingVelocity(limitingSpeed, 2)
|
||||||
|
} else {
|
||||||
|
hasObuStatus = false
|
||||||
|
CallerHmiManager.disableLimitingVelocity()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun destroy() {
|
||||||
|
//取消注册监听AI云获取红绿灯状态
|
||||||
|
CallerTrafficLightListenerManager.removeListener(TAG)
|
||||||
|
//取消注册监听工控机感知红绿灯
|
||||||
|
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mogo.eagle.core.function.v2x.trafficlight
|
package com.mogo.eagle.function.biz.v2x.trafficlight
|
||||||
|
|
||||||
class TrafficLightConst {
|
class TrafficLightConst {
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mogo.eagle.core.function.v2x.trafficlight
|
package com.mogo.eagle.function.biz.v2x.trafficlight
|
||||||
|
|
||||||
import com.mogo.eagle.core.data.trafficlight.*
|
import com.mogo.eagle.core.data.trafficlight.*
|
||||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mogo.eagle.core.function.v2x.trafficlight.core
|
package com.mogo.eagle.function.biz.v2x.trafficlight.core
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
@@ -8,12 +8,12 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Liste
|
|||||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||||
import com.mogo.eagle.core.function.v2x.trafficlight.TrafficLightHMIManager
|
import com.mogo.eagle.function.biz.v2x.trafficlight.TrafficLightHMIManager
|
||||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_LOOP_SEARCH_CROSS_ROAD
|
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_LOOP_SEARCH_CROSS_ROAD
|
||||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_LOOP_SEARCH_TRAFFIC_LIGHT
|
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_LOOP_SEARCH_TRAFFIC_LIGHT
|
||||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_CROSS_ROAD
|
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_CROSS_ROAD
|
||||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_TRAFFIC_LIGHT
|
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_TRAFFIC_LIGHT
|
||||||
import com.mogo.eagle.core.function.v2x.trafficlight.network.TrafficLightNetWorkModel
|
import com.mogo.eagle.function.biz.v2x.trafficlight.network.TrafficLightNetWorkModel
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||||
import mogo.telematics.pad.MessagePad
|
import mogo.telematics.pad.MessagePad
|
||||||
@@ -0,0 +1,166 @@
|
|||||||
|
package com.mogo.eagle.function.biz.v2x.trafficlight.core
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.os.Handler
|
||||||
|
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
|
||||||
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
||||||
|
import com.mogo.eagle.core.function.api.obu.IMoGoObuTrafficLightListener
|
||||||
|
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
||||||
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
||||||
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||||
|
import com.mogo.eagle.core.function.call.obu.CallerObuTrafficLightListenerManager
|
||||||
|
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||||
|
import com.mogo.eagle.function.biz.v2x.trafficlight.TrafficLightHMIManager
|
||||||
|
import perception.TrafficLightOuterClass
|
||||||
|
import perception.TrafficLightOuterClass.TrafficLight
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author XuXinChao
|
||||||
|
* @description 对多个红绿灯信号来源进行统一调度(AI云、工控机)
|
||||||
|
* @since: 2022/4/28
|
||||||
|
*/
|
||||||
|
class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLightListener,
|
||||||
|
IMoGoObuTrafficLightListener {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val TAG = "TrafficLightDispatcher"
|
||||||
|
val INSTANCE: TrafficLightDispatcher by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||||
|
TrafficLightDispatcher()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private var mContext: Context? = null
|
||||||
|
|
||||||
|
//是否有AI获取红绿灯灯态
|
||||||
|
private var hasAiLightStatus: Boolean = false
|
||||||
|
//obu数据
|
||||||
|
private var hasObuLightStatus: Boolean = false
|
||||||
|
|
||||||
|
fun initServer(context: Context) {
|
||||||
|
mContext = context
|
||||||
|
//注册监听AI云获取红绿灯状态
|
||||||
|
CallerTrafficLightListenerManager.addListener(TAG, this)
|
||||||
|
//注册监听AI云进入路口
|
||||||
|
CallerTrafficLightListenerManager.addListener(TAG, this)
|
||||||
|
//注册监听红绿灯请求失败
|
||||||
|
CallerTrafficLightListenerManager.addListener(TAG, this)
|
||||||
|
//注册监听工控机感知红绿灯
|
||||||
|
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
|
||||||
|
//obu红绿灯数据
|
||||||
|
CallerObuTrafficLightListenerManager.addListener(TAG, this)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工控机感知红绿灯
|
||||||
|
* @param trafficLights 感知红绿灯
|
||||||
|
*/
|
||||||
|
override fun onAutopilotPerceptionTrafficLight(trafficLights: TrafficLightOuterClass.TrafficLights?) {
|
||||||
|
if (!hasObuLightStatus) {
|
||||||
|
if (!hasAiLightStatus) {
|
||||||
|
trafficLights?.let { it ->
|
||||||
|
var light: TrafficLight? = null
|
||||||
|
if (it.hasStraight()) {
|
||||||
|
light = it.straight
|
||||||
|
} else if (it.hasLeft()) {
|
||||||
|
light = it.left
|
||||||
|
} else if (it.hasRight()) {
|
||||||
|
light = it.right
|
||||||
|
} else if (it.hasUTurn()) {
|
||||||
|
light = it.uTurn
|
||||||
|
}
|
||||||
|
if (light == null) {
|
||||||
|
//隐藏红绿灯显示
|
||||||
|
TrafficLightHMIManager.INSTANCE.hideTrafficLight()
|
||||||
|
} else {
|
||||||
|
when (light.state) {
|
||||||
|
TrafficLightOuterClass.LightState.STATE_RED -> {
|
||||||
|
//红灯
|
||||||
|
CallerHmiManager.showWarningTrafficLight(1, 2)
|
||||||
|
CallerHmiManager.changeCountdownGreen(0)
|
||||||
|
}
|
||||||
|
TrafficLightOuterClass.LightState.STATE_YELLOW -> {
|
||||||
|
//黄灯
|
||||||
|
CallerHmiManager.showWarningTrafficLight(2, 2)
|
||||||
|
CallerHmiManager.changeCountdownGreen(0)
|
||||||
|
}
|
||||||
|
TrafficLightOuterClass.LightState.STATE_GREEN -> {
|
||||||
|
//绿灯
|
||||||
|
CallerHmiManager.showWarningTrafficLight(3, 2)
|
||||||
|
CallerHmiManager.changeCountdownGreen(0)
|
||||||
|
}
|
||||||
|
TrafficLightOuterClass.LightState.STATE_OFF -> {
|
||||||
|
//黑灯,隐藏红绿灯显示
|
||||||
|
TrafficLightHMIManager.INSTANCE.hideTrafficLight()
|
||||||
|
}
|
||||||
|
else -> {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AI云获取红绿灯状态
|
||||||
|
*/
|
||||||
|
override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) {
|
||||||
|
if (!hasObuLightStatus) {
|
||||||
|
TrafficLightHMIManager.INSTANCE.updateTrafficLight(trafficLightResult)
|
||||||
|
hasAiLightStatus = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆进入路口回调
|
||||||
|
* @param enter true:进入路口;false:离开路口
|
||||||
|
*/
|
||||||
|
override fun onEnterCrossRoad(enter: Boolean) {
|
||||||
|
if (!enter) {
|
||||||
|
Handler().postDelayed({
|
||||||
|
hasAiLightStatus = false
|
||||||
|
hasObuLightStatus = false
|
||||||
|
}, 5000)
|
||||||
|
CallerTrafficLightListenerManager.resetTrafficLightData()
|
||||||
|
//如果没有OBU灯态则进行隐藏,如果有OBU灯态,则交由OBU管理
|
||||||
|
if(!hasObuLightStatus){
|
||||||
|
TrafficLightHMIManager.INSTANCE.hideTrafficLight()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 红绿灯接口请求失败
|
||||||
|
*/
|
||||||
|
override fun onTrafficRequestError() {
|
||||||
|
hasAiLightStatus = false
|
||||||
|
CallerTrafficLightListenerManager.resetTrafficLightData()
|
||||||
|
if(!hasObuLightStatus){
|
||||||
|
if (TrafficLightHMIManager.INSTANCE.isWarningTrafficLightShow()) {
|
||||||
|
TrafficLightHMIManager.INSTANCE.hideTrafficLight()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* obu 红绿灯数据
|
||||||
|
*/
|
||||||
|
override fun onObuTrafficLight(light: Int) {
|
||||||
|
super.onObuTrafficLight(light)
|
||||||
|
hasObuLightStatus = true
|
||||||
|
CallerHmiManager.showWarningTrafficLight(light, 3)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun destroy() {
|
||||||
|
//取消注册监听AI云获取红绿灯状态
|
||||||
|
CallerTrafficLightListenerManager.removeListener(TAG)
|
||||||
|
//取消注册监听工控机感知红绿灯
|
||||||
|
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
|
||||||
|
//取消注册监听红绿灯请求失败
|
||||||
|
CallerTrafficLightListenerManager.removeListener(TAG)
|
||||||
|
//取消注册监听AI云进入路口
|
||||||
|
CallerTrafficLightListenerManager.removeListener(TAG)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mogo.eagle.core.function.v2x.trafficlight.core
|
package com.mogo.eagle.function.biz.v2x.trafficlight.core
|
||||||
|
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
import android.os.Looper
|
import android.os.Looper
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mogo.eagle.core.function.v2x.trafficlight.network
|
package com.mogo.eagle.function.biz.v2x.trafficlight.network
|
||||||
|
|
||||||
import com.mogo.eagle.core.data.BaseResponse
|
import com.mogo.eagle.core.data.BaseResponse
|
||||||
import com.mogo.eagle.core.data.trafficlight.RoadIDResult
|
import com.mogo.eagle.core.data.trafficlight.RoadIDResult
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mogo.eagle.core.function.v2x.trafficlight.network
|
package com.mogo.eagle.function.biz.v2x.trafficlight.network
|
||||||
|
|
||||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||||
import com.mogo.eagle.core.data.BaseResponse
|
import com.mogo.eagle.core.data.BaseResponse
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mogo.eagle.core.function.v2x.vip
|
package com.mogo.eagle.function.biz.v2x.vip
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
@@ -21,17 +21,17 @@ import com.mogo.eagle.core.data.trafficlight.isRed
|
|||||||
import com.mogo.eagle.core.data.v2x.VipMessage
|
import com.mogo.eagle.core.data.v2x.VipMessage
|
||||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||||
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
||||||
|
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
|
||||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||||
import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager
|
import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager
|
||||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.MogoTrafficLightManager
|
|
||||||
import com.mogo.eagle.core.function.v2x.vip.network.VipNetWorkModel
|
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||||
|
import com.mogo.eagle.function.biz.v2x.trafficlight.core.MogoTrafficLightManager
|
||||||
|
import com.mogo.eagle.function.biz.v2x.vip.network.VipNetWorkModel
|
||||||
import com.zhjt.service_biz.BizConfig
|
import com.zhjt.service_biz.BizConfig
|
||||||
|
|
||||||
class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListener,
|
class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListener,
|
||||||
@@ -156,7 +156,6 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
|||||||
MSG_WHAT_VIP_CANCEL,
|
MSG_WHAT_VIP_CANCEL,
|
||||||
cancelDelayTime - System.currentTimeMillis()
|
cancelDelayTime - System.currentTimeMillis()
|
||||||
)
|
)
|
||||||
CallerHmiManager.vipIdentification(true)
|
|
||||||
CallVipSetListenerManager.invokeVipSetStatus(true)
|
CallVipSetListenerManager.invokeVipSetStatus(true)
|
||||||
CallerTrafficLightListenerManager.addListener(TAG, this)
|
CallerTrafficLightListenerManager.addListener(TAG, this)
|
||||||
}
|
}
|
||||||
@@ -167,7 +166,6 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
|||||||
handler.removeMessages(MSG_WHAT_VIP_CANCEL)
|
handler.removeMessages(MSG_WHAT_VIP_CANCEL)
|
||||||
}
|
}
|
||||||
resetConditions()
|
resetConditions()
|
||||||
CallerHmiManager.vipIdentification(false)
|
|
||||||
CallVipSetListenerManager.invokeVipSetStatus(false)
|
CallVipSetListenerManager.invokeVipSetStatus(false)
|
||||||
CallerTrafficLightListenerManager.removeListener(TAG)
|
CallerTrafficLightListenerManager.removeListener(TAG)
|
||||||
}
|
}
|
||||||
@@ -197,9 +195,9 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
|||||||
|
|
||||||
fun turnLight(controlTime: Int) {
|
fun turnLight(controlTime: Int) {
|
||||||
if (result == null || mContext == null) return
|
if (result == null || mContext == null) return
|
||||||
val mogoLocation = CallerMapLocationListenerManager.getCurrentLocation()
|
val mogoLocation = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||||
if (mogoLocation != null) {
|
if (mogoLocation != null) {
|
||||||
val bearing = mogoLocation.bearing.toDouble()
|
val bearing = mogoLocation.heading
|
||||||
CallerLogger.d("$M_V2X$TAG", "-- turnLight -- ")
|
CallerLogger.d("$M_V2X$TAG", "-- turnLight -- ")
|
||||||
MogoTrafficLightManager.INSTANCE.turnLightToGreen(
|
MogoTrafficLightManager.INSTANCE.turnLightToGreen(
|
||||||
result!!.lightId, result!!.crossId, bearing, controlTime,
|
result!!.lightId, result!!.crossId, bearing, controlTime,
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mogo.eagle.core.function.v2x.vip.network
|
package com.mogo.eagle.function.biz.v2x.vip.network
|
||||||
|
|
||||||
import com.mogo.eagle.core.data.BaseResponse
|
import com.mogo.eagle.core.data.BaseResponse
|
||||||
import com.mogo.eagle.core.data.v2x.VipRequest
|
import com.mogo.eagle.core.data.v2x.VipRequest
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mogo.eagle.core.function.v2x.vip.network
|
package com.mogo.eagle.function.biz.v2x.vip.network
|
||||||
|
|
||||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||||
import com.mogo.eagle.core.data.BaseResponse
|
import com.mogo.eagle.core.data.BaseResponse
|
||||||
@@ -15,7 +15,7 @@ import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_DEFAULT
|
|||||||
import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_VEHICLE_TEAM
|
import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_VEHICLE_TEAM
|
||||||
import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_VOICE
|
import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_VOICE
|
||||||
import com.mogo.eagle.core.function.api.chat.biz.IMType.*
|
import com.mogo.eagle.core.function.api.chat.biz.IMType.*
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||||
import com.mogo.eagle.core.function.chat.facade.analytics.ChatAnalyticsFacade
|
import com.mogo.eagle.core.function.chat.facade.analytics.ChatAnalyticsFacade
|
||||||
import com.mogo.eagle.core.function.chat.facade.audio.AudioFocusFacade
|
import com.mogo.eagle.core.function.chat.facade.audio.AudioFocusFacade
|
||||||
import com.mogo.eagle.core.function.chat.facade.bridge.BridgeApi
|
import com.mogo.eagle.core.function.chat.facade.bridge.BridgeApi
|
||||||
@@ -581,7 +581,7 @@ object MoGoChatFacade: IMoGoChatFacade {
|
|||||||
}
|
}
|
||||||
//告之服务器给发送方下发接收通话消息
|
//告之服务器给发送方下发接收通话消息
|
||||||
try {
|
try {
|
||||||
val location = CallerMapLocationListenerManager.getCurrentLocation()
|
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||||
val response = serverApi.requestConnectStatus(ConnectStatusParam(MoGoAiCloudClientConfig.getInstance().sn, sn, roomId, PUSH_MSG_AGREE_ENTER, CALL_TYPE_VOICE.type).also {
|
val response = serverApi.requestConnectStatus(ConnectStatusParam(MoGoAiCloudClientConfig.getInstance().sn, sn, roomId, PUSH_MSG_AGREE_ENTER, CALL_TYPE_VOICE.type).also {
|
||||||
it.nickName = mySelf.get().name
|
it.nickName = mySelf.get().name
|
||||||
it.headImgUrl = mySelf.get().icon
|
it.headImgUrl = mySelf.get().icon
|
||||||
@@ -812,7 +812,7 @@ object MoGoChatFacade: IMoGoChatFacade {
|
|||||||
}
|
}
|
||||||
val response = serverApi.inviteJoinVehicleTeam(CallRequestParam().also {
|
val response = serverApi.inviteJoinVehicleTeam(CallRequestParam().also {
|
||||||
val user = mySelf.get()
|
val user = mySelf.get()
|
||||||
val location = CallerMapLocationListenerManager.getCurrentLocation()
|
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||||
it.snSender = mySn
|
it.snSender = mySn
|
||||||
it.snReceiver = sn
|
it.snReceiver = sn
|
||||||
it.nickName = user.name
|
it.nickName = user.name
|
||||||
@@ -958,7 +958,7 @@ object MoGoChatFacade: IMoGoChatFacade {
|
|||||||
}
|
}
|
||||||
//告之服务器给发送方下发接收通话消息
|
//告之服务器给发送方下发接收通话消息
|
||||||
try {
|
try {
|
||||||
val location = CallerMapLocationListenerManager.getCurrentLocation()
|
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||||
val response = serverApi.requestConnectStatus(ConnectStatusParam(MoGoAiCloudClientConfig.getInstance().sn, sn, roomId, PUSH_MSG_AGREE_ENTER, CALL_TYPE_VEHICLE_TEAM.type).also {
|
val response = serverApi.requestConnectStatus(ConnectStatusParam(MoGoAiCloudClientConfig.getInstance().sn, sn, roomId, PUSH_MSG_AGREE_ENTER, CALL_TYPE_VEHICLE_TEAM.type).also {
|
||||||
it.nickName = mySelf.get().name
|
it.nickName = mySelf.get().name
|
||||||
it.headImgUrl = mySelf.get().icon
|
it.headImgUrl = mySelf.get().icon
|
||||||
|
|||||||
@@ -3,13 +3,12 @@ package com.mogo.eagle.core.function.chat.facade.net
|
|||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import com.google.gson.JsonObject
|
import com.google.gson.JsonObject
|
||||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||||
|
import com.mogo.commons.constants.HostConst
|
||||||
import com.mogo.eagle.core.data.BaseResponse
|
import com.mogo.eagle.core.data.BaseResponse
|
||||||
import com.mogo.eagle.core.data.chat.UserInfo
|
import com.mogo.eagle.core.data.chat.UserInfo
|
||||||
import com.mogo.eagle.core.function.api.chat.biz.ChatConsts
|
import com.mogo.eagle.core.function.api.chat.biz.ChatConsts
|
||||||
import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_VOICE
|
import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_VOICE
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||||
import com.mogo.eagle.core.function.chat.facade.consts.ChatHttp
|
|
||||||
import com.mogo.eagle.core.function.chat.facade.consts.ChatHttp.Companion.getConfig
|
|
||||||
import com.mogo.eagle.core.function.chat.facade.net.bean.*
|
import com.mogo.eagle.core.function.chat.facade.net.bean.*
|
||||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||||
@@ -33,7 +32,7 @@ internal class ChatServiceModel {
|
|||||||
val sns = arrayListOf(sn)
|
val sns = arrayListOf(sn)
|
||||||
val requestData = SnArrayRequestBody().also { it.sns = sns }
|
val requestData = SnArrayRequestBody().also { it.sns = sns }
|
||||||
return apiCall {
|
return apiCall {
|
||||||
getNetWorkApi(getConfig())?.queryUserInfoBySnS(requestData)
|
getNetWorkApi()?.queryUserInfoBySnS(requestData)
|
||||||
?: throw IllegalStateException("apis is null.")
|
?: throw IllegalStateException("apis is null.")
|
||||||
}.let { itx ->
|
}.let { itx ->
|
||||||
if (itx.code != 0 && itx.code != 200) {
|
if (itx.code != 0 && itx.code != 200) {
|
||||||
@@ -70,7 +69,7 @@ internal class ChatServiceModel {
|
|||||||
val map = hashMapOf<String, String>()
|
val map = hashMapOf<String, String>()
|
||||||
val sn = MoGoAiCloudClientConfig.getInstance().sn
|
val sn = MoGoAiCloudClientConfig.getInstance().sn
|
||||||
|
|
||||||
val location = CallerMapLocationListenerManager.getCurrentLocation()
|
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||||
if (location != null) {
|
if (location != null) {
|
||||||
params.lon = location.longitude
|
params.lon = location.longitude
|
||||||
params.lat = location.latitude
|
params.lat = location.latitude
|
||||||
@@ -104,7 +103,7 @@ internal class ChatServiceModel {
|
|||||||
|
|
||||||
suspend fun requestRoomInfo(param: CallRequestParam): BaseResponse<RoomInfo> {
|
suspend fun requestRoomInfo(param: CallRequestParam): BaseResponse<RoomInfo> {
|
||||||
val map = hashMapOf<String, String>()
|
val map = hashMapOf<String, String>()
|
||||||
val location = CallerMapLocationListenerManager.getCurrentLocation()
|
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||||
if (location != null) {
|
if (location != null) {
|
||||||
param.lat = location.latitude
|
param.lat = location.latitude
|
||||||
param.lon = location.longitude
|
param.lon = location.longitude
|
||||||
@@ -120,7 +119,7 @@ internal class ChatServiceModel {
|
|||||||
return call.invoke()
|
return call.invoke()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getNetWorkApi(baseUrl: String = ChatHttp.getBaseUrl()): HttpApi? {
|
private fun getNetWorkApi(baseUrl: String = HostConst.getEagleHost()): HttpApi? {
|
||||||
return MoGoRetrofitFactory.getInstanceNoCallAdapter(baseUrl).create(HttpApi::class.java)
|
return MoGoRetrofitFactory.getInstanceNoCallAdapter(baseUrl).create(HttpApi::class.java)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -128,7 +127,7 @@ internal class ChatServiceModel {
|
|||||||
internal interface HttpApi {
|
internal interface HttpApi {
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST("/yycp-chat-service/car/voiceRoom/no/operate/v1")
|
@POST("eagle-eye-dns/yycp-chat-service/car/voiceRoom/no/operate/v1")
|
||||||
suspend fun requestConnectStatus(
|
suspend fun requestConnectStatus(
|
||||||
@Query("sn") sn: String,
|
@Query("sn") sn: String,
|
||||||
@FieldMap connectStatus: Map<String, String>
|
@FieldMap connectStatus: Map<String, String>
|
||||||
@@ -136,24 +135,24 @@ internal interface HttpApi {
|
|||||||
|
|
||||||
//邀请加入车队
|
//邀请加入车队
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST("/yycp-chat-service/car/chat/no/inviteJoinTeam/v1")
|
@POST("eagle-eye-dns/yycp-chat-service/car/chat/no/inviteJoinTeam/v1")
|
||||||
suspend fun inviteJoinVehicleTeam(@FieldMap inviteVehicleTeam: Map<String, String>): BaseResponse<Any>
|
suspend fun inviteJoinVehicleTeam(@FieldMap inviteVehicleTeam: Map<String, String>): BaseResponse<Any>
|
||||||
|
|
||||||
//车队状态同步
|
//车队状态同步
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST("/yycp-chat-service/car/chat/no/operateTeamRoom/v1")
|
@POST("eagle-eye-dns/yycp-chat-service/car/chat/no/operateTeamRoom/v1")
|
||||||
suspend fun requestVehicleTeamConnectStatus(@FieldMap connectStatus: Map<String, String>): BaseResponse<Any>
|
suspend fun requestVehicleTeamConnectStatus(@FieldMap connectStatus: Map<String, String>): BaseResponse<Any>
|
||||||
|
|
||||||
//查询用户是否在线
|
//查询用户是否在线
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST("/yycp-chat-service/car/queryOnLineBySn/v1")
|
@POST("eagle-eye-dns/yycp-chat-service/car/queryOnLineBySn/v1")
|
||||||
suspend fun isOnLine(@FieldMap onLine: Map<String, String>): BaseResponse<OnLineStatus>
|
suspend fun isOnLine(@FieldMap onLine: Map<String, String>): BaseResponse<OnLineStatus>
|
||||||
|
|
||||||
@POST("/yycp-realtimeLocations/realTimeLocationServer/queryRsAncCarAndUserInfoBySns")
|
@POST("eagle-eye-dns/yycp-realtimeLocations/realTimeLocationServer/queryRsAncCarAndUserInfoBySns")
|
||||||
suspend fun queryUserInfoBySnS(@Body body: SnArrayRequestBody): BaseResponse<JsonObject>
|
suspend fun queryUserInfoBySnS(@Body body: SnArrayRequestBody): BaseResponse<JsonObject>
|
||||||
|
|
||||||
//语音房间信息,原路径dataService
|
//语音房间信息,原路径dataService
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST("/yycp-chat-service/car/sender/no/createRoom/v1")
|
@POST("eagle-eye-dns/yycp-chat-service/car/sender/no/createRoom/v1")
|
||||||
suspend fun requestRoomInfo(@FieldMap roomInfo: Map<String, String>): BaseResponse<RoomInfo>
|
suspend fun requestRoomInfo(@FieldMap roomInfo: Map<String, String>): BaseResponse<RoomInfo>
|
||||||
}
|
}
|
||||||
@@ -51,6 +51,8 @@ import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListener
|
|||||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager.invokeAutopilotRotting
|
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager.invokeAutopilotRotting
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningTrajectoryListenerManager.invokeAutopilotTrajectory
|
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningTrajectoryListenerManager.invokeAutopilotTrajectory
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerStartAutopilotFailedListenerManager.invokeStartAutopilotFailed
|
import com.mogo.eagle.core.function.call.autopilot.CallerStartAutopilotFailedListenerManager.invokeStartAutopilotFailed
|
||||||
|
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||||
|
import com.mogo.eagle.core.function.call.obucombine.CallerObuDcCombineListenerManager
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||||
import com.zhidao.support.adas.high.AdasManager
|
import com.zhidao.support.adas.high.AdasManager
|
||||||
@@ -63,6 +65,7 @@ import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD
|
|||||||
import function_state_management.FunctionStates
|
import function_state_management.FunctionStates
|
||||||
import mogo.telematics.pad.MessagePad
|
import mogo.telematics.pad.MessagePad
|
||||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||||
|
import mogo.v2x.ObuWarningEvent
|
||||||
import mogo_msg.MogoReportMsg
|
import mogo_msg.MogoReportMsg
|
||||||
import perception.TrafficLightOuterClass
|
import perception.TrafficLightOuterClass
|
||||||
import planning.RoboSweeperTaskIndexOuterClass
|
import planning.RoboSweeperTaskIndexOuterClass
|
||||||
@@ -524,6 +527,16 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OBU预警事件
|
||||||
|
*
|
||||||
|
* @param header 头
|
||||||
|
* @param obuWarningData 数据
|
||||||
|
*/
|
||||||
|
override fun onObuWarningData(header: MessagePad.Header?, obuWarningData: ObuWarningEvent.ObuWarningData?) {
|
||||||
|
CallerObuDcCombineListenerManager.invokeObuDcData(obuWarningData)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重构后的功能状态
|
* 重构后的功能状态
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.mogo.eagle.core.function.msgbox
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.Looper
|
import android.os.Looper
|
||||||
import com.mogo.eagle.core.data.msgbox.*
|
import com.mogo.eagle.core.data.msgbox.*
|
||||||
import com.mogo.eagle.core.data.notice.NoticeNormalData
|
|
||||||
import com.mogo.eagle.core.data.report.ReportEntity
|
import com.mogo.eagle.core.data.report.ReportEntity
|
||||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
|
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
|
||||||
import com.mogo.eagle.core.function.msgbox.db.MsgBoxDb
|
import com.mogo.eagle.core.function.msgbox.db.MsgBoxDb
|
||||||
|
|||||||
@@ -11,10 +11,19 @@ import androidx.lifecycle.LifecycleCoroutineScope
|
|||||||
import androidx.lifecycle.LifecycleEventObserver
|
import androidx.lifecycle.LifecycleEventObserver
|
||||||
import androidx.lifecycle.LifecycleOwner
|
import androidx.lifecycle.LifecycleOwner
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
|
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||||
|
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||||
|
import com.mogo.eagle.core.data.msgbox.RecordBagMsg
|
||||||
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||||
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||||
|
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||||
import com.mogo.eagle.core.utilcode.kotlin.lifecycleOwner
|
import com.mogo.eagle.core.utilcode.kotlin.lifecycleOwner
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||||
import com.mogo.eagle.core.utilcode.util.*
|
import com.mogo.eagle.core.utilcode.util.*
|
||||||
import com.zhjt.mogo_core_function_devatools.badcase.biz.*
|
import com.zhjt.mogo_core_function_devatools.badcase.biz.*
|
||||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||||
@@ -27,7 +36,7 @@ import record_cache.RecordPanelOuterClass
|
|||||||
import java.lang.ref.WeakReference
|
import java.lang.ref.WeakReference
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
internal object BadCaseManager : LifecycleEventObserver {
|
internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordListener {
|
||||||
|
|
||||||
const val TAG = "BadCase"
|
const val TAG = "BadCase"
|
||||||
|
|
||||||
@@ -96,6 +105,8 @@ internal object BadCaseManager : LifecycleEventObserver {
|
|||||||
* 主动采集BadCase
|
* 主动采集BadCase
|
||||||
*/
|
*/
|
||||||
fun initBadCase(view: View) {
|
fun initBadCase(view: View) {
|
||||||
|
CallerAutopilotRecordListenerManager.addListener(TAG, this)
|
||||||
|
|
||||||
val activity = view.context as? FragmentActivity
|
val activity = view.context as? FragmentActivity
|
||||||
?: throw IllegalStateException("please ensure context is FragmentActivity.")
|
?: throw IllegalStateException("please ensure context is FragmentActivity.")
|
||||||
view.setOnClickListener {
|
view.setOnClickListener {
|
||||||
@@ -193,24 +204,62 @@ internal object BadCaseManager : LifecycleEventObserver {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) {
|
||||||
|
super.onAutopilotRecordResult(recordPanel)
|
||||||
|
CallerLogger.d("$M_DEVA$TAG", "recordKey=${recordPanel.key},stat=${recordPanel.stat}")
|
||||||
|
if (BadCaseConfig.recordKeyList.contains(recordPanel.key)) {
|
||||||
|
if (recordPanel.stat == 100 || recordPanel.stat == 101) {
|
||||||
|
//成功结束录制
|
||||||
|
TipToast.shortTip(
|
||||||
|
"${
|
||||||
|
TimeUtils.millis2String(
|
||||||
|
System.currentTimeMillis(),
|
||||||
|
TimeUtils.getHourMinSecondFormat()
|
||||||
|
)
|
||||||
|
} bag录制成功"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (recordPanel.stat == 200) {
|
||||||
|
//录制失败
|
||||||
|
TipToast.shortTip(
|
||||||
|
"${
|
||||||
|
TimeUtils.millis2String(
|
||||||
|
System.currentTimeMillis(),
|
||||||
|
TimeUtils.getHourMinSecondFormat()
|
||||||
|
)
|
||||||
|
} bag录制失败"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//在工控机taxi2.3.0版本和Bus2.4.0版本上不支持被动录包,不进行被动录包的弹窗
|
||||||
|
BadCaseConfig.dockerVersion?.let {
|
||||||
|
if (it.contains("taxi") && it.contains("2.3.0")) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (it.contains("bus") && it.contains("2.4.0")) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//处于非美化模式下弹窗;是地图数据采集任务时即type=2时,不弹窗
|
||||||
|
if (!FunctionBuildConfig.isDemoMode && (recordPanel.stat == 100 || recordPanel.stat == 101) && recordPanel.type != 2) {
|
||||||
|
//只在司机屏生效,乘客屏不生效
|
||||||
|
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||||
|
CallerMsgBoxManager.saveMsgBox(
|
||||||
|
MsgBoxBean(
|
||||||
|
MsgBoxType.RECORD, RecordBagMsg(
|
||||||
|
recordPanel.key, recordPanel.stat, recordPanel.id,
|
||||||
|
recordPanel.type, recordPanel.filename, recordPanel.note
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun onStateChanged(source: LifecycleOwner, event: Event) {
|
override fun onStateChanged(source: LifecycleOwner, event: Event) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
internal fun RecordPanelOuterClass.RecordPanel.toRecord(): AutoPilotRecord =
|
|
||||||
AutoPilotRecord().also {
|
|
||||||
it.id = this.id
|
|
||||||
it.stat = this.stat
|
|
||||||
it.key = this.key.toString()
|
|
||||||
it.note = this.note
|
|
||||||
it.type = this.type
|
|
||||||
it.total = this.totalSize
|
|
||||||
it.fileName = this.filename
|
|
||||||
it.duration = this.duration.toDouble()
|
|
||||||
it.diskFree = this.diskFree
|
|
||||||
it.consumed = false
|
|
||||||
}
|
|
||||||
@@ -373,6 +373,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
|||||||
|
|
||||||
override fun onAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) {
|
override fun onAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) {
|
||||||
CallerLogger.d("${M_DEVA}${TAG}", "-- 收到工控机录制任务回调 -- $recordPanel")
|
CallerLogger.d("${M_DEVA}${TAG}", "-- 收到工控机录制任务回调 -- $recordPanel")
|
||||||
|
|
||||||
ThreadUtils.runOnUiThread {
|
ThreadUtils.runOnUiThread {
|
||||||
if (recordKey == null) {
|
if (recordKey == null) {
|
||||||
recordKey = recordPanel.key.toString()
|
recordKey = recordPanel.key.toString()
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
package com.zhjt.mogo_core_function_devatools.badcase.consts
|
|
||||||
|
|
||||||
import com.mogo.commons.debug.DebugConfig
|
|
||||||
|
|
||||||
internal object BadCaseHost {
|
|
||||||
|
|
||||||
private const val HOST_DEV = "http://dzt-test.zhidaozhixing.com/"
|
|
||||||
private const val HOST_RELEASE = "http://dzt.zhidaozhixing.com/"
|
|
||||||
|
|
||||||
fun getHost(): String{
|
|
||||||
return when (DebugConfig.getNetMode()) {
|
|
||||||
DebugConfig.NET_MODE_DEV -> HOST_DEV
|
|
||||||
DebugConfig.NET_MODE_QA -> HOST_DEV
|
|
||||||
DebugConfig.NET_MODE_DEMO -> HOST_RELEASE
|
|
||||||
DebugConfig.NET_MODE_RELEASE -> HOST_RELEASE
|
|
||||||
else -> HOST_RELEASE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
package com.zhjt.mogo_core_function_devatools.badcase.repository.net
|
package com.zhjt.mogo_core_function_devatools.badcase.repository.net
|
||||||
|
|
||||||
|
import com.mogo.commons.constants.HostConst
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||||
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseManager
|
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseManager
|
||||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.BadCaseApi
|
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.BadCaseApi
|
||||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.entity.UploadResult
|
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.entity.UploadResult
|
||||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseHost
|
|
||||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.entity.BadCaseResponse.Reason
|
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.entity.BadCaseResponse.Reason
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import kotlin.coroutines.coroutineContext
|
import kotlin.coroutines.coroutineContext
|
||||||
@@ -16,7 +16,7 @@ internal class BadCaseNetModel {
|
|||||||
suspend fun get(channel: String?, result: MutableList<Reason>, pageNo: Int) {
|
suspend fun get(channel: String?, result: MutableList<Reason>, pageNo: Int) {
|
||||||
try {
|
try {
|
||||||
MoGoRetrofitFactory
|
MoGoRetrofitFactory
|
||||||
.getInstance(BadCaseHost.getHost())
|
.getInstance(HostConst.getEagleHost())
|
||||||
.create(BadCaseApi::class.java)
|
.create(BadCaseApi::class.java)
|
||||||
.get(channel ?: "", pageNo)
|
.get(channel ?: "", pageNo)
|
||||||
.takeIf {
|
.takeIf {
|
||||||
@@ -42,7 +42,7 @@ internal class BadCaseNetModel {
|
|||||||
suspend fun upload(map: Map<String, String>): UploadResult? = try {
|
suspend fun upload(map: Map<String, String>): UploadResult? = try {
|
||||||
CallerLogger.d("$M_DEVA${BadCaseManager.TAG}", "upload_params:$map")
|
CallerLogger.d("$M_DEVA${BadCaseManager.TAG}", "upload_params:$map")
|
||||||
MoGoRetrofitFactory
|
MoGoRetrofitFactory
|
||||||
.getInstance(BadCaseHost.getHost())
|
.getInstance(HostConst.getEagleHost() )
|
||||||
.create(BadCaseApi::class.java)
|
.create(BadCaseApi::class.java)
|
||||||
.post(map)
|
.post(map)
|
||||||
.takeIf {
|
.takeIf {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class V2XLimitingVelocityBroadcastReceiver : BroadcastReceiver() {
|
|||||||
* @param limitingVelocitySpeed 限速速度
|
* @param limitingVelocitySpeed 限速速度
|
||||||
*/
|
*/
|
||||||
private fun dispatchShowWaring(limitingVelocitySpeed: Int) {
|
private fun dispatchShowWaring(limitingVelocitySpeed: Int) {
|
||||||
CallerHmiManager.showLimitingVelocity(limitingVelocitySpeed)
|
CallerHmiManager.showLimitingVelocity(limitingVelocitySpeed, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class V2XWarningBroadcastReceiver : BroadcastReceiver() {
|
|||||||
tag: String?
|
tag: String?
|
||||||
) {
|
) {
|
||||||
if (EventTypeEnum.TYPE_USECASE_ID_IVP.poiType == v2xType.toString()) {
|
if (EventTypeEnum.TYPE_USECASE_ID_IVP.poiType == v2xType.toString()) {
|
||||||
CallerHmiManager.showLimitingVelocity(1)
|
CallerHmiManager.showLimitingVelocity(1, 1)
|
||||||
}
|
}
|
||||||
if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) {
|
if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) {
|
||||||
Log.d("MsgBox-V2XWarningBR", "alertContent或ttsContent为空!")
|
Log.d("MsgBox-V2XWarningBR", "alertContent或ttsContent为空!")
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -8,8 +8,8 @@ import com.mogo.commons.module.status.MogoStatusManager
|
|||||||
import com.mogo.commons.module.status.StatusDescriptor
|
import com.mogo.commons.module.status.StatusDescriptor
|
||||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||||
import com.mogo.eagle.core.function.hmi.R
|
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
|
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -18,8 +18,24 @@ import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
|||||||
*/
|
*/
|
||||||
class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||||
|
|
||||||
companion object{
|
companion object {
|
||||||
private const val TAG = "BindingCarDialog"
|
private const val TAG = "ModifyBindingCarDialog"
|
||||||
|
|
||||||
|
private var modifyBindingCarDialog: ModifyBindingCarDialog? = null
|
||||||
|
|
||||||
|
fun show(context: Context?) {
|
||||||
|
context?.let {
|
||||||
|
if (modifyBindingCarDialog == null) {
|
||||||
|
modifyBindingCarDialog = ModifyBindingCarDialog(it)
|
||||||
|
}
|
||||||
|
modifyBindingCarDialog?.let { dialog ->
|
||||||
|
if (dialog.isShowing) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dialog.show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private var confirmTv: TextView? = null
|
private var confirmTv: TextView? = null
|
||||||
@@ -58,7 +74,7 @@ class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifec
|
|||||||
* 修改绑定车机
|
* 修改绑定车机
|
||||||
*/
|
*/
|
||||||
private fun modifyBindingCar() {
|
private fun modifyBindingCar() {
|
||||||
CallerDevaToolsManager.modifyCarInfo{
|
CallerDevaToolsManager.modifyCarInfo {
|
||||||
if (it.code == 200) {
|
if (it.code == 200) {
|
||||||
TipToast.shortTip("修改绑定成功")
|
TipToast.shortTip("修改绑定成功")
|
||||||
} else {
|
} else {
|
||||||
@@ -70,6 +86,7 @@ class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifec
|
|||||||
|
|
||||||
override fun dismiss() {
|
override fun dismiss() {
|
||||||
super.dismiss()
|
super.dismiss()
|
||||||
|
modifyBindingCarDialog = null
|
||||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(
|
MogoStatusManager.getInstance().unregisterStatusChangedListener(
|
||||||
TAG,
|
TAG,
|
||||||
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||||
@@ -77,12 +94,4 @@ class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifec
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun showModifyBindingCarDialog() {
|
|
||||||
if (isShowing) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
show()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -8,28 +8,45 @@ import com.mogo.commons.module.status.MogoStatusManager
|
|||||||
import com.mogo.commons.module.status.StatusDescriptor
|
import com.mogo.commons.module.status.StatusDescriptor
|
||||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||||
import com.mogo.eagle.core.function.hmi.R
|
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
|
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 绑定车辆对话框
|
* @brief 绑定车辆对话框
|
||||||
* @author lixiaopeng
|
* @author lixiaopeng
|
||||||
*/
|
*/
|
||||||
class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver{
|
class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||||
|
|
||||||
companion object{
|
companion object {
|
||||||
private const val TAG = "ToBindingCarDialog"
|
private const val TAG = "ToBindingCarDialog"
|
||||||
|
|
||||||
|
private var toBindingCarDialog: ToBindingCarDialog? = null
|
||||||
|
|
||||||
|
fun show(context: Context?) {
|
||||||
|
context?.let {
|
||||||
|
if (toBindingCarDialog == null) {
|
||||||
|
toBindingCarDialog = ToBindingCarDialog(it)
|
||||||
|
}
|
||||||
|
toBindingCarDialog?.let { dialog ->
|
||||||
|
if (dialog.isShowing) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dialog.show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private var confirmTv: TextView? = null
|
private var confirmTv: TextView? = null
|
||||||
private var cancelTv: TextView? = null
|
private var cancelTv: TextView? = null
|
||||||
|
|
||||||
private val statusChangedListenerForCheckNotice = IMogoStatusChangedListener { descriptor, isTrue ->
|
private val statusChangedListenerForCheckNotice =
|
||||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
IMogoStatusChangedListener { descriptor, isTrue ->
|
||||||
dismiss()
|
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||||
|
dismiss()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
setContentView(R.layout.dialog_to_bindingcar)
|
setContentView(R.layout.dialog_to_bindingcar)
|
||||||
@@ -57,7 +74,7 @@ class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifecycle
|
|||||||
* 修改绑定车机
|
* 修改绑定车机
|
||||||
*/
|
*/
|
||||||
private fun toBindingCar() {
|
private fun toBindingCar() {
|
||||||
CallerDevaToolsManager.modifyCarInfo{
|
CallerDevaToolsManager.modifyCarInfo {
|
||||||
if (it.code == 200) {
|
if (it.code == 200) {
|
||||||
TipToast.shortTip("绑定成功")
|
TipToast.shortTip("绑定成功")
|
||||||
} else {
|
} else {
|
||||||
@@ -69,6 +86,7 @@ class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifecycle
|
|||||||
|
|
||||||
override fun dismiss() {
|
override fun dismiss() {
|
||||||
super.dismiss()
|
super.dismiss()
|
||||||
|
toBindingCarDialog = null
|
||||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(
|
MogoStatusManager.getInstance().unregisterStatusChangedListener(
|
||||||
TAG,
|
TAG,
|
||||||
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||||
@@ -76,12 +94,4 @@ class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifecycle
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun showToBindingCarDialog() {
|
|
||||||
if (isShowing) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
show()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,15 +15,40 @@ import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
|||||||
*/
|
*/
|
||||||
class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||||
|
|
||||||
private val TAG = "UpgradeAppDialog"
|
companion object{
|
||||||
|
private const val TAG = "UpgradeAppDialog"
|
||||||
|
|
||||||
|
private var upgradeAppDialog: UpgradeAppDialog? = null
|
||||||
|
|
||||||
|
fun show(context: Context?,
|
||||||
|
name: String,
|
||||||
|
url: String,
|
||||||
|
title: String,
|
||||||
|
content: String,
|
||||||
|
installType: String) {
|
||||||
|
context?.let {
|
||||||
|
if (upgradeAppDialog == null) {
|
||||||
|
upgradeAppDialog = UpgradeAppDialog(it)
|
||||||
|
}
|
||||||
|
upgradeAppDialog?.let { dialog ->
|
||||||
|
if (dialog.isShowing) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dialog.showUpgradeAppDialog(name, url, title, content, installType)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private var confirmTv: TextView? = null
|
private var confirmTv: TextView? = null
|
||||||
private var cancleTv: TextView? = null
|
private var cancelTv: TextView? = null
|
||||||
private var upgradeTitleTv: TextView? = null
|
private var upgradeTitleTv: TextView? = null
|
||||||
private var upgradeContentTv: TextView? = null
|
private var upgradeContentTv: TextView? = null
|
||||||
private var verticalLineView: View? = null
|
private var verticalLineView: View? = null
|
||||||
private var confirmForceTv: TextView? = null
|
private var confirmForceTv: TextView? = null
|
||||||
private var tag: String? = null
|
private var tag: String? = null
|
||||||
private var downloarUrl: String? = null
|
private var downloadUrl: String? = null
|
||||||
|
|
||||||
init {
|
init {
|
||||||
setContentView(R.layout.dialog_upgrade_app)
|
setContentView(R.layout.dialog_upgrade_app)
|
||||||
@@ -32,7 +57,7 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
|
|||||||
upgradeTitleTv = findViewById(R.id.tv_upgrade_title)
|
upgradeTitleTv = findViewById(R.id.tv_upgrade_title)
|
||||||
upgradeContentTv = findViewById(R.id.tv_upgrade_content)
|
upgradeContentTv = findViewById(R.id.tv_upgrade_content)
|
||||||
confirmTv = findViewById(R.id.tv_upgrade_confirm)
|
confirmTv = findViewById(R.id.tv_upgrade_confirm)
|
||||||
cancleTv = findViewById(R.id.tv_upgrade_cancel)
|
cancelTv = findViewById(R.id.tv_upgrade_cancel)
|
||||||
verticalLineView = findViewById(R.id.view_vertical_line)
|
verticalLineView = findViewById(R.id.view_vertical_line)
|
||||||
confirmForceTv = findViewById(R.id.tv_upgrade_confirm_force)
|
confirmForceTv = findViewById(R.id.tv_upgrade_confirm_force)
|
||||||
|
|
||||||
@@ -40,7 +65,7 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
|
|||||||
downloadApp()
|
downloadApp()
|
||||||
}
|
}
|
||||||
|
|
||||||
cancleTv?.setOnClickListener {
|
cancelTv?.setOnClickListener {
|
||||||
dismiss()
|
dismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,13 +80,14 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
|
|||||||
*/
|
*/
|
||||||
fun downloadApp() {
|
fun downloadApp() {
|
||||||
ToastUtils.showLong("开始下载APK,稍后可前往downloads文件夹查看,通知栏查看下载进度")
|
ToastUtils.showLong("开始下载APK,稍后可前往downloads文件夹查看,通知栏查看下载进度")
|
||||||
tag?.let { downloarUrl?.let { it1 -> CallerDevaToolsManager.downLoadPackage(it, it1) } }
|
tag?.let { downloadUrl?.let { it1 -> CallerDevaToolsManager.downLoadPackage(it, it1) } }
|
||||||
|
|
||||||
dismiss()
|
dismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun dismiss() {
|
override fun dismiss() {
|
||||||
super.dismiss()
|
super.dismiss()
|
||||||
|
upgradeAppDialog = null
|
||||||
}
|
}
|
||||||
|
|
||||||
// 升级类型 1:提示升级 2:静默升级 3:强制升级
|
// 升级类型 1:提示升级 2:静默升级 3:强制升级
|
||||||
@@ -72,29 +98,29 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
|
|||||||
content: String,
|
content: String,
|
||||||
installType: String
|
installType: String
|
||||||
) {
|
) {
|
||||||
if (isShowing) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
tag = name
|
tag = name
|
||||||
downloarUrl = url
|
downloadUrl = url
|
||||||
upgradeTitleTv?.text = title
|
upgradeTitleTv?.text = title
|
||||||
upgradeContentTv?.text = content
|
upgradeContentTv?.text = content
|
||||||
|
|
||||||
if (installType.equals("1")) {
|
when (installType) {
|
||||||
confirmForceTv?.visibility = View.GONE
|
"1" -> {
|
||||||
confirmTv?.visibility = View.VISIBLE
|
confirmForceTv?.visibility = View.GONE
|
||||||
cancleTv?.visibility = View.VISIBLE
|
confirmTv?.visibility = View.VISIBLE
|
||||||
verticalLineView?.visibility = View.VISIBLE
|
cancelTv?.visibility = View.VISIBLE
|
||||||
} else if (installType.equals("3")) {
|
verticalLineView?.visibility = View.VISIBLE
|
||||||
confirmTv?.visibility = View.GONE
|
}
|
||||||
cancleTv?.visibility = View.GONE
|
"3" -> {
|
||||||
verticalLineView?.visibility = View.GONE
|
confirmTv?.visibility = View.GONE
|
||||||
|
cancelTv?.visibility = View.GONE
|
||||||
|
verticalLineView?.visibility = View.GONE
|
||||||
|
|
||||||
confirmForceTv?.visibility = View.VISIBLE
|
confirmForceTv?.visibility = View.VISIBLE
|
||||||
} else if (installType.equals("2")) {
|
}
|
||||||
//静默安装
|
"2" -> {
|
||||||
|
//静默安装
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
show()
|
show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ import androidx.lifecycle.LifecycleObserver
|
|||||||
import com.mogo.eagle.core.data.map.Infrastructure
|
import com.mogo.eagle.core.data.map.Infrastructure
|
||||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager
|
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager
|
||||||
import com.mogo.eagle.core.function.hmi.R
|
import com.mogo.eagle.core.function.hmi.R
|
||||||
|
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||||
import com.mogo.eagle.core.widget.media.video.SimpleVideoPlayer
|
import com.mogo.eagle.core.widget.media.video.SimpleVideoPlayer
|
||||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
|
||||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
||||||
import com.shuyu.gsyvideoplayer.model.VideoOptionModel
|
import com.shuyu.gsyvideoplayer.model.VideoOptionModel
|
||||||
@@ -30,7 +30,25 @@ import tv.danmaku.ijk.media.player.IjkMediaPlayer
|
|||||||
*/
|
*/
|
||||||
class RoadVideoDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
class RoadVideoDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||||
|
|
||||||
private val TAG = "RoadVideoDialog"
|
companion object {
|
||||||
|
private const val TAG = "RoadVideoDialog"
|
||||||
|
|
||||||
|
private var roadVideoDialog: RoadVideoDialog? = null
|
||||||
|
|
||||||
|
fun show(context: Context?, infList: List<Infrastructure>) {
|
||||||
|
context?.let {
|
||||||
|
if (roadVideoDialog == null) {
|
||||||
|
roadVideoDialog = RoadVideoDialog(it)
|
||||||
|
}
|
||||||
|
roadVideoDialog?.let { dialog ->
|
||||||
|
if(dialog.isShowing){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dialog.show(infList)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private val gsyVideoOptionBuilder by lazy {
|
private val gsyVideoOptionBuilder by lazy {
|
||||||
GSYVideoOptionBuilder()
|
GSYVideoOptionBuilder()
|
||||||
@@ -150,6 +168,7 @@ class RoadVideoDialog(context: Context) : BaseFloatDialog(context), LifecycleObs
|
|||||||
private fun stopLive() {
|
private fun stopLive() {
|
||||||
try {
|
try {
|
||||||
GSYVideoManager.releaseAllVideos()
|
GSYVideoManager.releaseAllVideos()
|
||||||
|
roadVideoDialog = null
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ public class DispatchDialogManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void showDialog(DispatchAdasAutoPilotLocReceiverBean msgData) {
|
public void showDialog(DispatchAdasAutoPilotLocReceiverBean msgData) {
|
||||||
|
if(isShowing()){
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (msgData == null) {
|
if (msgData == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,15 +10,15 @@ import androidx.lifecycle.LifecycleObserver
|
|||||||
import com.mogo.commons.module.status.IMogoStatusChangedListener
|
import com.mogo.commons.module.status.IMogoStatusChangedListener
|
||||||
import com.mogo.commons.module.status.MogoStatusManager
|
import com.mogo.commons.module.status.MogoStatusManager
|
||||||
import com.mogo.commons.module.status.StatusDescriptor
|
import com.mogo.commons.module.status.StatusDescriptor
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
|
||||||
import com.mogo.eagle.core.data.notice.NoticeNormalData
|
import com.mogo.eagle.core.data.notice.NoticeNormalData
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
|
||||||
import com.mogo.eagle.core.function.hmi.R
|
import com.mogo.eagle.core.function.hmi.R
|
||||||
|
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
|
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.mogo.glide.transform.GlideRoundedCornersTransform
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||||
import com.mogo.eagle.core.utilcode.util.BitmapHelper
|
import com.mogo.eagle.core.utilcode.util.BitmapHelper
|
||||||
import com.mogo.eagle.core.widget.media.video.NoticeSimpleVideoPlayer
|
import com.mogo.eagle.core.widget.media.video.NoticeSimpleVideoPlayer
|
||||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
|
||||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
||||||
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack
|
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack
|
||||||
@@ -28,9 +28,28 @@ import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack
|
|||||||
* @brief 点击查看对话框
|
* @brief 点击查看对话框
|
||||||
* @author lixiaopeng
|
* @author lixiaopeng
|
||||||
*/
|
*/
|
||||||
class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver{
|
class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private const val TAG = "NoticeCheckDialog"
|
||||||
|
|
||||||
|
private var pushCheckDialog: NoticeCheckDialog? = null
|
||||||
|
|
||||||
|
fun show(context: Context?, normalData: NoticeNormalData) {
|
||||||
|
context?.let {
|
||||||
|
if (pushCheckDialog == null) {
|
||||||
|
pushCheckDialog = NoticeCheckDialog(it)
|
||||||
|
}
|
||||||
|
pushCheckDialog?.let { dialog ->
|
||||||
|
if (dialog.isShowing) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dialog.showCheckDialog(normalData)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private val TAG = "NoticeCheckDialog"
|
|
||||||
private var pushCheckClose: ImageView? = null
|
private var pushCheckClose: ImageView? = null
|
||||||
private var pushCheckTitle: TextView? = null
|
private var pushCheckTitle: TextView? = null
|
||||||
private var pushCheckContent: TextView? = null
|
private var pushCheckContent: TextView? = null
|
||||||
@@ -42,11 +61,12 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
|||||||
private var mVideoUrl: String = ""
|
private var mVideoUrl: String = ""
|
||||||
private var playErrorImageView: ImageView? = null
|
private var playErrorImageView: ImageView? = null
|
||||||
private var connectTextView: TextView? = null
|
private var connectTextView: TextView? = null
|
||||||
private val statusChangedListenerForCheckNotice = IMogoStatusChangedListener { descriptor, isTrue ->
|
private val statusChangedListenerForCheckNotice =
|
||||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
IMogoStatusChangedListener { descriptor, isTrue ->
|
||||||
dismiss()
|
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||||
|
dismiss()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
setContentView(R.layout.notice_dialog_check_with_accessory)
|
setContentView(R.layout.notice_dialog_check_with_accessory)
|
||||||
@@ -92,13 +112,21 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
|||||||
playVideo(mVideoUrl)
|
playVideo(mVideoUrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForCheckNotice)
|
MogoStatusManager.getInstance().registerStatusChangedListener(
|
||||||
|
TAG,
|
||||||
|
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||||
|
statusChangedListenerForCheckNotice
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun dismiss() {
|
override fun dismiss() {
|
||||||
super.dismiss()
|
super.dismiss()
|
||||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForCheckNotice)
|
pushCheckDialog = null
|
||||||
|
MogoStatusManager.getInstance().unregisterStatusChangedListener(
|
||||||
|
TAG,
|
||||||
|
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||||
|
statusChangedListenerForCheckNotice
|
||||||
|
)
|
||||||
stopLive()
|
stopLive()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,10 +134,6 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
|||||||
* 展示详情页面
|
* 展示详情页面
|
||||||
*/
|
*/
|
||||||
fun showCheckDialog(noticeNormal: NoticeNormalData) {
|
fun showCheckDialog(noticeNormal: NoticeNormalData) {
|
||||||
if (isShowing || noticeNormal == null) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (noticeNormal.title.isBlank() || noticeNormal.content.isBlank()) {
|
if (noticeNormal.title.isBlank() || noticeNormal.content.isBlank()) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -148,7 +172,7 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
|||||||
private fun playVideo(videoUrl: String) {
|
private fun playVideo(videoUrl: String) {
|
||||||
try {
|
try {
|
||||||
gsyVideoOptionBuilder.setUrl(videoUrl).setCacheWithPlay(false).setPlayTag(TAG)
|
gsyVideoOptionBuilder.setUrl(videoUrl).setCacheWithPlay(false).setPlayTag(TAG)
|
||||||
.build(pushVideo)
|
.build(pushVideo)
|
||||||
pushVideo!!.startButton.performClick()
|
pushVideo!!.startButton.performClick()
|
||||||
playImageView!!.visibility = View.GONE
|
playImageView!!.visibility = View.GONE
|
||||||
thumbnailImageView!!.visibility = View.GONE
|
thumbnailImageView!!.visibility = View.GONE
|
||||||
@@ -187,11 +211,11 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
|||||||
/**
|
/**
|
||||||
* 播放结束后
|
* 播放结束后
|
||||||
*/
|
*/
|
||||||
private fun complete(firstbitmap: Bitmap, path: String) {
|
private fun complete(firstBitmap: Bitmap, path: String) {
|
||||||
playImageView!!.visibility = View.VISIBLE
|
playImageView!!.visibility = View.VISIBLE
|
||||||
playImageView!!.setImageResource(R.drawable.notice_video_play)
|
playImageView!!.setImageResource(R.drawable.notice_video_play)
|
||||||
thumbnailImageView!!.visibility = View.VISIBLE
|
thumbnailImageView!!.visibility = View.VISIBLE
|
||||||
GlideApp.with(context).load(firstbitmap).optionalTransform(
|
GlideApp.with(context).load(firstBitmap).optionalTransform(
|
||||||
GlideRoundedCornersTransform(
|
GlideRoundedCornersTransform(
|
||||||
20f,
|
20f,
|
||||||
GlideRoundedCornersTransform.CornerType.ALL
|
GlideRoundedCornersTransform.CornerType.ALL
|
||||||
@@ -201,7 +225,7 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun startVideoCallBack(path: String) {
|
private fun startVideoCallBack(path: String) {
|
||||||
Thread(Runnable {
|
Thread {
|
||||||
val firstBitmap = BitmapHelper.getVideoThumbnail(path) /*获取第一帧图*/
|
val firstBitmap = BitmapHelper.getVideoThumbnail(path) /*获取第一帧图*/
|
||||||
pushVideo!!.setVideoAllCallBack(object : VideoAllCallBack {
|
pushVideo!!.setVideoAllCallBack(object : VideoAllCallBack {
|
||||||
override fun onAutoComplete(url: String, vararg objects: Any) {
|
override fun onAutoComplete(url: String, vararg objects: Any) {
|
||||||
@@ -214,15 +238,15 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onClickStop(url: String, vararg objects: Any) {
|
override fun onClickStop(url: String, vararg objects: Any) {
|
||||||
CallerLogger.d(M_HMI + TAG, "onClickStop")
|
CallerLogger.d(M_HMI + TAG, "onClickStop")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStartPrepared(url: String, vararg objects: Any) {
|
override fun onStartPrepared(url: String, vararg objects: Any) {
|
||||||
CallerLogger.d(M_HMI + TAG, "onStartPrepared")
|
CallerLogger.d(M_HMI + TAG, "onStartPrepared")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onPlayError(url: String, vararg objects: Any) {
|
override fun onPlayError(url: String, vararg objects: Any) {
|
||||||
CallerLogger.d(M_HMI + TAG, "onPlayError")
|
CallerLogger.d(M_HMI + TAG, "onPlayError")
|
||||||
pushImageView?.visibility = View.GONE
|
pushImageView?.visibility = View.GONE
|
||||||
pushVideo?.visibility = View.GONE
|
pushVideo?.visibility = View.GONE
|
||||||
playImageView!!.visibility = View.GONE
|
playImageView!!.visibility = View.GONE
|
||||||
@@ -249,10 +273,10 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
|||||||
override fun onClickStartThumb(url: String, vararg objects: Any) {}
|
override fun onClickStartThumb(url: String, vararg objects: Any) {}
|
||||||
override fun onClickBlank(url: String, vararg objects: Any) {}
|
override fun onClickBlank(url: String, vararg objects: Any) {}
|
||||||
override fun onClickBlankFullscreen(url: String, vararg objects: Any) {
|
override fun onClickBlankFullscreen(url: String, vararg objects: Any) {
|
||||||
CallerLogger.d(M_HMI + TAG, "onClickBlankFullscreen")
|
CallerLogger.d(M_HMI + TAG, "onClickBlankFullscreen")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}).start()
|
}.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,451 +0,0 @@
|
|||||||
package com.mogo.eagle.core.function.hmi.ui.notice.traffic;
|
|
||||||
|
|
||||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.graphics.Bitmap;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.lifecycle.LifecycleObserver;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
|
|
||||||
|
|
||||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
|
||||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
|
||||||
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.data.autopilot.AutopilotControlParameters;
|
|
||||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo;
|
|
||||||
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.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;
|
|
||||||
import com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView;
|
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
|
||||||
import com.mogo.eagle.core.utilcode.util.BitmapHelper;
|
|
||||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
|
|
||||||
import com.mogo.eagle.core.widget.media.video.NoticeSimpleSmallVideoPlayer;
|
|
||||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog;
|
|
||||||
import com.shuyu.gsyvideoplayer.GSYVideoManager;
|
|
||||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder;
|
|
||||||
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack;
|
|
||||||
import com.shuyu.gsyvideoplayer.utils.NetworkUtils;
|
|
||||||
import com.shuyu.gsyvideoplayer.video.base.GSYVideoView;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author liujing
|
|
||||||
* @description 交警事故详情弹框
|
|
||||||
* http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=66917475 根据infoId获取事故详情
|
|
||||||
* @since: 10/26/21
|
|
||||||
*/
|
|
||||||
public class NoticeTrafficDialog extends BaseFloatDialog implements LifecycleObserver {
|
|
||||||
private String TAG = "AINotice";
|
|
||||||
private Context mContext;
|
|
||||||
private RecyclerView mRecyclerView;
|
|
||||||
private NoticeSimpleSmallVideoPlayer mVideoPlayer;
|
|
||||||
private NoticeTrafficStylePushData mPushData;
|
|
||||||
private ImageView close;
|
|
||||||
private ImageView playImageView;
|
|
||||||
private MogoImageView thumbnailImage;
|
|
||||||
private final GSYVideoOptionBuilder gsyVideoOptionBuilder = new GSYVideoOptionBuilder();
|
|
||||||
private TextView accept;//接受
|
|
||||||
private TextView refuse;//拒绝
|
|
||||||
private TextView connect;//连接
|
|
||||||
private NoticeTrafficAdapter adapter;
|
|
||||||
private final ArrayList<NoticeValue> dataArrayList = new ArrayList<>();
|
|
||||||
private NoticeTrafficStyleInfo.NoticeTrafficAccountInfo mTrafficStyleInfo;
|
|
||||||
|
|
||||||
public NoticeTrafficDialog(@NonNull Context context, NoticeTrafficStylePushData pushData) {
|
|
||||||
super(context);
|
|
||||||
mContext = context;
|
|
||||||
mPushData = pushData;
|
|
||||||
initView();
|
|
||||||
}
|
|
||||||
|
|
||||||
public NoticeTrafficDialog(@NonNull Context context, int themeResId) {
|
|
||||||
super(context, themeResId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void initView() {
|
|
||||||
setContentView(R.layout.notice_dialog_traffic_police);
|
|
||||||
setCanceledOnTouchOutside(true);
|
|
||||||
playerShow();//视频播放器及接操作按钮
|
|
||||||
recyclerVie();//详情信息列表
|
|
||||||
MogoStatusManager.getInstance().registerStatusChangedListener(M_HMI + TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForNotice);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据推送消息渲染顶部图片/视频
|
|
||||||
* type 0图片 1视频
|
|
||||||
*/
|
|
||||||
private void playerShow() {
|
|
||||||
mVideoPlayer = findViewById(R.id.video_player);
|
|
||||||
thumbnailImage = findViewById(R.id.thumbnail_image);
|
|
||||||
playImageView = this.findViewById(R.id.start_for_traffic);
|
|
||||||
playImageView.setOnClickListener(v -> startLive());
|
|
||||||
close = findViewById(R.id.notice_traffic_dialog_close);
|
|
||||||
close.setOnClickListener(v -> {
|
|
||||||
releasePlayer();
|
|
||||||
dismiss();
|
|
||||||
});
|
|
||||||
accept = findViewById(R.id.accept_traffic);
|
|
||||||
refuse = findViewById(R.id.refuse_traffic);
|
|
||||||
connect = findViewById(R.id.notice_connect);
|
|
||||||
accept.setOnClickListener(v -> feedBackTraffic(1));
|
|
||||||
refuse.setOnClickListener(v -> feedBackTraffic(0));
|
|
||||||
//重新连接
|
|
||||||
connect.setOnClickListener(v -> {
|
|
||||||
netWorkStatus();
|
|
||||||
startLive();
|
|
||||||
requestTrafficInfo();
|
|
||||||
});
|
|
||||||
requestTrafficInfo();
|
|
||||||
netWorkStatus();
|
|
||||||
if (mPushData.getType() == 1) {
|
|
||||||
startLive();
|
|
||||||
} else {
|
|
||||||
GlideApp.with(mContext).load(mPushData.getPoiImgUrl()).optionalTransform(new GlideRoundedCornersTransform
|
|
||||||
(20f, GlideRoundedCornersTransform.CornerType.ALL)).into(thumbnailImage);
|
|
||||||
mVideoPlayer.setVisibility(View.INVISIBLE);
|
|
||||||
playImageView.setVisibility(View.INVISIBLE);
|
|
||||||
thumbnailImage.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
mVideoPlayer.setOnClickListener(v -> {
|
|
||||||
if (mVideoPlayer.getCurrentState() == GSYVideoView.CURRENT_STATE_PAUSE) {/*播放中*/
|
|
||||||
resume();
|
|
||||||
} else {
|
|
||||||
pause();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void recyclerVie() {
|
|
||||||
//网格绘制
|
|
||||||
try {
|
|
||||||
mRecyclerView = findViewById(R.id.traffic_info_recyclerView);
|
|
||||||
//网格布局
|
|
||||||
StaggeredGridLayoutManager staggeredGridLayoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
|
|
||||||
mRecyclerView.setLayoutManager(staggeredGridLayoutManager);
|
|
||||||
NoticeTrafficInfoGridItemDivider gridLayoutDivider = new NoticeTrafficInfoGridItemDivider(1,
|
|
||||||
(mContext.getResources().getColor(R.color.notice_check_dialog_bg_color)));
|
|
||||||
mRecyclerView.addItemDecoration(gridLayoutDivider);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
adapter = new NoticeTrafficAdapter(mContext, dataArrayList);
|
|
||||||
mRecyclerView.setAdapter(adapter);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param i 是否接受交通事故任务
|
|
||||||
* 0不接收 1接受 发起自动驾驶任务,显示引导线
|
|
||||||
*/
|
|
||||||
private void feedBackTraffic(int i) {
|
|
||||||
CallerFuncBizManager.getBizProvider().feedBackNoticeTraffic(mPushData.getInfoId(), MoGoAiCloudClientConfig.getInstance().getSn(), i);
|
|
||||||
if (i == 1) {
|
|
||||||
startAutoPilot();
|
|
||||||
}
|
|
||||||
dismiss();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开启自动驾驶
|
|
||||||
*/
|
|
||||||
private void startAutoPilot() {
|
|
||||||
if (mTrafficStyleInfo != null) {
|
|
||||||
AutopilotControlParameters parameters = new AutopilotControlParameters();
|
|
||||||
parameters.isSpeakVoice = false;
|
|
||||||
parameters.vehicleType = 10;
|
|
||||||
//云平台使用的是火星坐标,自动驾驶需要wgs84
|
|
||||||
double[] gcj02 = CoordinateUtils.transformGcj02toWgs84(mTrafficStyleInfo.getLat(), mTrafficStyleInfo.getLon());
|
|
||||||
parameters.startLatLon = new AutopilotControlParameters.AutoPilotLonLat
|
|
||||||
(CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat(),
|
|
||||||
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon());
|
|
||||||
parameters.endLatLon = new AutopilotControlParameters.AutoPilotLonLat
|
|
||||||
(gcj02[0], gcj02[1]);
|
|
||||||
CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 暂停
|
|
||||||
*/
|
|
||||||
private void pause() {
|
|
||||||
playImageView.setVisibility(View.VISIBLE);
|
|
||||||
thumbnailImage.setVisibility(View.GONE);
|
|
||||||
playImageView.setOnClickListener(v -> mVideoPlayer.onVideoResume());
|
|
||||||
thumbnailImage.setOnClickListener(v -> mVideoPlayer.onVideoResume());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 继续
|
|
||||||
*/
|
|
||||||
private void resume() {
|
|
||||||
playImageView.setImageResource(R.drawable.notice_video_pause);
|
|
||||||
playImageView.setVisibility(View.GONE);
|
|
||||||
thumbnailImage.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 播放结束后
|
|
||||||
*/
|
|
||||||
private void complete(Bitmap firstbitmap) {
|
|
||||||
thumbnailImage.setVisibility(View.VISIBLE);
|
|
||||||
// thumbnailImage.setImageBitmap(firstbitmap);
|
|
||||||
GlideApp.with(mContext).load(firstbitmap).optionalTransform(new GlideRoundedCornersTransform
|
|
||||||
(20f, GlideRoundedCornersTransform.CornerType.ALL)).into(thumbnailImage);
|
|
||||||
playImageView.setImageResource(R.drawable.notice_video_play);
|
|
||||||
playImageView.setVisibility(View.VISIBLE);
|
|
||||||
playImageView.setOnClickListener(v -> startLive());
|
|
||||||
thumbnailImage.setOnClickListener(v -> startLive());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 视频播放
|
|
||||||
*/
|
|
||||||
private void startLive() {
|
|
||||||
if (mPushData != null) {
|
|
||||||
try {
|
|
||||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "交警事故开始播放视频startLive");
|
|
||||||
String videoUrl = mPushData.getPoiImgUrl();
|
|
||||||
gsyVideoOptionBuilder.setUrl(videoUrl).setCacheWithPlay(false).setPlayTag("NoticeTrafficDialog")
|
|
||||||
.build(mVideoPlayer);
|
|
||||||
mVideoPlayer.getStartButton().performClick();
|
|
||||||
liveCallBack();
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (dataArrayList.size() == 0) {
|
|
||||||
requestTrafficInfo();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void liveCallBack() {
|
|
||||||
new Thread(() -> {
|
|
||||||
Bitmap firstBitmap = BitmapHelper.getVideoThumbnail(mPushData.getPoiImgUrl());/*获取第一帧图*/
|
|
||||||
mVideoPlayer.setVideoAllCallBack(new VideoAllCallBack() {
|
|
||||||
@Override
|
|
||||||
public void onAutoComplete(String url, Object... objects) {
|
|
||||||
complete(firstBitmap);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClickResume(String url, Object... objects) {
|
|
||||||
thumbnailImage.setVisibility(View.GONE);
|
|
||||||
playImageView.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClickStop(String url, Object... objects) {
|
|
||||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onClickStop");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onStartPrepared(String url, Object... objects) {
|
|
||||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onStartPrepared");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPrepared(String url, Object... objects) {
|
|
||||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onPrepared");
|
|
||||||
thumbnailImage.setVisibility(View.GONE);
|
|
||||||
playImageView.setVisibility(View.GONE);
|
|
||||||
connect.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClickStartIcon(String url, Object... objects) {
|
|
||||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onClickStartIcon");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClickStartError(String url, Object... objects) {
|
|
||||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onClickStartError");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClickStopFullscreen(String url, Object... objects) {
|
|
||||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onClickStopFullscreen");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClickResumeFullscreen(String url, Object... objects) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClickSeekbar(String url, Object... objects) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClickSeekbarFullscreen(String url, Object... objects) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEnterFullscreen(String url, Object... objects) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onQuitFullscreen(String url, Object... objects) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onQuitSmallWidget(String url, Object... objects) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEnterSmallWidget(String url, Object... objects) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTouchScreenSeekVolume(String url, Object... objects) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTouchScreenSeekPosition(String url, Object... objects) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTouchScreenSeekLight(String url, Object... objects) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPlayError(String url, Object... objects) {
|
|
||||||
thumbnailImage.setVisibility(View.VISIBLE);
|
|
||||||
connect.setVisibility(View.VISIBLE);
|
|
||||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onPlayError");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClickStartThumb(String url, Object... objects) {
|
|
||||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onClickStartThumb");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClickBlank(String url, Object... objects) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClickBlankFullscreen(String url, Object... objects) {
|
|
||||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onClickBlankFullscreen");
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取交通事故详情
|
|
||||||
*/
|
|
||||||
private void requestTrafficInfo() {
|
|
||||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "requestTrafficInfo");
|
|
||||||
CallerFuncBizManager.getBizProvider().requestAccidentInfo(mPushData.getInfoId(), MoGoAiCloudClientConfig.getInstance().getSn(), trafficInfo -> {
|
|
||||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "交通事故详情::" + trafficInfo);
|
|
||||||
mTrafficStyleInfo = trafficInfo.getResult().getAccidentInfo();
|
|
||||||
infoRefresh(mTrafficStyleInfo);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void infoRefresh(NoticeTrafficStyleInfo.NoticeTrafficAccountInfo info) {
|
|
||||||
if (dataArrayList.size() > 0) {
|
|
||||||
dataArrayList.clear();
|
|
||||||
}
|
|
||||||
NoticeValue laiYuan = new NoticeValue();
|
|
||||||
laiYuan.setKey("事故来源:");
|
|
||||||
laiYuan.setValue(info.getUploadType());
|
|
||||||
dataArrayList.add(laiYuan);
|
|
||||||
|
|
||||||
NoticeValue cTime = new NoticeValue();
|
|
||||||
cTime.setKey("事故时间:");
|
|
||||||
cTime.setValue(DateTimeUtils.getTimeText(info.getDataCreateTime(), DateTimeUtils.MM_Yue_dd_Ri_HH_mm));
|
|
||||||
dataArrayList.add(cTime);
|
|
||||||
|
|
||||||
NoticeValue hTime = new NoticeValue();
|
|
||||||
hTime.setKey("处理时间:");
|
|
||||||
hTime.setValue(DateTimeUtils.getTimeText(info.getDataHandleTime(), DateTimeUtils.MM_Yue_dd_Ri_HH_mm));
|
|
||||||
dataArrayList.add(hTime);
|
|
||||||
|
|
||||||
NoticeValue reason = new NoticeValue();
|
|
||||||
reason.setKey("事故原因:");
|
|
||||||
reason.setValue(info.getReason());
|
|
||||||
dataArrayList.add(reason);
|
|
||||||
|
|
||||||
NoticeValue status = new NoticeValue();
|
|
||||||
status.setKey("处理状态:");
|
|
||||||
if (info.getOperaStatus().equals("1")) {
|
|
||||||
status.setValue("待处理");
|
|
||||||
} else {
|
|
||||||
status.setValue("已处理");
|
|
||||||
}
|
|
||||||
dataArrayList.add(status);
|
|
||||||
|
|
||||||
NoticeValue location = new NoticeValue();
|
|
||||||
location.setKey("事故地点:");
|
|
||||||
location.setValue(info.getUploadAddress());
|
|
||||||
dataArrayList.add(location);
|
|
||||||
|
|
||||||
NoticeValue style = new NoticeValue();
|
|
||||||
style.setKey("事故等级:");
|
|
||||||
style.setValue(info.getTroubleTypeName());
|
|
||||||
dataArrayList.add(style);
|
|
||||||
|
|
||||||
adapter.setData(dataArrayList);
|
|
||||||
adapter.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 判断网络状态
|
|
||||||
*/
|
|
||||||
private void netWorkStatus() {
|
|
||||||
if (NetworkUtils.isAvailable(getContext())) {
|
|
||||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "网络可用");
|
|
||||||
thumbnailImage.setVisibility(View.GONE);
|
|
||||||
connect.setVisibility(View.GONE);
|
|
||||||
thumbnailImage.setBackgroundResource(R.drawable.notice_traffic_placeholder);
|
|
||||||
} else {
|
|
||||||
thumbnailImage.setVisibility(View.VISIBLE);
|
|
||||||
thumbnailImage.setBackgroundResource(R.drawable.notice_unsuccess_traffic);
|
|
||||||
connect.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void cancel() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void releasePlayer() {
|
|
||||||
try {
|
|
||||||
GSYVideoManager.releaseAllVideos();
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void dismiss() {
|
|
||||||
super.dismiss();
|
|
||||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "trafficDialog dismiss");
|
|
||||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(M_HMI + TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForNotice);
|
|
||||||
releasePlayer();
|
|
||||||
}
|
|
||||||
|
|
||||||
private final IMogoStatusChangedListener statusChangedListenerForNotice = (descriptor, isTrue) -> {
|
|
||||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
|
||||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onStatusChanged==MAIN_PAGE_IS_BACKGROUND");
|
|
||||||
dismiss();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,445 @@
|
|||||||
|
package com.mogo.eagle.core.function.hmi.ui.notice.traffic
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.graphics.Bitmap
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.ImageView
|
||||||
|
import android.widget.TextView
|
||||||
|
import androidx.lifecycle.LifecycleObserver
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import androidx.recyclerview.widget.StaggeredGridLayoutManager
|
||||||
|
import com.mogo.cloud.commons.utils.CoordinateUtils
|
||||||
|
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||||
|
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.data.autopilot.AutopilotControlParameters
|
||||||
|
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLonLat
|
||||||
|
import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo
|
||||||
|
import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo.NoticeTrafficAccountInfo
|
||||||
|
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.startAutoPilot
|
||||||
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lat
|
||||||
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lon
|
||||||
|
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager.bizProvider
|
||||||
|
import com.mogo.eagle.core.function.hmi.R
|
||||||
|
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||||
|
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.mogo.imageloader.MogoImageView
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||||
|
import com.mogo.eagle.core.utilcode.util.BitmapHelper
|
||||||
|
import com.mogo.eagle.core.utilcode.util.DateTimeUtils
|
||||||
|
import com.mogo.eagle.core.widget.media.video.NoticeSimpleSmallVideoPlayer
|
||||||
|
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||||
|
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
||||||
|
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack
|
||||||
|
import com.shuyu.gsyvideoplayer.utils.NetworkUtils
|
||||||
|
import com.shuyu.gsyvideoplayer.video.base.GSYVideoView
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liujing
|
||||||
|
* @description 交警事故详情弹框
|
||||||
|
* http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=66917475 根据infoId获取事故详情
|
||||||
|
* @since: 10/26/21
|
||||||
|
*/
|
||||||
|
class NoticeTrafficDialog : BaseFloatDialog, LifecycleObserver {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private const val TAG = "AINotice"
|
||||||
|
|
||||||
|
private var noticeTrafficDialog: NoticeTrafficDialog? = null
|
||||||
|
|
||||||
|
fun show(context: Context?, trafficStylePushData: NoticeTrafficStylePushData) {
|
||||||
|
context?.let {
|
||||||
|
if (noticeTrafficDialog == null) {
|
||||||
|
noticeTrafficDialog = NoticeTrafficDialog(it, trafficStylePushData)
|
||||||
|
}
|
||||||
|
noticeTrafficDialog?.let { dialog ->
|
||||||
|
if (dialog.isShowing) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dialog.show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private var mContext: Context? = null
|
||||||
|
private var mRecyclerView: RecyclerView? = null
|
||||||
|
private var mVideoPlayer: NoticeSimpleSmallVideoPlayer? = null
|
||||||
|
private var mPushData: NoticeTrafficStylePushData? = null
|
||||||
|
private var close: ImageView? = null
|
||||||
|
private var playImageView: ImageView? = null
|
||||||
|
private var thumbnailImage: MogoImageView? = null
|
||||||
|
private val gsyVideoOptionBuilder = GSYVideoOptionBuilder()
|
||||||
|
private var accept: TextView? = null//接受
|
||||||
|
private var refuse: TextView? = null//拒绝
|
||||||
|
private var connect: TextView? = null//连接
|
||||||
|
private var adapter: NoticeTrafficAdapter? = null
|
||||||
|
private val dataArrayList = ArrayList<NoticeValue?>()
|
||||||
|
private var mTrafficStyleInfo: NoticeTrafficAccountInfo? = null
|
||||||
|
|
||||||
|
constructor(context: Context, pushData: NoticeTrafficStylePushData?) : super(context) {
|
||||||
|
mContext = context
|
||||||
|
mPushData = pushData
|
||||||
|
initView()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun initView() {
|
||||||
|
setContentView(R.layout.notice_dialog_traffic_police)
|
||||||
|
setCanceledOnTouchOutside(true)
|
||||||
|
playerShow() //视频播放器及接操作按钮
|
||||||
|
recyclerVie() //详情信息列表
|
||||||
|
MogoStatusManager.getInstance().registerStatusChangedListener(
|
||||||
|
SceneConstant.M_HMI + TAG,
|
||||||
|
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||||
|
statusChangedListenerForNotice
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据推送消息渲染顶部图片/视频
|
||||||
|
* type 0图片 1视频
|
||||||
|
*/
|
||||||
|
private fun playerShow() {
|
||||||
|
mVideoPlayer = findViewById(R.id.video_player)
|
||||||
|
thumbnailImage = findViewById(R.id.thumbnail_image)
|
||||||
|
playImageView = findViewById(R.id.start_for_traffic)
|
||||||
|
close = findViewById(R.id.notice_traffic_dialog_close)
|
||||||
|
accept = findViewById(R.id.accept_traffic)
|
||||||
|
refuse = findViewById(R.id.refuse_traffic)
|
||||||
|
connect = findViewById(R.id.notice_connect)
|
||||||
|
|
||||||
|
playImageView?.setOnClickListener { startLive() }
|
||||||
|
close?.setOnClickListener {
|
||||||
|
releasePlayer()
|
||||||
|
dismiss()
|
||||||
|
}
|
||||||
|
accept?.setOnClickListener { feedBackTraffic(1) }
|
||||||
|
refuse?.setOnClickListener { feedBackTraffic(0) }
|
||||||
|
//重新连接
|
||||||
|
connect?.setOnClickListener {
|
||||||
|
netWorkStatus()
|
||||||
|
startLive()
|
||||||
|
requestTrafficInfo()
|
||||||
|
}
|
||||||
|
requestTrafficInfo()
|
||||||
|
netWorkStatus()
|
||||||
|
if (mPushData!!.type == 1) {
|
||||||
|
startLive()
|
||||||
|
} else {
|
||||||
|
GlideApp.with(mContext!!).load(mPushData!!.poiImgUrl).optionalTransform(
|
||||||
|
GlideRoundedCornersTransform(
|
||||||
|
20f,
|
||||||
|
GlideRoundedCornersTransform.CornerType.ALL
|
||||||
|
)
|
||||||
|
).into(thumbnailImage!!)
|
||||||
|
mVideoPlayer?.visibility = View.INVISIBLE
|
||||||
|
playImageView?.visibility = View.INVISIBLE
|
||||||
|
thumbnailImage?.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
mVideoPlayer?.setOnClickListener {
|
||||||
|
if (mVideoPlayer!!.currentState == GSYVideoView.CURRENT_STATE_PAUSE) { /*播放中*/
|
||||||
|
resume()
|
||||||
|
} else {
|
||||||
|
pause()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun recyclerVie() {
|
||||||
|
//网格绘制
|
||||||
|
try {
|
||||||
|
mRecyclerView = findViewById(R.id.traffic_info_recyclerView)
|
||||||
|
//网格布局
|
||||||
|
val staggeredGridLayoutManager =
|
||||||
|
StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL)
|
||||||
|
mRecyclerView?.layoutManager = staggeredGridLayoutManager
|
||||||
|
val gridLayoutDivider = NoticeTrafficInfoGridItemDivider(
|
||||||
|
1,
|
||||||
|
mContext!!.resources.getColor(R.color.notice_check_dialog_bg_color)
|
||||||
|
)
|
||||||
|
mRecyclerView?.addItemDecoration(gridLayoutDivider)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
e.printStackTrace()
|
||||||
|
}
|
||||||
|
adapter = NoticeTrafficAdapter(mContext!!, dataArrayList)
|
||||||
|
mRecyclerView!!.adapter = adapter
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param i 是否接受交通事故任务
|
||||||
|
* 0不接收 1接受 发起自动驾驶任务,显示引导线
|
||||||
|
*/
|
||||||
|
private fun feedBackTraffic(i: Int) {
|
||||||
|
bizProvider.feedBackNoticeTraffic(
|
||||||
|
mPushData!!.infoId,
|
||||||
|
MoGoAiCloudClientConfig.getInstance().sn,
|
||||||
|
i
|
||||||
|
)
|
||||||
|
if (i == 1) {
|
||||||
|
startAutoPilot()
|
||||||
|
}
|
||||||
|
dismiss()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开启自动驾驶
|
||||||
|
*/
|
||||||
|
private fun startAutoPilot() {
|
||||||
|
if (mTrafficStyleInfo != null) {
|
||||||
|
val parameters = AutopilotControlParameters()
|
||||||
|
parameters.isSpeakVoice = false
|
||||||
|
parameters.vehicleType = 10
|
||||||
|
//云平台使用的是火星坐标,自动驾驶需要wgs84
|
||||||
|
val gcj02 = CoordinateUtils.transformGcj02toWgs84(
|
||||||
|
mTrafficStyleInfo!!.lat, mTrafficStyleInfo!!.lon
|
||||||
|
)
|
||||||
|
parameters.startLatLon = AutoPilotLonLat(
|
||||||
|
getCurWgs84Lat(),
|
||||||
|
getCurWgs84Lon()
|
||||||
|
)
|
||||||
|
parameters.endLatLon = AutoPilotLonLat(gcj02[0], gcj02[1])
|
||||||
|
startAutoPilot(parameters)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂停
|
||||||
|
*/
|
||||||
|
private fun pause() {
|
||||||
|
playImageView!!.visibility = View.VISIBLE
|
||||||
|
thumbnailImage!!.visibility = View.GONE
|
||||||
|
playImageView!!.setOnClickListener { v: View? -> mVideoPlayer!!.onVideoResume() }
|
||||||
|
thumbnailImage!!.setOnClickListener { v: View? -> mVideoPlayer!!.onVideoResume() }
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 继续
|
||||||
|
*/
|
||||||
|
private fun resume() {
|
||||||
|
playImageView!!.setImageResource(R.drawable.notice_video_pause)
|
||||||
|
playImageView!!.visibility = View.GONE
|
||||||
|
thumbnailImage!!.visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 播放结束后
|
||||||
|
*/
|
||||||
|
private fun complete(firstBitmap: Bitmap) {
|
||||||
|
thumbnailImage!!.visibility = View.VISIBLE
|
||||||
|
GlideApp.with(mContext!!).load(firstBitmap).optionalTransform(
|
||||||
|
GlideRoundedCornersTransform(
|
||||||
|
20f,
|
||||||
|
GlideRoundedCornersTransform.CornerType.ALL
|
||||||
|
)
|
||||||
|
).into(
|
||||||
|
thumbnailImage!!
|
||||||
|
)
|
||||||
|
playImageView!!.setImageResource(R.drawable.notice_video_play)
|
||||||
|
playImageView!!.visibility = View.VISIBLE
|
||||||
|
playImageView!!.setOnClickListener { v: View? -> startLive() }
|
||||||
|
thumbnailImage!!.setOnClickListener { v: View? -> startLive() }
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频播放
|
||||||
|
*/
|
||||||
|
private fun startLive() {
|
||||||
|
if (mPushData != null) {
|
||||||
|
try {
|
||||||
|
d(SceneConstant.M_HMI + TAG, "交警事故开始播放视频startLive")
|
||||||
|
val videoUrl = mPushData!!.poiImgUrl
|
||||||
|
gsyVideoOptionBuilder.setUrl(videoUrl).setCacheWithPlay(false)
|
||||||
|
.setPlayTag("NoticeTrafficDialog")
|
||||||
|
.build(mVideoPlayer)
|
||||||
|
mVideoPlayer!!.startButton.performClick()
|
||||||
|
liveCallBack()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
e.printStackTrace()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (dataArrayList.size == 0) {
|
||||||
|
requestTrafficInfo()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun liveCallBack() {
|
||||||
|
Thread {
|
||||||
|
val firstBitmap = BitmapHelper.getVideoThumbnail(mPushData!!.poiImgUrl) /*获取第一帧图*/
|
||||||
|
mVideoPlayer!!.setVideoAllCallBack(object : VideoAllCallBack {
|
||||||
|
override fun onAutoComplete(url: String, vararg objects: Any) {
|
||||||
|
complete(firstBitmap)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onClickResume(url: String, vararg objects: Any) {
|
||||||
|
thumbnailImage!!.visibility = View.GONE
|
||||||
|
playImageView!!.visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onClickStop(url: String, vararg objects: Any) {
|
||||||
|
d(SceneConstant.M_HMI + TAG, "onClickStop")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onStartPrepared(url: String, vararg objects: Any) {
|
||||||
|
d(SceneConstant.M_HMI + TAG, "onStartPrepared")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onPrepared(url: String, vararg objects: Any) {
|
||||||
|
d(SceneConstant.M_HMI + TAG, "onPrepared")
|
||||||
|
thumbnailImage!!.visibility = View.GONE
|
||||||
|
playImageView!!.visibility = View.GONE
|
||||||
|
connect!!.visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onClickStartIcon(url: String, vararg objects: Any) {
|
||||||
|
d(SceneConstant.M_HMI + TAG, "onClickStartIcon")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onClickStartError(url: String, vararg objects: Any) {
|
||||||
|
e(SceneConstant.M_HMI + TAG, "onClickStartError")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onClickStopFullscreen(url: String, vararg objects: Any) {
|
||||||
|
d(SceneConstant.M_HMI + TAG, "onClickStopFullscreen")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onClickResumeFullscreen(url: String, vararg objects: Any) {}
|
||||||
|
override fun onClickSeekbar(url: String, vararg objects: Any) {}
|
||||||
|
override fun onClickSeekbarFullscreen(url: String, vararg objects: Any) {}
|
||||||
|
override fun onEnterFullscreen(url: String, vararg objects: Any) {}
|
||||||
|
override fun onQuitFullscreen(url: String, vararg objects: Any) {}
|
||||||
|
override fun onQuitSmallWidget(url: String, vararg objects: Any) {}
|
||||||
|
override fun onEnterSmallWidget(url: String, vararg objects: Any) {}
|
||||||
|
override fun onTouchScreenSeekVolume(url: String, vararg objects: Any) {}
|
||||||
|
override fun onTouchScreenSeekPosition(url: String, vararg objects: Any) {}
|
||||||
|
override fun onTouchScreenSeekLight(url: String, vararg objects: Any) {}
|
||||||
|
override fun onPlayError(url: String, vararg objects: Any) {
|
||||||
|
thumbnailImage!!.visibility = View.VISIBLE
|
||||||
|
connect!!.visibility = View.VISIBLE
|
||||||
|
d(SceneConstant.M_HMI + TAG, "onPlayError")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onClickStartThumb(url: String, vararg objects: Any) {
|
||||||
|
d(SceneConstant.M_HMI + TAG, "onClickStartThumb")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onClickBlank(url: String, vararg objects: Any) {}
|
||||||
|
override fun onClickBlankFullscreen(url: String, vararg objects: Any) {
|
||||||
|
d(SceneConstant.M_HMI + TAG, "onClickBlankFullscreen")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}.start()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取交通事故详情
|
||||||
|
*/
|
||||||
|
private fun requestTrafficInfo() {
|
||||||
|
d(SceneConstant.M_HMI + TAG, "requestTrafficInfo")
|
||||||
|
bizProvider.requestAccidentInfo(
|
||||||
|
mPushData!!.infoId,
|
||||||
|
MoGoAiCloudClientConfig.getInstance().sn
|
||||||
|
) { trafficInfo: NoticeTrafficStyleInfo ->
|
||||||
|
d(SceneConstant.M_HMI + TAG, "交通事故详情::$trafficInfo")
|
||||||
|
mTrafficStyleInfo = trafficInfo.getResult().accidentInfo
|
||||||
|
infoRefresh(mTrafficStyleInfo)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun infoRefresh(info: NoticeTrafficAccountInfo?) {
|
||||||
|
if (dataArrayList.size > 0) {
|
||||||
|
dataArrayList.clear()
|
||||||
|
}
|
||||||
|
val laiYuan = NoticeValue()
|
||||||
|
laiYuan.key = "事故来源:"
|
||||||
|
laiYuan.value = info!!.uploadType
|
||||||
|
dataArrayList.add(laiYuan)
|
||||||
|
val cTime = NoticeValue()
|
||||||
|
cTime.key = "事故时间:"
|
||||||
|
cTime.value = DateTimeUtils.getTimeText(
|
||||||
|
info.dataCreateTime,
|
||||||
|
DateTimeUtils.MM_Yue_dd_Ri_HH_mm
|
||||||
|
)
|
||||||
|
dataArrayList.add(cTime)
|
||||||
|
val hTime = NoticeValue()
|
||||||
|
hTime.key = "处理时间:"
|
||||||
|
hTime.value = DateTimeUtils.getTimeText(
|
||||||
|
info.dataHandleTime,
|
||||||
|
DateTimeUtils.MM_Yue_dd_Ri_HH_mm
|
||||||
|
)
|
||||||
|
dataArrayList.add(hTime)
|
||||||
|
val reason = NoticeValue()
|
||||||
|
reason.key = "事故原因:"
|
||||||
|
reason.value = info.reason
|
||||||
|
dataArrayList.add(reason)
|
||||||
|
val status = NoticeValue()
|
||||||
|
status.key = "处理状态:"
|
||||||
|
if (info.operaStatus == "1") {
|
||||||
|
status.value = "待处理"
|
||||||
|
} else {
|
||||||
|
status.value = "已处理"
|
||||||
|
}
|
||||||
|
dataArrayList.add(status)
|
||||||
|
val location = NoticeValue()
|
||||||
|
location.key = "事故地点:"
|
||||||
|
location.value = info.uploadAddress
|
||||||
|
dataArrayList.add(location)
|
||||||
|
val style = NoticeValue()
|
||||||
|
style.key = "事故等级:"
|
||||||
|
style.value = info.troubleTypeName
|
||||||
|
dataArrayList.add(style)
|
||||||
|
adapter!!.setData(dataArrayList)
|
||||||
|
adapter!!.notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断网络状态
|
||||||
|
*/
|
||||||
|
private fun netWorkStatus() {
|
||||||
|
if (NetworkUtils.isAvailable(context)) {
|
||||||
|
d(SceneConstant.M_HMI + TAG, "网络可用")
|
||||||
|
thumbnailImage!!.visibility = View.GONE
|
||||||
|
connect!!.visibility = View.GONE
|
||||||
|
thumbnailImage!!.setBackgroundResource(R.drawable.notice_traffic_placeholder)
|
||||||
|
} else {
|
||||||
|
thumbnailImage!!.visibility = View.VISIBLE
|
||||||
|
thumbnailImage!!.setBackgroundResource(R.drawable.notice_unsuccess_traffic)
|
||||||
|
connect!!.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun cancel() {}
|
||||||
|
private fun releasePlayer() {
|
||||||
|
try {
|
||||||
|
GSYVideoManager.releaseAllVideos()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
e.printStackTrace()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun dismiss() {
|
||||||
|
super.dismiss()
|
||||||
|
d(SceneConstant.M_HMI + TAG, "trafficDialog dismiss")
|
||||||
|
noticeTrafficDialog = null
|
||||||
|
MogoStatusManager.getInstance().unregisterStatusChangedListener(
|
||||||
|
SceneConstant.M_HMI + TAG,
|
||||||
|
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||||
|
statusChangedListenerForNotice
|
||||||
|
)
|
||||||
|
releasePlayer()
|
||||||
|
}
|
||||||
|
|
||||||
|
private val statusChangedListenerForNotice =
|
||||||
|
IMogoStatusChangedListener { descriptor: StatusDescriptor, isTrue: Boolean ->
|
||||||
|
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||||
|
d(SceneConstant.M_HMI + TAG, "onStatusChanged==MAIN_PAGE_IS_BACKGROUND")
|
||||||
|
dismiss()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||||
|
|
||||||
|
import android.animation.Animator
|
||||||
|
import android.content.Context
|
||||||
|
import android.view.Gravity
|
||||||
|
import android.view.View
|
||||||
|
import android.view.WindowManager
|
||||||
|
import android.view.animation.OvershootInterpolator
|
||||||
|
import com.mogo.eagle.core.data.camera.CameraEntity
|
||||||
|
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig
|
||||||
|
import com.mogo.eagle.core.data.enums.SidePattern
|
||||||
|
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||||
|
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager
|
||||||
|
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
|
||||||
|
import com.mogo.eagle.core.function.hmi.notification.anim.DefaultAnimator
|
||||||
|
import com.mogo.eagle.core.function.hmi.ui.camera.CameraListView
|
||||||
|
import com.zhjt.service_biz.BizConfig
|
||||||
|
|
||||||
|
class CameraLiveView private constructor() {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
val cameraLiveView by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||||
|
CameraLiveView()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 超视距、路侧、前车直播
|
||||||
|
private var cameraListView: CameraListView? = null
|
||||||
|
private var cameraViewFloat: WarningFloat.Builder? = null
|
||||||
|
|
||||||
|
|
||||||
|
@BizConfig(FuncBizConfig.V2I, "", FuncBizConfig.BIZ_RTS)
|
||||||
|
fun showCameraList(
|
||||||
|
context: Context?,
|
||||||
|
cameraList: List<CameraEntity>?,
|
||||||
|
liveStatus: ((Boolean) -> Unit)
|
||||||
|
) {
|
||||||
|
context?.let {
|
||||||
|
if (cameraViewFloat == null) {
|
||||||
|
if (cameraListView == null) {
|
||||||
|
cameraListView = CameraListView(it)
|
||||||
|
cameraListView!!.updateCameraData(cameraList)
|
||||||
|
}
|
||||||
|
cameraListView!!.setClickListener(object : CameraListView.ClickListener {
|
||||||
|
override fun onClose(v: View) {
|
||||||
|
// Builder和cameraListView都置空
|
||||||
|
dismissFloatView()
|
||||||
|
// 丢弃开启摄像头推流请求,同时monitor回调hmi的startRoadCameraLive()
|
||||||
|
// 也做了cameraListView的非空判断
|
||||||
|
CallerFuncBizManager.bizProvider.closeCameraLive()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onShowLive(isShow: Boolean) {
|
||||||
|
liveStatus.invoke(isShow)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun refreshCameraList() {
|
||||||
|
cameraListView?.refreshCameraList(CallerFuncBizManager.bizProvider.getCameraList)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
cameraViewFloat = WarningFloat.with(it)
|
||||||
|
.setTag("CameraListFloat")
|
||||||
|
.setLayout(cameraListView!!)
|
||||||
|
.setSidePattern(SidePattern.RIGHT)
|
||||||
|
.setGravity(Gravity.RIGHT, -40, 255)
|
||||||
|
.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)
|
||||||
|
})
|
||||||
|
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||||
|
override fun onDismiss() {
|
||||||
|
cameraViewFloat = null
|
||||||
|
cameraListView = null
|
||||||
|
liveStatus.invoke(false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.show()
|
||||||
|
} else {
|
||||||
|
cameraViewFloat?.show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun startRoadCameraLive(flvUrl: String) {
|
||||||
|
cameraListView?.startRoadCameraLive(flvUrl)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun showNoSignView() {
|
||||||
|
cameraListView?.showNoSignal()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun dismissFloatView() {
|
||||||
|
cameraViewFloat?.let {
|
||||||
|
WarningFloat.dismiss(it.config.floatTag, false)
|
||||||
|
cameraViewFloat = null
|
||||||
|
cameraListView = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -52,7 +52,6 @@ import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManage
|
|||||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||||
import com.mogo.eagle.core.function.call.map.CallerHDMapManager
|
import com.mogo.eagle.core.function.call.map.CallerHDMapManager
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager
|
import com.mogo.eagle.core.function.call.map.CallerSmpManager
|
||||||
import com.mogo.eagle.core.function.call.obu.CallerOBUManager
|
import com.mogo.eagle.core.function.call.obu.CallerOBUManager
|
||||||
@@ -89,7 +88,9 @@ import kotlin.collections.component3
|
|||||||
import kotlin.collections.component4
|
import kotlin.collections.component4
|
||||||
import kotlin.collections.set
|
import kotlin.collections.set
|
||||||
import kotlin.math.abs
|
import kotlin.math.abs
|
||||||
|
import androidx.lifecycle.lifecycleScope
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
import com.mogo.eagle.core.utilcode.kotlin.lifecycleOwner
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author xiaoyuzhou
|
* @author xiaoyuzhou
|
||||||
@@ -97,7 +98,7 @@ import kotlin.math.abs
|
|||||||
* 调试使用的设置页面,这里只作为调试使用
|
* 调试使用的设置页面,这里只作为调试使用
|
||||||
* 展示 本机、网络、工控机、OBU等状态信息,支持设置IP,等参数进行调试
|
* 展示 本机、网络、工控机、OBU等状态信息,支持设置IP,等参数进行调试
|
||||||
*/
|
*/
|
||||||
class DebugSettingView @JvmOverloads constructor(
|
internal class DebugSettingView @JvmOverloads constructor(
|
||||||
context: Context,
|
context: Context,
|
||||||
attrs: AttributeSet? = null,
|
attrs: AttributeSet? = null,
|
||||||
defStyleAttr: Int = 0
|
defStyleAttr: Int = 0
|
||||||
@@ -196,8 +197,6 @@ class DebugSettingView @JvmOverloads constructor(
|
|||||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||||
// 添加 ADAS车辆状态&定位 监听
|
// 添加 ADAS车辆状态&定位 监听
|
||||||
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
|
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
|
||||||
// 添加 地图样式改变 监听
|
|
||||||
CallerMapLocationListenerManager.addListener(TAG, this, false)
|
|
||||||
// 添加 域控制器感知数据 监听
|
// 添加 域控制器感知数据 监听
|
||||||
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
|
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
|
||||||
// 添加 规划路径相关回调 监听
|
// 添加 规划路径相关回调 监听
|
||||||
@@ -224,7 +223,7 @@ class DebugSettingView @JvmOverloads constructor(
|
|||||||
logInfoView!!.onEnterForeground()
|
logInfoView!!.onEnterForeground()
|
||||||
}
|
}
|
||||||
// 开启定时查询速度
|
// 开启定时查询速度
|
||||||
Timer().schedule(timerTaskRefresh, Date(), 100)
|
Timer().schedule(timerTaskRefresh, Date(), 300)
|
||||||
if (AppConfigInfo.isConnectAutopilot && (AppConfigInfo.plateNumber.isNullOrEmpty() || AppConfigInfo.iPCMacAddress.isNullOrEmpty())) {
|
if (AppConfigInfo.isConnectAutopilot && (AppConfigInfo.plateNumber.isNullOrEmpty() || AppConfigInfo.iPCMacAddress.isNullOrEmpty())) {
|
||||||
//查询工控机基础配置信息
|
//查询工控机基础配置信息
|
||||||
CallerAutoPilotManager.getCarConfig()
|
CallerAutoPilotManager.getCarConfig()
|
||||||
@@ -240,7 +239,7 @@ class DebugSettingView @JvmOverloads constructor(
|
|||||||
// 移除 ADAS车辆状态&定位 监听
|
// 移除 ADAS车辆状态&定位 监听
|
||||||
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
|
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
|
||||||
// 移除 地图样式改变 监听
|
// 移除 地图样式改变 监听
|
||||||
CallerMapLocationListenerManager.removeListener(TAG, false)
|
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
|
||||||
// 移除 域控制器感知数据 监听
|
// 移除 域控制器感知数据 监听
|
||||||
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
|
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
|
||||||
// 移除 规划路径相关回调 监听
|
// 移除 规划路径相关回调 监听
|
||||||
@@ -1695,10 +1694,10 @@ class DebugSettingView @JvmOverloads constructor(
|
|||||||
}"
|
}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
val autopilotJson = GsonUtils.toJson(mAutoPilotStatusInfo)
|
||||||
tvAutopilotInfo.text = GsonUtils.toJson(mAutoPilotStatusInfo)
|
tvAutopilotInfo.text = autopilotJson
|
||||||
tvIpcInfo.text = GsonUtils.toJson(mAutoPilotStatusInfo)
|
tvIpcInfo.text = autopilotJson
|
||||||
tvIpcInfoKey.text = GsonUtils.toJson(mAutoPilotStatusInfo)
|
tvIpcInfoKey.text = autopilotJson
|
||||||
|
|
||||||
tvCarInfo.text =
|
tvCarInfo.text =
|
||||||
"GPS时间:${(mGnssInfo?.satelliteTime?.times(1000))?.toLong()}\n" +
|
"GPS时间:${(mGnssInfo?.satelliteTime?.times(1000))?.toLong()}\n" +
|
||||||
@@ -1743,18 +1742,20 @@ class DebugSettingView @JvmOverloads constructor(
|
|||||||
* OBU状态回调
|
* OBU状态回调
|
||||||
*/
|
*/
|
||||||
override fun onObuStatusResponse(obuStatusInfo: ObuStatusInfo) {
|
override fun onObuStatusResponse(obuStatusInfo: ObuStatusInfo) {
|
||||||
tvObuInfo.text = GsonUtils.toJson(obuStatusInfo)
|
lifecycleOwner.lifecycleScope.launch {
|
||||||
|
tvObuInfo.text = GsonUtils.toJson(obuStatusInfo)
|
||||||
|
|
||||||
AppConfigInfo.obuSdkVersion = obuStatusInfo.obuSdkVersion
|
AppConfigInfo.obuSdkVersion = obuStatusInfo.obuSdkVersion
|
||||||
AppConfigInfo.isConnectObu = obuStatusInfo.obuStatus
|
AppConfigInfo.isConnectObu = obuStatusInfo.obuStatus
|
||||||
|
|
||||||
if (obuStatusInfo.obuStatus) {
|
if (obuStatusInfo.obuStatus) {
|
||||||
obuConnectStatus = true
|
obuConnectStatus = true
|
||||||
}
|
}
|
||||||
//OBU断开连接,提示异常
|
//OBU断开连接,提示异常
|
||||||
if (obuConnectStatus && !obuStatusInfo.obuStatus) {
|
if (obuConnectStatus && !obuStatusInfo.obuStatus) {
|
||||||
obuConnectStatus = false
|
obuConnectStatus = false
|
||||||
toastMsg("OBU连接状态异常")
|
toastMsg("OBU连接状态异常")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||||
|
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
|
import android.content.Context
|
||||||
import android.graphics.PixelFormat
|
import android.graphics.PixelFormat
|
||||||
import android.util.DisplayMetrics
|
import android.util.DisplayMetrics
|
||||||
import android.view.*
|
import android.view.*
|
||||||
@@ -12,14 +13,36 @@ import com.mogo.eagle.core.data.report.ReportEntity
|
|||||||
import com.mogo.eagle.core.function.hmi.R
|
import com.mogo.eagle.core.function.hmi.R
|
||||||
import com.mogo.eagle.core.utilcode.mogo.toast.ResourcesHelper.getDrawable
|
import com.mogo.eagle.core.utilcode.mogo.toast.ResourcesHelper.getDrawable
|
||||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||||
import java.lang.reflect.Field
|
import com.mogo.eagle.core.utilcode.util.SoundUtils
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author XuXinChao
|
* @author XuXinChao
|
||||||
* @description 工控机异常节点上报
|
* @description 工控机异常节点上报
|
||||||
* @since: 2022/5/12
|
* @since: 2022/5/12
|
||||||
*/
|
*/
|
||||||
class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private const val TAG = "IPCReportWindow"
|
||||||
|
|
||||||
|
private var ipcReportWindow: IPCReportWindow? = null
|
||||||
|
|
||||||
|
fun show(
|
||||||
|
context: Context?,
|
||||||
|
errorReportList: ArrayList<ReportEntity>,
|
||||||
|
warningReportList: ArrayList<ReportEntity>,
|
||||||
|
reportLevel: Int
|
||||||
|
) {
|
||||||
|
context?.let {
|
||||||
|
if (ipcReportWindow == null) {
|
||||||
|
ipcReportWindow = IPCReportWindow(it as Activity)
|
||||||
|
SoundUtils.playRing(it)
|
||||||
|
}
|
||||||
|
ipcReportWindow?.showFloatWindow()
|
||||||
|
ipcReportWindow?.refreshData(errorReportList, warningReportList, reportLevel)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private var mActivity: Activity = activity
|
private var mActivity: Activity = activity
|
||||||
private var mWindowParams: WindowManager.LayoutParams? = null
|
private var mWindowParams: WindowManager.LayoutParams? = null
|
||||||
@@ -28,7 +51,7 @@ class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
|||||||
private lateinit var ivIpcClose: ImageView
|
private lateinit var ivIpcClose: ImageView
|
||||||
private lateinit var tvIpcErrorTab: TextView
|
private lateinit var tvIpcErrorTab: TextView
|
||||||
private lateinit var tvIpcWarningTab: TextView
|
private lateinit var tvIpcWarningTab: TextView
|
||||||
private var ipcReportAdapter: IPCReportAdapter?=null
|
private var ipcReportAdapter: IPCReportAdapter? = null
|
||||||
|
|
||||||
private lateinit var mFloatLayout: View
|
private lateinit var mFloatLayout: View
|
||||||
private var mInViewX = 0f
|
private var mInViewX = 0f
|
||||||
@@ -38,8 +61,6 @@ class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
|||||||
private var mInScreenX = 0f
|
private var mInScreenX = 0f
|
||||||
private var mInScreenY = 0f
|
private var mInScreenY = 0f
|
||||||
|
|
||||||
private var clickListener: ClickListener? = null
|
|
||||||
|
|
||||||
private var ipcErrorReportList: List<ReportEntity>? = null //错误上报列表
|
private var ipcErrorReportList: List<ReportEntity>? = null //错误上报列表
|
||||||
private var ipcWarningReportList: List<ReportEntity>? = null//警告上报列表
|
private var ipcWarningReportList: List<ReportEntity>? = null//警告上报列表
|
||||||
|
|
||||||
@@ -47,10 +68,11 @@ class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
|||||||
initFloatWindow();
|
initFloatWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initFloatWindow(){
|
private fun initFloatWindow() {
|
||||||
mFloatLayout = LayoutInflater.from(mActivity).inflate(R.layout.view_ipc_report, null) as View
|
mFloatLayout =
|
||||||
|
LayoutInflater.from(mActivity).inflate(R.layout.view_ipc_report, null) as View
|
||||||
mFloatLayout.setOnTouchListener(this)
|
mFloatLayout.setOnTouchListener(this)
|
||||||
rvIPCReport= mFloatLayout.findViewById(R.id.rv_ipc_report)
|
rvIPCReport = mFloatLayout.findViewById(R.id.rv_ipc_report)
|
||||||
ivIpcClose = mFloatLayout.findViewById(R.id.iv_ipc_close)
|
ivIpcClose = mFloatLayout.findViewById(R.id.iv_ipc_close)
|
||||||
tvIpcErrorTab = mFloatLayout.findViewById(R.id.tv_ipc_error_tab)
|
tvIpcErrorTab = mFloatLayout.findViewById(R.id.tv_ipc_error_tab)
|
||||||
tvIpcWarningTab = mFloatLayout.findViewById(R.id.tv_ipc_warning_tab)
|
tvIpcWarningTab = mFloatLayout.findViewById(R.id.tv_ipc_warning_tab)
|
||||||
@@ -65,35 +87,43 @@ class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
|||||||
it.alpha = 1.0f
|
it.alpha = 1.0f
|
||||||
}
|
}
|
||||||
ipcReportAdapter = IPCReportAdapter()
|
ipcReportAdapter = IPCReportAdapter()
|
||||||
rvIPCReport.layoutManager = WrapContentLinearLayoutManager(mActivity,
|
rvIPCReport.layoutManager = WrapContentLinearLayoutManager(
|
||||||
LinearLayoutManager.VERTICAL,false)
|
mActivity,
|
||||||
|
LinearLayoutManager.VERTICAL, false
|
||||||
|
)
|
||||||
rvIPCReport.adapter = ipcReportAdapter
|
rvIPCReport.adapter = ipcReportAdapter
|
||||||
//关闭按钮
|
//关闭按钮
|
||||||
ivIpcClose.setOnClickListener {
|
ivIpcClose.setOnClickListener {
|
||||||
clickListener?.closeWindow()
|
hideFloatWindow()
|
||||||
}
|
}
|
||||||
//错误列表
|
//错误列表
|
||||||
tvIpcErrorTab.setOnClickListener {
|
tvIpcErrorTab.setOnClickListener {
|
||||||
tvIpcErrorTab.background = getDrawable(mActivity,R.drawable.ipc_error_tab_normal_bg)
|
tvIpcErrorTab.background = getDrawable(mActivity, R.drawable.ipc_error_tab_normal_bg)
|
||||||
tvIpcWarningTab.background = getDrawable(mActivity,R.drawable.ipc_warning_tab_normal_bg)
|
tvIpcWarningTab.background =
|
||||||
|
getDrawable(mActivity, R.drawable.ipc_warning_tab_normal_bg)
|
||||||
ipcReportAdapter?.setData(ipcErrorReportList)
|
ipcReportAdapter?.setData(ipcErrorReportList)
|
||||||
ipcReportAdapter?.notifyDataSetChanged()
|
ipcReportAdapter?.notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
//预警列表
|
//预警列表
|
||||||
tvIpcWarningTab.setOnClickListener {
|
tvIpcWarningTab.setOnClickListener {
|
||||||
tvIpcErrorTab.background = getDrawable(mActivity,R.drawable.ipc_error_tab_select_bg)
|
tvIpcErrorTab.background = getDrawable(mActivity, R.drawable.ipc_error_tab_select_bg)
|
||||||
tvIpcWarningTab.background = getDrawable(mActivity,R.drawable.ipc_warning_tab_select_bg)
|
tvIpcWarningTab.background =
|
||||||
|
getDrawable(mActivity, R.drawable.ipc_warning_tab_select_bg)
|
||||||
ipcReportAdapter?.setData(ipcWarningReportList)
|
ipcReportAdapter?.setData(ipcWarningReportList)
|
||||||
ipcReportAdapter?.notifyDataSetChanged()
|
ipcReportAdapter?.notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun refreshData(errorReportList:List<ReportEntity>,warningReportList:List<ReportEntity>,reportLevel: Int){
|
fun refreshData(
|
||||||
if(reportLevel == 1){
|
errorReportList: List<ReportEntity>,
|
||||||
|
warningReportList: List<ReportEntity>,
|
||||||
|
reportLevel: Int
|
||||||
|
) {
|
||||||
|
if (reportLevel == 1) {
|
||||||
ipcReportAdapter?.setData(errorReportList)
|
ipcReportAdapter?.setData(errorReportList)
|
||||||
ipcErrorReportList = errorReportList
|
ipcErrorReportList = errorReportList
|
||||||
}else{
|
} else {
|
||||||
ipcReportAdapter?.setData(warningReportList)
|
ipcReportAdapter?.setData(warningReportList)
|
||||||
ipcWarningReportList = warningReportList
|
ipcWarningReportList = warningReportList
|
||||||
}
|
}
|
||||||
@@ -135,22 +165,16 @@ class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
|||||||
mWindowManager!!.defaultDisplay.getMetrics(metrics)
|
mWindowManager!!.defaultDisplay.getMetrics(metrics)
|
||||||
mWindowParams!!.x = metrics.widthPixels
|
mWindowParams!!.x = metrics.widthPixels
|
||||||
// mWindowParams!!.y = metrics.heightPixels / 2 - BarUtils.getStatusBarHeight()
|
// mWindowParams!!.y = metrics.heightPixels / 2 - BarUtils.getStatusBarHeight()
|
||||||
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight()-100
|
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight() - 100
|
||||||
mWindowManager!!.addView(mFloatLayout, mWindowParams)
|
mWindowManager!!.addView(mFloatLayout, mWindowParams)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun hideFloatWindow() {
|
private fun hideFloatWindow() {
|
||||||
if (mFloatLayout.parent != null) mWindowManager!!.removeView(mFloatLayout)
|
if (mFloatLayout.parent != null) {
|
||||||
|
mWindowManager!!.removeView(mFloatLayout)
|
||||||
|
}
|
||||||
|
ipcReportWindow = null
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setClickListener(clickListener: ClickListener) {
|
|
||||||
this.clickListener = clickListener
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ClickListener {
|
|
||||||
fun closeWindow()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,7 @@ import java.util.*
|
|||||||
/**
|
/**
|
||||||
* SOP设置窗口
|
* SOP设置窗口
|
||||||
*/
|
*/
|
||||||
class SOPSettingView @JvmOverloads constructor(
|
internal class SOPSettingView @JvmOverloads constructor(
|
||||||
context: Context,
|
context: Context,
|
||||||
attrs: AttributeSet? = null,
|
attrs: AttributeSet? = null,
|
||||||
defStyleAttr: Int = 0
|
defStyleAttr: Int = 0
|
||||||
@@ -78,6 +78,7 @@ class SOPSettingView @JvmOverloads constructor(
|
|||||||
/**
|
/**
|
||||||
* obu弱势交通控制
|
* obu弱势交通控制
|
||||||
*/
|
*/
|
||||||
|
tbObuWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowObuWeaknessTrafficView
|
||||||
tbObuWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
|
tbObuWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
|
||||||
if (!isChecked) { //默认开启
|
if (!isChecked) { //默认开启
|
||||||
CallerHmiManager.setObuWeaknessTraffic(true)
|
CallerHmiManager.setObuWeaknessTraffic(true)
|
||||||
@@ -89,6 +90,7 @@ class SOPSettingView @JvmOverloads constructor(
|
|||||||
/**
|
/**
|
||||||
* 云端弱势交通控制
|
* 云端弱势交通控制
|
||||||
*/
|
*/
|
||||||
|
tbCloudWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowCloudWeaknessTrafficView
|
||||||
tbCloudWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
|
tbCloudWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
|
||||||
if (isChecked) { //默认关闭
|
if (isChecked) { //默认关闭
|
||||||
CallerHmiManager.setCloudWeaknessTraffic(true)
|
CallerHmiManager.setCloudWeaknessTraffic(true)
|
||||||
|
|||||||
@@ -0,0 +1,80 @@
|
|||||||
|
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||||
|
|
||||||
|
import android.animation.Animator
|
||||||
|
import android.content.Context
|
||||||
|
import android.view.Gravity
|
||||||
|
import android.view.View
|
||||||
|
import android.view.WindowManager
|
||||||
|
import android.view.animation.OvershootInterpolator
|
||||||
|
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||||
|
import com.mogo.eagle.core.data.enums.SidePattern
|
||||||
|
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
|
||||||
|
import com.mogo.eagle.core.function.hmi.notification.anim.DefaultAnimator
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||||
|
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||||
|
|
||||||
|
class SopView private constructor(){
|
||||||
|
|
||||||
|
companion object{
|
||||||
|
val sopView by lazy(LazyThreadSafetyMode.SYNCHRONIZED){
|
||||||
|
SopView()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//SOPSettingView
|
||||||
|
private var mSOPSettingViewFloat: WarningFloat.Builder? = null
|
||||||
|
private var mSOPSettingView: SOPSettingView? = null
|
||||||
|
|
||||||
|
fun toggle(context: Context?, gravity: Int = Gravity.RIGHT, sidePattern: SidePattern = SidePattern.RIGHT) {
|
||||||
|
context?.let {
|
||||||
|
if (mSOPSettingViewFloat != null) {
|
||||||
|
WarningFloat.dismiss(mSOPSettingViewFloat!!.config.floatTag, false)
|
||||||
|
mSOPSettingViewFloat = null
|
||||||
|
mSOPSettingView = null
|
||||||
|
} else {
|
||||||
|
if (mSOPSettingView == null) {
|
||||||
|
mSOPSettingView = SOPSettingView(it)
|
||||||
|
}
|
||||||
|
// var side = SidePattern.RIGHT
|
||||||
|
// var gravity = Gravity.RIGHT
|
||||||
|
// //调试窗默认靠右显示,Bus的乘客端右端有视图覆盖,调试窗靠左显示
|
||||||
|
// if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
|
||||||
|
// AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||||
|
// ) {
|
||||||
|
// side = SidePattern.LEFT
|
||||||
|
// gravity = Gravity.LEFT
|
||||||
|
// }
|
||||||
|
mSOPSettingViewFloat = WarningFloat.with(it)
|
||||||
|
.setTag("mSOPSettingView")
|
||||||
|
.setLayout(mSOPSettingView!!)
|
||||||
|
.setSidePattern(sidePattern)
|
||||||
|
.setGravity(gravity, offsetY = 70)
|
||||||
|
.setImmersionStatusBar(true)
|
||||||
|
.setWindowWidth(AutoSizeUtils.dp2px(context, 800f))
|
||||||
|
.setWindowHeight(AutoSizeUtils.dp2px(context, 1100f))
|
||||||
|
.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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||||
|
|
||||||
|
import android.animation.Animator
|
||||||
|
import android.app.Activity
|
||||||
|
import android.content.Context
|
||||||
|
import android.view.Gravity
|
||||||
|
import android.view.View
|
||||||
|
import android.view.WindowManager
|
||||||
|
import android.view.animation.OvershootInterpolator
|
||||||
|
import com.mogo.eagle.core.data.enums.SidePattern
|
||||||
|
import com.mogo.eagle.core.data.report.ReportEntity
|
||||||
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||||
|
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
|
||||||
|
import com.mogo.eagle.core.function.hmi.notification.anim.DefaultAnimator
|
||||||
|
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||||
|
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||||
|
import mogo_msg.MogoReportMsg
|
||||||
|
|
||||||
|
class ToggleDebugView private constructor() : IMoGoAutopilotStatusListener {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
val toggleDebugView by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||||
|
ToggleDebugView()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// DebugSettingView
|
||||||
|
private var mDebugSettingViewFloat: WarningFloat.Builder? = null
|
||||||
|
private var mDebugSettingView: DebugSettingView? = null
|
||||||
|
|
||||||
|
//工控机节点上报列表
|
||||||
|
private val reportList = arrayListOf<ReportEntity>()
|
||||||
|
|
||||||
|
//工控机上报列表悬浮窗
|
||||||
|
private var reportListFloatWindow: ReportListFloatWindow? = null
|
||||||
|
|
||||||
|
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
|
||||||
|
super.onAutopilotGuardian(guardianInfo)
|
||||||
|
guardianInfo?.let {
|
||||||
|
if (reportList.size > 49) {
|
||||||
|
reportList.removeLast()
|
||||||
|
}
|
||||||
|
reportList.add(
|
||||||
|
0,
|
||||||
|
ReportEntity(
|
||||||
|
TimeUtils.millis2String(System.currentTimeMillis()),
|
||||||
|
it.src, it.level, it.msg, it.code, it.resultList, it.actionsList
|
||||||
|
)
|
||||||
|
)
|
||||||
|
reportListFloatWindow?.refreshData(reportList)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开关DebugView
|
||||||
|
*/
|
||||||
|
fun toggle(context: Context, gravity: Int = Gravity.RIGHT, sidePattern: SidePattern = SidePattern.RIGHT) {
|
||||||
|
if (mDebugSettingViewFloat != null) {
|
||||||
|
dismiss()
|
||||||
|
} else {
|
||||||
|
if (mDebugSettingView == null) {
|
||||||
|
mDebugSettingView = DebugSettingView(context)
|
||||||
|
mDebugSettingView?.reportInit(reportList)
|
||||||
|
mDebugSettingView?.setClickListener(object : DebugSettingView.ClickListener {
|
||||||
|
override fun showReportListWindow(show: Boolean) {
|
||||||
|
if (show) {
|
||||||
|
//打开工控机上报列表
|
||||||
|
reportListFloatWindow =
|
||||||
|
ReportListFloatWindow(context.applicationContext as Activity)
|
||||||
|
reportListFloatWindow?.showFloatWindow()
|
||||||
|
reportListFloatWindow?.refreshData(reportList)
|
||||||
|
} else {
|
||||||
|
//关闭工控机上报列表
|
||||||
|
reportListFloatWindow?.hideFloatWindow()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
mDebugSettingViewFloat = WarningFloat.with(context)
|
||||||
|
.setTag("DebugSettingView")
|
||||||
|
.setLayout(mDebugSettingView!!)
|
||||||
|
.setSidePattern(sidePattern)
|
||||||
|
.setGravity(gravity, offsetY = 70)
|
||||||
|
.setImmersionStatusBar(true)
|
||||||
|
.setWindowHeight(AutoSizeUtils.dp2px(context, 1100f))
|
||||||
|
.setWindowWidth(AutoSizeUtils.dp2px(context, 800f))
|
||||||
|
.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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun dismiss() {
|
||||||
|
mDebugSettingViewFloat?.let {
|
||||||
|
WarningFloat.dismiss(it.config.floatTag, false)
|
||||||
|
mDebugSettingViewFloat = null
|
||||||
|
mDebugSettingView = null
|
||||||
|
//关闭工控机上报列表
|
||||||
|
reportListFloatWindow?.hideFloatWindow()
|
||||||
|
reportListFloatWindow = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||||
|
|
||||||
|
import android.animation.Animator
|
||||||
|
import android.content.Context
|
||||||
|
import android.view.Gravity
|
||||||
|
import android.view.View
|
||||||
|
import android.view.WindowManager
|
||||||
|
import android.view.animation.OvershootInterpolator
|
||||||
|
import com.mogo.eagle.core.data.bindingcar.AdUpgradeStateHelper
|
||||||
|
import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
|
||||||
|
import com.mogo.eagle.core.data.enums.SidePattern
|
||||||
|
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||||
|
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||||
|
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
|
||||||
|
import com.mogo.eagle.core.function.hmi.notification.anim.DefaultAnimator
|
||||||
|
import com.mogo.eagle.core.function.hmi.ui.setting.SopView.Companion.sopView
|
||||||
|
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView.Companion.toggleDebugView
|
||||||
|
import com.mogo.eagle.core.function.hmi.ui.tools.AutoPilotAndCheckView
|
||||||
|
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||||
|
|
||||||
|
class ToolsView private constructor() {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
val toolsView by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||||
|
ToolsView()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private var toolsView: AutoPilotAndCheckView? = null
|
||||||
|
|
||||||
|
// 检测、自动驾驶速度设置
|
||||||
|
private var toolsViewFloat: WarningFloat.Builder? = null
|
||||||
|
|
||||||
|
fun showToolsFloat(context: Context?) {
|
||||||
|
context?.let {
|
||||||
|
if (toolsViewFloat == null) {
|
||||||
|
if (toolsView == null) {
|
||||||
|
toolsView = AutoPilotAndCheckView(it)
|
||||||
|
toolsView!!.setClickListener(object : AutoPilotAndCheckView.ClickListener {
|
||||||
|
override fun onClose(v: View) {
|
||||||
|
dismissToolsFloatView()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun showDebugPanelView() {
|
||||||
|
toggleDebugView.toggle(it)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun showFeedbackView() {
|
||||||
|
dismissToolsFloatView()
|
||||||
|
CallerDevaToolsManager.showFeedbackView(it)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun showSOPSettingView() {
|
||||||
|
sopView.toggle(it)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
toolsViewFloat = WarningFloat.with(it)
|
||||||
|
.setTag("ToolsViewFloat")
|
||||||
|
.setLayout(toolsView!!)
|
||||||
|
.setSidePattern(SidePattern.LEFT)
|
||||||
|
.setGravity(Gravity.LEFT)
|
||||||
|
.setImmersionStatusBar(true)
|
||||||
|
.setWindowHeight(WindowManager.LayoutParams.MATCH_PARENT)
|
||||||
|
.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)
|
||||||
|
})
|
||||||
|
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||||
|
override fun onDismiss() {
|
||||||
|
toolsViewFloat = null
|
||||||
|
toolsView = null
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.show()
|
||||||
|
} else {
|
||||||
|
toolsViewFloat?.show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun showAdUpgradeStatus(ipcUpgradeStateInfo: IPCUpgradeStateInfo){
|
||||||
|
toolsView?.showAdUpgradeStatus(ipcUpgradeStateInfo)
|
||||||
|
ipcUpgradeStateInfo.status.let {
|
||||||
|
if (AdUpgradeStateHelper.isUpgradeSuccess(it)) {
|
||||||
|
ToastUtils.showLong("升级成功")
|
||||||
|
AdUpgradeStateHelper.setConfirmUpgrade(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun dismissToolsFloatView() {
|
||||||
|
toolsViewFloat?.let {
|
||||||
|
WarningFloat.dismiss(it.config.floatTag, false)
|
||||||
|
toolsViewFloat = null
|
||||||
|
toolsView = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun dismiss() {
|
||||||
|
dismissToolsFloatView()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.mogo.eagle.core.function.hmi.ui.switch
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import android.view.View
|
||||||
|
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||||
|
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.hmi.ui.widget.DemoModeView
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||||
|
|
||||||
|
class DemoModeHiddenSwitch(context: Context?, attrs: AttributeSet?) : View(context, attrs) {
|
||||||
|
|
||||||
|
override fun onAttachedToWindow() {
|
||||||
|
super.onAttachedToWindow()
|
||||||
|
setOnClickListener {
|
||||||
|
//只在司机端设置美化模式开关功能
|
||||||
|
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||||
|
//单次查询,是否有行程信息(订单进行中时点击不生效),autopilotControlParameters为null代表不处于自动驾驶状态下
|
||||||
|
if (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().autopilotControlParameters == null) {
|
||||||
|
FunctionBuildConfig.isDemoMode = !FunctionBuildConfig.isDemoMode
|
||||||
|
context?.let {
|
||||||
|
CallerHmiManager.updateStatusBarLeftView(
|
||||||
|
FunctionBuildConfig.isDemoMode,
|
||||||
|
"demoMode",
|
||||||
|
DemoModeView(it)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode)
|
||||||
|
if (!FunctionBuildConfig.isDemoMode) {
|
||||||
|
//关闭美化模式时,通知工控机
|
||||||
|
CallerAutoPilotManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,16 +3,85 @@ package com.mogo.eagle.core.function.hmi.ui.takeover
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||||
|
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||||
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||||
|
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||||
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||||
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||||
import com.mogo.eagle.core.function.hmi.R
|
import com.mogo.eagle.core.function.hmi.R
|
||||||
|
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||||
|
import com.zhidao.support.adas.high.common.MogoReport
|
||||||
|
import mogo_msg.MogoReportMsg
|
||||||
|
|
||||||
class TakeOverView @JvmOverloads constructor(
|
class TakeOverView @JvmOverloads constructor(
|
||||||
context: Context,
|
context: Context,
|
||||||
attrs: AttributeSet? = null,
|
attrs: AttributeSet? = null,
|
||||||
defStyleAttr: Int = 0
|
defStyleAttr: Int = 0
|
||||||
) : ConstraintLayout(context, attrs, defStyleAttr) {
|
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val TAG = "TakeOverView"
|
||||||
|
}
|
||||||
|
|
||||||
init {
|
init {
|
||||||
LayoutInflater.from(context).inflate(R.layout.view_take_over, this, true)
|
LayoutInflater.from(context).inflate(R.layout.view_take_over, this, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var takeOver = false
|
||||||
|
|
||||||
|
override fun onAttachedToWindow() {
|
||||||
|
super.onAttachedToWindow()
|
||||||
|
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工控机监控节点上报
|
||||||
|
*/
|
||||||
|
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
|
||||||
|
super.onAutopilotGuardian(guardianInfo)
|
||||||
|
ThreadUtils.runOnUiThread {
|
||||||
|
guardianInfo?.let {
|
||||||
|
if (FunctionBuildConfig.isDemoMode) {
|
||||||
|
return@let
|
||||||
|
}
|
||||||
|
if (takeOver) {
|
||||||
|
return@let
|
||||||
|
}
|
||||||
|
when (it.code) {
|
||||||
|
MogoReport.Code.Error.EMAP.EXIT_AUTOPILOT_FOR_PLANNING,
|
||||||
|
MogoReport.Code.Error.EMAP.EXIT_AUTOPILOT_FOR_LOCATION,
|
||||||
|
MogoReport.Code.Error.EMAP.EXIT_AUTOPILOT_FOR_CHASSIS,
|
||||||
|
MogoReport.Code.Error.EMAP.EXIT_AUTOPILOT_FOR_DISTANCE -> {
|
||||||
|
CallerHmiManager.warningV2X(
|
||||||
|
EventTypeEnum.TAKE_OVER_EVENT.poiType,
|
||||||
|
EventTypeEnum.TAKE_OVER_EVENT.content,
|
||||||
|
EventTypeEnum.TAKE_OVER_EVENT.tts,
|
||||||
|
EventTypeEnum.TAKE_OVER_EVENT.poiType,
|
||||||
|
object : IMoGoWarningStatusListener {
|
||||||
|
override fun onShow() {
|
||||||
|
takeOver = true
|
||||||
|
visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDismiss() {
|
||||||
|
takeOver = false
|
||||||
|
visibility = View.GONE
|
||||||
|
}
|
||||||
|
},
|
||||||
|
true,
|
||||||
|
6000L
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDetachedFromWindow() {
|
||||||
|
super.onDetachedFromWindow()
|
||||||
|
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -3,55 +3,79 @@ package com.mogo.eagle.core.function.hmi.ui.tools
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import androidx.lifecycle.LifecycleObserver
|
import androidx.lifecycle.LifecycleObserver
|
||||||
|
import com.mogo.eagle.core.data.bindingcar.AdUpgradeStateHelper
|
||||||
|
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||||
import com.mogo.eagle.core.function.hmi.R
|
import com.mogo.eagle.core.function.hmi.R
|
||||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||||
|
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author XuXinChao
|
* @author XuXinChao
|
||||||
* @description 工控机确认升级对话框
|
* @description 工控机确认升级对话框
|
||||||
* @since: 2022/1/13
|
* @since: 2022/1/13
|
||||||
*/
|
*/
|
||||||
class AdUpgradeDialog(context: Context,images: List<String>,padSn: String,releaseId: String)
|
class AdUpgradeDialog(context: Context, images: List<String>, padSn: String, releaseId: String) :
|
||||||
: BaseFloatDialog(context), LifecycleObserver {
|
BaseFloatDialog(context), LifecycleObserver {
|
||||||
|
|
||||||
private var upgradeConfirm : TextView? = null
|
companion object {
|
||||||
private var upgradeCancel : TextView? = null
|
private var adUpgradeDialog: AdUpgradeDialog? = null
|
||||||
|
|
||||||
|
fun show(context: Context?, images: List<String>, padSn: String, releaseId: String) {
|
||||||
|
context?.let {
|
||||||
|
if (adUpgradeDialog == null) {
|
||||||
|
adUpgradeDialog = AdUpgradeDialog(it, images, padSn, releaseId)
|
||||||
|
}
|
||||||
|
adUpgradeDialog?.let { dialog ->
|
||||||
|
if (dialog.isShowing) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dialog.show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private var upgradeConfirm: TextView? = null
|
||||||
|
private var upgradeCancel: TextView? = null
|
||||||
|
|
||||||
private var clickListener: ClickListener? = null
|
private var clickListener: ClickListener? = null
|
||||||
|
|
||||||
private var images: List<String>?=null
|
private var images: List<String>? = null
|
||||||
private var padSn: String?=null
|
private var padSn: String? = null
|
||||||
private var releaseId: String?=null
|
private var releaseId: String? = null
|
||||||
|
|
||||||
init {
|
init {
|
||||||
setContentView(R.layout.dialog_ad_upgrade)
|
setContentView(R.layout.dialog_ad_upgrade)
|
||||||
setCanceledOnTouchOutside(false)
|
setCanceledOnTouchOutside(false)
|
||||||
upgradeConfirm=findViewById(R.id.tv_upgrade_confirm)
|
upgradeConfirm = findViewById(R.id.tv_upgrade_confirm)
|
||||||
upgradeCancel=findViewById(R.id.tv_upgrade_cancel)
|
upgradeCancel = findViewById(R.id.tv_upgrade_cancel)
|
||||||
|
|
||||||
upgradeConfirm?.setOnClickListener{
|
|
||||||
clickListener?.confirm()
|
|
||||||
}
|
|
||||||
upgradeCancel?.setOnClickListener {
|
|
||||||
clickListener?.cancel()
|
|
||||||
}
|
|
||||||
this.images = images
|
this.images = images
|
||||||
this.padSn = padSn
|
this.padSn = padSn
|
||||||
this.releaseId = releaseId
|
this.releaseId = releaseId
|
||||||
|
|
||||||
|
upgradeConfirm?.setOnClickListener {
|
||||||
|
//确认升级
|
||||||
|
CallerDevaToolsManager.upgradeConfirm(images, padSn, releaseId)
|
||||||
|
AdUpgradeStateHelper.setConfirmUpgrade(true)
|
||||||
|
ToastUtils.showLong("最新版本下载中...")
|
||||||
|
dismiss()
|
||||||
|
}
|
||||||
|
upgradeCancel?.setOnClickListener {
|
||||||
|
dismiss()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun dismiss() {
|
||||||
|
super.dismiss()
|
||||||
|
adUpgradeDialog = null
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setClickListener(clickListener: ClickListener) {
|
fun setClickListener(clickListener: ClickListener) {
|
||||||
this.clickListener = clickListener
|
this.clickListener = clickListener
|
||||||
}
|
}
|
||||||
|
|
||||||
fun showUpgradeDialog(){
|
interface ClickListener {
|
||||||
if(isShowing){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
show()
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ClickListener{
|
|
||||||
fun confirm()
|
fun confirm()
|
||||||
fun cancel()
|
fun cancel()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import kotlin.system.exitProcess
|
|||||||
* @author ChenFufeng
|
* @author ChenFufeng
|
||||||
* 设置自动驾驶速度和检测页入口
|
* 设置自动驾驶速度和检测页入口
|
||||||
*/
|
*/
|
||||||
class AutoPilotAndCheckView @JvmOverloads constructor(
|
internal class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||||
context: Context,
|
context: Context,
|
||||||
attrs: AttributeSet? = null,
|
attrs: AttributeSet? = null,
|
||||||
defStyleAttr: Int = 0
|
defStyleAttr: Int = 0
|
||||||
@@ -165,7 +165,7 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
|
|||||||
MsgBoxConfig.setUserRecord(0)
|
MsgBoxConfig.setUserRecord(0)
|
||||||
}
|
}
|
||||||
actvLoginout.visibility = View.VISIBLE
|
actvLoginout.visibility = View.VISIBLE
|
||||||
CallerHmiManager.setBusOperationView(toolBusOperationView)
|
toolBusOperationView.showBusOperation()
|
||||||
|
|
||||||
// TODO 这里判断方式可以替换为使用 AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)等进行替换
|
// TODO 这里判断方式可以替换为使用 AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)等进行替换
|
||||||
when (DebugConfig.getProductFlavor()) {
|
when (DebugConfig.getProductFlavor()) {
|
||||||
@@ -199,7 +199,6 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
|
|||||||
systemVersionView?.showAdUpgradeStatus(ipcUpgradeStateInfo)
|
systemVersionView?.showAdUpgradeStatus(ipcUpgradeStateInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun onAttachedToWindow() {
|
override fun onAttachedToWindow() {
|
||||||
super.onAttachedToWindow()
|
super.onAttachedToWindow()
|
||||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import android.content.Context
|
|||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import android.widget.LinearLayout
|
||||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||||
import com.mogo.eagle.core.data.temp.EventLogout
|
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.function.hmi.R
|
||||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||||
@@ -23,7 +23,7 @@ class BusOperationView @JvmOverloads constructor(
|
|||||||
context: Context?,
|
context: Context?,
|
||||||
attrs: AttributeSet? = null,
|
attrs: AttributeSet? = null,
|
||||||
defStyleAttr: Int = 0)
|
defStyleAttr: Int = 0)
|
||||||
: IOchBusView(context, attrs, defStyleAttr) {
|
: LinearLayout(context, attrs, defStyleAttr) {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
LayoutInflater.from(context).inflate(R.layout.view_och_bus_operation,this,true)
|
LayoutInflater.from(context).inflate(R.layout.view_och_bus_operation,this,true)
|
||||||
@@ -47,15 +47,11 @@ class BusOperationView @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun showBusOperation() {
|
fun showBusOperation() {
|
||||||
ochBusOperationStatus.visibility = View.VISIBLE
|
ochBusOperationStatus.visibility = View.VISIBLE
|
||||||
initPersonalIcon()
|
initPersonalIcon()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun changerOperationStatus(isOut: Boolean) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onAttachedToWindow() {
|
override fun onAttachedToWindow() {
|
||||||
super.onAttachedToWindow()
|
super.onAttachedToWindow()
|
||||||
context?.let {
|
context?.let {
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
package com.mogo.eagle.core.function.hmi.ui.tools
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
|
||||||
import android.content.Context
|
|
||||||
import android.graphics.Color
|
|
||||||
import android.graphics.drawable.ColorDrawable
|
|
||||||
import android.util.AttributeSet
|
|
||||||
import android.view.LayoutInflater
|
|
||||||
import android.widget.FrameLayout
|
|
||||||
import com.mogo.eagle.core.function.hmi.R
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author lixiaopeng
|
|
||||||
* 蒙层view
|
|
||||||
*/
|
|
||||||
class MaskView @JvmOverloads constructor(
|
|
||||||
context: Context,
|
|
||||||
attrs: AttributeSet? = null,
|
|
||||||
defStyleAttr: Int = 0
|
|
||||||
) : FrameLayout(
|
|
||||||
context,
|
|
||||||
attrs,
|
|
||||||
defStyleAttr
|
|
||||||
) {
|
|
||||||
|
|
||||||
private val TAG = "MaskView"
|
|
||||||
|
|
||||||
init {
|
|
||||||
LayoutInflater.from(context).inflate(R.layout.view_mask, this, true)
|
|
||||||
initView()
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
private var speedLimit: Double = 0.0
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
|
||||||
private fun initView() {
|
|
||||||
// background = ColorDrawable(Color.parseColor("#F0151D41"))
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.mogo.eagle.core.function.hmi.ui.tools
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||||
|
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.ToolsView_TAG
|
||||||
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||||
|
import com.mogo.eagle.core.function.hmi.R
|
||||||
|
import com.mogo.eagle.core.function.hmi.ui.setting.ToolsView.Companion.toolsView
|
||||||
|
|
||||||
|
class ToolsImageView(context: Context, attrs: AttributeSet?) :
|
||||||
|
androidx.appcompat.widget.AppCompatImageView(context, attrs), IViewControlListener {
|
||||||
|
|
||||||
|
override fun onAttachedToWindow() {
|
||||||
|
super.onAttachedToWindow()
|
||||||
|
setBackgroundResource(R.drawable.module_ext_check)
|
||||||
|
setImageResource(R.drawable.icon_tools_nor)
|
||||||
|
scaleType = ScaleType.CENTER
|
||||||
|
setOnClickListener{
|
||||||
|
toolsView.showToolsFloat(context)
|
||||||
|
}
|
||||||
|
|
||||||
|
CallerHmiViewControlListenerManager.addListener(ToolsView_TAG, this)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun visible(v: Int) {
|
||||||
|
super.visible(v)
|
||||||
|
visibility = v
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDetachedFromWindow() {
|
||||||
|
super.onDetachedFromWindow()
|
||||||
|
CallerHmiViewControlListenerManager.removeListener(ToolsView_TAG)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,11 +8,14 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
|||||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||||
|
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||||
|
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.AutoPilotStatusView_TAG
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
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.CallerAutoPilotStatusListenerManager
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lat
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lat
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lon
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lon
|
||||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
|
||||||
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||||
import com.mogo.eagle.core.function.hmi.R
|
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.CallerLogger
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||||
@@ -25,18 +28,21 @@ import kotlinx.android.synthetic.main.view_autopilot_status.view.*
|
|||||||
* @date 2021/9/22 3:59 下午
|
* @date 2021/9/22 3:59 下午
|
||||||
* 自动驾驶状态按钮
|
* 自动驾驶状态按钮
|
||||||
*/
|
*/
|
||||||
class AutoPilotStatusView @JvmOverloads constructor(
|
class AutoPilotStatusView constructor(
|
||||||
context: Context,
|
context: Context,
|
||||||
attrs: AttributeSet
|
attrs: AttributeSet
|
||||||
) : ConstraintLayout(context, attrs),
|
) : ConstraintLayout(context, attrs),
|
||||||
View.OnClickListener,
|
View.OnClickListener,
|
||||||
IMoGoAutopilotStatusListener {
|
IMoGoAutopilotStatusListener, IViewControlListener {
|
||||||
|
|
||||||
private val TAG = "AutopilotStatusView"
|
companion object {
|
||||||
|
const val TAG = "AutopilotStatusView"
|
||||||
|
}
|
||||||
|
|
||||||
private var mAutopilotStatus: Int = 0
|
private var mAutopilotStatus: Int = 0
|
||||||
|
|
||||||
init {
|
override fun onAttachedToWindow() {
|
||||||
|
super.onAttachedToWindow()
|
||||||
initView(context)
|
initView(context)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,18 +57,22 @@ class AutoPilotStatusView @JvmOverloads constructor(
|
|||||||
setOnClickListener(this)
|
setOnClickListener(this)
|
||||||
// 自动驾驶状态监听
|
// 自动驾驶状态监听
|
||||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||||
|
CallerHmiViewControlListenerManager.addListener(AutoPilotStatusView_TAG, this)
|
||||||
|
|
||||||
CallerLogger.d("$M_HMI$TAG", "autopilotStatus: $mAutopilotStatus")
|
CallerLogger.d("$M_HMI$TAG", "autopilotStatus: $mAutopilotStatus")
|
||||||
setAutoPilotStatus(mAutopilotStatus)
|
setAutoPilotStatus(mAutopilotStatus)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun visible(v: Int) {
|
||||||
|
super.visible(v)
|
||||||
|
visibility = v
|
||||||
|
}
|
||||||
|
|
||||||
override fun onClick(v: View?) {
|
override fun onClick(v: View?) {
|
||||||
when (mAutopilotStatus) {
|
when (mAutopilotStatus) {
|
||||||
0 -> {// 不可自动驾驶,adas与工控机没有链接,或工控机异常
|
0 -> {// 不可自动驾驶,adas与工控机没有链接,或工控机异常
|
||||||
CallerLogger.e("$M_HMI$TAG", "不可自动驾驶,adas与工控机没有链接,或工控机异常,请检查")
|
CallerLogger.e("$M_HMI$TAG", "不可自动驾驶,adas与工控机没有链接,或工控机异常,请检查")
|
||||||
ToastUtils.showShort("不可自动驾驶,adas与工控机没有链接,或工控机异常,请检查")
|
ToastUtils.showShort("不可自动驾驶,adas与工控机没有链接,或工控机异常,请检查")
|
||||||
// TODO 这里临时触发自动驾驶能力,测试功过这里删除
|
|
||||||
//CallerHmiListenerManager.invokeCheckAutoPilotBtnListener(true)
|
|
||||||
}
|
}
|
||||||
1 -> {// 可自动驾驶,目前处于人工干预状态
|
1 -> {// 可自动驾驶,目前处于人工干预状态
|
||||||
CallerHmiListenerManager.invokeCheckAutoPilotBtnListener(true)
|
CallerHmiListenerManager.invokeCheckAutoPilotBtnListener(true)
|
||||||
@@ -85,7 +95,7 @@ class AutoPilotStatusView @JvmOverloads constructor(
|
|||||||
currentAutopilot.endName = "HYJC"
|
currentAutopilot.endName = "HYJC"
|
||||||
currentAutopilot.isSpeakVoice = false
|
currentAutopilot.isSpeakVoice = false
|
||||||
currentAutopilot.startLatLon =
|
currentAutopilot.startLatLon =
|
||||||
AutopilotControlParameters.AutoPilotLonLat(getCurWgs84Lat(),getCurWgs84Lon())
|
AutopilotControlParameters.AutoPilotLonLat(getCurWgs84Lat(), getCurWgs84Lon())
|
||||||
currentAutopilot.endLatLon =
|
currentAutopilot.endLatLon =
|
||||||
AutopilotControlParameters.AutoPilotLonLat(26.819716071924688, 112.57715442110867)
|
AutopilotControlParameters.AutoPilotLonLat(26.819716071924688, 112.57715442110867)
|
||||||
currentAutopilot.vehicleType = 10
|
currentAutopilot.vehicleType = 10
|
||||||
@@ -126,4 +136,10 @@ class AutoPilotStatusView @JvmOverloads constructor(
|
|||||||
setAutoPilotStatus(autoPilotStatusInfo.state)
|
setAutoPilotStatus(autoPilotStatusInfo.state)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onDetachedFromWindow() {
|
||||||
|
super.onDetachedFromWindow()
|
||||||
|
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||||
|
CallerHmiViewControlListenerManager.removeListener(AutoPilotStatusView_TAG)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||||
|
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.CameraView_TAG
|
||||||
|
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager
|
||||||
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||||
|
import com.mogo.eagle.core.function.hmi.R
|
||||||
|
import com.mogo.eagle.core.function.hmi.ui.setting.CameraLiveView.Companion.cameraLiveView
|
||||||
|
|
||||||
|
class CameraView(context: Context, attrs: AttributeSet?) :
|
||||||
|
androidx.appcompat.widget.AppCompatImageView(context, attrs), IViewControlListener {
|
||||||
|
|
||||||
|
override fun onAttachedToWindow() {
|
||||||
|
super.onAttachedToWindow()
|
||||||
|
setBackgroundResource(R.drawable.icon_camera_nor)
|
||||||
|
setOnClickListener {
|
||||||
|
cameraLiveView.showCameraList(
|
||||||
|
context,
|
||||||
|
CallerFuncBizManager.bizProvider.getCameraList
|
||||||
|
) { liveStatus ->
|
||||||
|
if (liveStatus) {
|
||||||
|
setBackgroundResource(R.drawable.icon_camera_selected)
|
||||||
|
} else {
|
||||||
|
setBackgroundResource(R.drawable.icon_camera_nor)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CallerHmiViewControlListenerManager.addListener(CameraView_TAG, this)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun visible(v: Int) {
|
||||||
|
super.visible(v)
|
||||||
|
visibility = v
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDetachedFromWindow() {
|
||||||
|
super.onDetachedFromWindow()
|
||||||
|
CallerHmiViewControlListenerManager.removeListener(CameraView_TAG)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,8 +20,8 @@ class LimitingVelocityView @JvmOverloads constructor(
|
|||||||
LayoutInflater.from(context).inflate(R.layout.view_limiting_speed_vr, this, true)
|
LayoutInflater.from(context).inflate(R.layout.view_limiting_speed_vr, this, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateLimitingSpeed(limitingSpeed: Int) {
|
override fun updateLimitingSpeed(limitingSpeed: Int, limitSource: Int) {
|
||||||
super.updateLimitingSpeed(limitingSpeed)
|
super.updateLimitingSpeed(limitingSpeed, limitSource)
|
||||||
tvLimitingVelocity.text = "$limitingSpeed"
|
tvLimitingVelocity.text = "$limitingSpeed"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,6 +5,9 @@ import android.util.AttributeSet
|
|||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.FrameLayout
|
import android.widget.FrameLayout
|
||||||
|
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||||
|
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.PerspectiveSwitchView_TAG
|
||||||
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
|
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
|
||||||
import com.mogo.eagle.core.function.hmi.R
|
import com.mogo.eagle.core.function.hmi.R
|
||||||
import com.mogo.map.uicontroller.VisualAngleMode
|
import com.mogo.map.uicontroller.VisualAngleMode
|
||||||
@@ -19,12 +22,20 @@ class PerspectiveSwitchView @JvmOverloads constructor(
|
|||||||
context: Context,
|
context: Context,
|
||||||
attrs: AttributeSet? = null,
|
attrs: AttributeSet? = null,
|
||||||
defStyleAttr: Int = 0
|
defStyleAttr: Int = 0
|
||||||
) : FrameLayout(context, attrs, defStyleAttr), View.OnClickListener {
|
) : FrameLayout(context, attrs, defStyleAttr), View.OnClickListener, IViewControlListener{
|
||||||
|
|
||||||
init {
|
override fun onAttachedToWindow() {
|
||||||
|
super.onAttachedToWindow()
|
||||||
LayoutInflater.from(context).inflate(R.layout.view_perspective_switch, this, true)
|
LayoutInflater.from(context).inflate(R.layout.view_perspective_switch, this, true)
|
||||||
setBackgroundResource(R.drawable.module_switch_map_bg)
|
setBackgroundResource(R.drawable.module_switch_map_bg)
|
||||||
setOnClickListener(this)
|
setOnClickListener(this)
|
||||||
|
|
||||||
|
CallerHmiViewControlListenerManager.addListener(PerspectiveSwitchView_TAG,this)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun visible(v: Int) {
|
||||||
|
super.visible(v)
|
||||||
|
visibility = v
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onClick(v: View?) {
|
override fun onClick(v: View?) {
|
||||||
@@ -41,4 +52,10 @@ class PerspectiveSwitchView @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onDetachedFromWindow() {
|
||||||
|
super.onDetachedFromWindow()
|
||||||
|
CallerHmiViewControlListenerManager.removeListener(PerspectiveSwitchView_TAG)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,10 @@ import android.widget.ImageView
|
|||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||||
|
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||||
|
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.TrafficLightView_TAG
|
||||||
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
|
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
|
||||||
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||||
import com.mogo.eagle.core.function.hmi.R
|
import com.mogo.eagle.core.function.hmi.R
|
||||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||||
@@ -20,7 +23,7 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
|||||||
context: Context?,
|
context: Context?,
|
||||||
attrs: AttributeSet? = null,
|
attrs: AttributeSet? = null,
|
||||||
defStyleAttr: Int = 0
|
defStyleAttr: Int = 0
|
||||||
) : IViewTrafficLight(context, attrs, defStyleAttr) {
|
) : IViewTrafficLight(context, attrs, defStyleAttr), IViewControlListener {
|
||||||
private var mLightIconIV: ImageView? = null
|
private var mLightIconIV: ImageView? = null
|
||||||
private var mLightIconBG: ImageView? = null
|
private var mLightIconBG: ImageView? = null
|
||||||
private var mLightTimeTV: GradientTextView? = null
|
private var mLightTimeTV: GradientTextView? = null
|
||||||
@@ -28,17 +31,26 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
|||||||
private var mLightSourceDivider: View? = null
|
private var mLightSourceDivider: View? = null
|
||||||
private var mCurrentLightId = 0
|
private var mCurrentLightId = 0
|
||||||
|
|
||||||
init {
|
override fun onAttachedToWindow() {
|
||||||
init(context)
|
super.onAttachedToWindow()
|
||||||
}
|
|
||||||
|
|
||||||
private fun init(context: Context?) {
|
|
||||||
LayoutInflater.from(context).inflate(R.layout.hmi_view_traffic_light, this, true)
|
LayoutInflater.from(context).inflate(R.layout.hmi_view_traffic_light, this, true)
|
||||||
mLightIconIV = findViewById(R.id.hmi_traffic_light_iv)
|
mLightIconIV = findViewById(R.id.hmi_traffic_light_iv)
|
||||||
mLightIconBG = findViewById(R.id.hmi_traffic_light_bg)
|
mLightIconBG = findViewById(R.id.hmi_traffic_light_bg)
|
||||||
mLightTimeTV = findViewById(R.id.hmi_traffic_light_time_tv)
|
mLightTimeTV = findViewById(R.id.hmi_traffic_light_time_tv)
|
||||||
mLightSourceTV = findViewById(R.id.hmi_traffic_light_source)
|
mLightSourceTV = findViewById(R.id.hmi_traffic_light_source)
|
||||||
mLightSourceDivider = findViewById(R.id.hmi_traffic_light_divider)
|
mLightSourceDivider = findViewById(R.id.hmi_traffic_light_divider)
|
||||||
|
|
||||||
|
CallerHmiViewControlListenerManager.addListener(TrafficLightView_TAG, this)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun visible(v: Int) {
|
||||||
|
super.visible(v)
|
||||||
|
visibility = v
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDetachedFromWindow() {
|
||||||
|
super.onDetachedFromWindow()
|
||||||
|
CallerHmiViewControlListenerManager.removeListener(TrafficLightView_TAG)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -47,11 +59,11 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
|||||||
* @param checkLightId 0-都是默认,1-红,2-黄,3-绿
|
* @param checkLightId 0-都是默认,1-红,2-黄,3-绿
|
||||||
* @param lightSource 1:云端下发;2:自车感知
|
* @param lightSource 1:云端下发;2:自车感知
|
||||||
*/
|
*/
|
||||||
override fun showWarningTrafficLight(checkLightId: Int,lightSource: Int) {
|
override fun showWarningTrafficLight(checkLightId: Int, lightSource: Int) {
|
||||||
super.showWarningTrafficLight(checkLightId,lightSource)
|
super.showWarningTrafficLight(checkLightId, lightSource)
|
||||||
mCurrentLightId = checkLightId
|
mCurrentLightId = checkLightId
|
||||||
if(!HmiBuildConfig.isShowTrafficLightView){
|
if (!HmiBuildConfig.isShowTrafficLightView) {
|
||||||
updateTrafficLightIcon(checkLightId,lightSource)
|
updateTrafficLightIcon(checkLightId, lightSource)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,24 +82,28 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
|||||||
super.disableCountdown()
|
super.disableCountdown()
|
||||||
UiThreadHandler.post {
|
UiThreadHandler.post {
|
||||||
// 小巴车的司机端需要展示红绿灯信号来源
|
// 小巴车的司机端需要展示红绿灯信号来源
|
||||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||||
&& AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)){
|
&& AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||||
|
) {
|
||||||
val lp = this.layoutParams as MarginLayoutParams
|
val lp = this.layoutParams as MarginLayoutParams
|
||||||
lp.width = context.resources.getDimension(R.dimen.dp_325).toInt()
|
lp.width = context.resources.getDimension(R.dimen.dp_325).toInt()
|
||||||
this.layoutParams = lp
|
this.layoutParams = lp
|
||||||
mLightSourceTV!!.visibility = VISIBLE
|
mLightSourceTV!!.visibility = VISIBLE
|
||||||
mLightSourceDivider!!.visibility = VISIBLE
|
mLightSourceDivider!!.visibility = VISIBLE
|
||||||
mLightTimeTV!!.visibility = GONE
|
mLightTimeTV!!.visibility = GONE
|
||||||
mLightSourceTV!!.setPadding(0,0,75,0)
|
mLightSourceTV!!.setPadding(0, 0, 75, 0)
|
||||||
mLightIconBG!!.layoutParams.width = context.resources.getDimension(R.dimen.dp_310).toInt()
|
mLightIconBG!!.layoutParams.width =
|
||||||
}else{
|
context.resources.getDimension(R.dimen.dp_310).toInt()
|
||||||
|
} else {
|
||||||
val lp = this.layoutParams as MarginLayoutParams
|
val lp = this.layoutParams as MarginLayoutParams
|
||||||
lp.width = context.resources.getDimension(R.dimen.hmi_traffic_light_icon_size).toInt()
|
lp.width =
|
||||||
|
context.resources.getDimension(R.dimen.hmi_traffic_light_icon_size).toInt()
|
||||||
this.layoutParams = lp
|
this.layoutParams = lp
|
||||||
mLightTimeTV!!.visibility = GONE
|
mLightTimeTV!!.visibility = GONE
|
||||||
mLightSourceDivider!!.visibility = View.GONE
|
mLightSourceDivider!!.visibility = View.GONE
|
||||||
mLightSourceTV!!.visibility = View.GONE
|
mLightSourceTV!!.visibility = View.GONE
|
||||||
mLightIconBG!!.layoutParams.width = context.resources.getDimension(R.dimen.dp_124).toInt()
|
mLightIconBG!!.layoutParams.width =
|
||||||
|
context.resources.getDimension(R.dimen.dp_124).toInt()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -176,7 +192,7 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
|||||||
* @param lightId 0-都是默认,1-红,2-黄,3-绿
|
* @param lightId 0-都是默认,1-红,2-黄,3-绿
|
||||||
* @param lightSource 1:云端下发;2:自车感知
|
* @param lightSource 1:云端下发;2:自车感知
|
||||||
*/
|
*/
|
||||||
private fun updateTrafficLightIcon(lightId: Int,lightSource: Int) {
|
private fun updateTrafficLightIcon(lightId: Int, lightSource: Int) {
|
||||||
UiThreadHandler.post {
|
UiThreadHandler.post {
|
||||||
when (lightId) {
|
when (lightId) {
|
||||||
1 -> {
|
1 -> {
|
||||||
@@ -193,7 +209,7 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
else -> this@SingleTrafficLightView.visibility = GONE
|
else -> this@SingleTrafficLightView.visibility = GONE
|
||||||
}
|
}
|
||||||
when(lightSource){
|
when (lightSource) {
|
||||||
1 -> {
|
1 -> {
|
||||||
mLightSourceTV!!.text = "云端下发"
|
mLightSourceTV!!.text = "云端下发"
|
||||||
}
|
}
|
||||||
@@ -207,26 +223,31 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun resetView(){
|
private fun resetView() {
|
||||||
// 小巴车的司机端需要展示红绿灯信号来源
|
// 小巴车的司机端需要展示红绿灯信号来源
|
||||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||||
&& AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)){
|
&& AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||||
|
) {
|
||||||
val lp = this.layoutParams as MarginLayoutParams
|
val lp = this.layoutParams as MarginLayoutParams
|
||||||
lp.width = context.resources.getDimension(R.dimen.hmi_traffic_light_bus_layout_width).toInt()
|
lp.width =
|
||||||
|
context.resources.getDimension(R.dimen.hmi_traffic_light_bus_layout_width).toInt()
|
||||||
this.layoutParams = lp
|
this.layoutParams = lp
|
||||||
mLightTimeTV!!.visibility = View.VISIBLE
|
mLightTimeTV!!.visibility = View.VISIBLE
|
||||||
mLightSourceDivider!!.visibility = View.VISIBLE
|
mLightSourceDivider!!.visibility = View.VISIBLE
|
||||||
mLightSourceTV!!.visibility = View.VISIBLE
|
mLightSourceTV!!.visibility = View.VISIBLE
|
||||||
mLightSourceTV!!.setPadding(0,0,0,0)
|
mLightSourceTV!!.setPadding(0, 0, 0, 0)
|
||||||
mLightIconBG!!.layoutParams.width = context.resources.getDimension(R.dimen.hmi_traffic_light_bus_bg_width).toInt()
|
mLightIconBG!!.layoutParams.width =
|
||||||
}else{
|
context.resources.getDimension(R.dimen.hmi_traffic_light_bus_bg_width).toInt()
|
||||||
|
} else {
|
||||||
val lp = this.layoutParams as MarginLayoutParams
|
val lp = this.layoutParams as MarginLayoutParams
|
||||||
lp.width = context.resources.getDimension(R.dimen.hmi_traffic_light_layout_width).toInt()
|
lp.width =
|
||||||
|
context.resources.getDimension(R.dimen.hmi_traffic_light_layout_width).toInt()
|
||||||
this.layoutParams = lp
|
this.layoutParams = lp
|
||||||
mLightTimeTV!!.visibility = View.VISIBLE
|
mLightTimeTV!!.visibility = View.VISIBLE
|
||||||
mLightSourceDivider!!.visibility = View.GONE
|
mLightSourceDivider!!.visibility = View.GONE
|
||||||
mLightSourceTV!!.visibility = View.GONE
|
mLightSourceTV!!.visibility = View.GONE
|
||||||
mLightIconBG!!.layoutParams.width = context.resources.getDimension(R.dimen.hmi_traffic_light_bg_width).toInt()
|
mLightIconBG!!.layoutParams.width =
|
||||||
|
context.resources.getDimension(R.dimen.hmi_traffic_light_bg_width).toInt()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user