Merge branch 'dev_robotaxi-d-app-module_240_230131_2.14.0' into test_robotaxi-d-app-module_240_230131_2.14.0.1
This commit is contained in:
@@ -15,6 +15,8 @@ import android.widget.FrameLayout
|
|||||||
import android.widget.ListView
|
import android.widget.ListView
|
||||||
import androidx.appcompat.widget.AppCompatImageView
|
import androidx.appcompat.widget.AppCompatImageView
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
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.storage.SharedPrefsMgr
|
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||||
import com.mogo.eagle.core.utilcode.util.*
|
import com.mogo.eagle.core.utilcode.util.*
|
||||||
import com.mogo.och.taxi.passenger.R
|
import com.mogo.och.taxi.passenger.R
|
||||||
@@ -136,6 +138,7 @@ object OverlayLeftViewUtils {
|
|||||||
subscribeOVERVIEW = Observable.timer(300, TimeUnit.MILLISECONDS)
|
subscribeOVERVIEW = Observable.timer(300, TimeUnit.MILLISECONDS)
|
||||||
.subscribe {
|
.subscribe {
|
||||||
EventBus.getDefault().post(UIStatus(UIStatus.OVERVIEW))
|
EventBus.getDefault().post(UIStatus(UIStatus.OVERVIEW))
|
||||||
|
CallerLogger.d(SceneConstant.M_TAXI_P + TAG, "发送Eventbus subscribeOVERVIEW")
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
EventBus.getDefault().post(FinishActivity())
|
EventBus.getDefault().post(FinishActivity())
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ if (!isAndroidTestBuild()) {
|
|||||||
LancetX {
|
LancetX {
|
||||||
enable true
|
enable true
|
||||||
enableInDebug true
|
enableInDebug true
|
||||||
|
logLevel "DEBUG"
|
||||||
|
|
||||||
weaveGroup {
|
weaveGroup {
|
||||||
anr_fix {
|
anr_fix {
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ public class SpaceWarningDialog extends Dialog {
|
|||||||
private TextView tvCancel;//取消
|
private TextView tvCancel;//取消
|
||||||
private Activity mActivity;
|
private Activity mActivity;
|
||||||
|
|
||||||
|
private ClickListener clickListener;
|
||||||
|
|
||||||
public SpaceWarningDialog(@NonNull Activity activity) {
|
public SpaceWarningDialog(@NonNull Activity activity) {
|
||||||
super(activity, R.style.bad_case_dialog);
|
super(activity, R.style.bad_case_dialog);
|
||||||
mActivity = activity;
|
mActivity = activity;
|
||||||
@@ -49,8 +51,11 @@ public class SpaceWarningDialog extends Dialog {
|
|||||||
//清理磁盘
|
//清理磁盘
|
||||||
tvCleanDisk.setOnClickListener(v -> {
|
tvCleanDisk.setOnClickListener(v -> {
|
||||||
//跳转录包管理页面
|
//跳转录包管理页面
|
||||||
if(mActivity!=null){
|
// if(mActivity!=null){
|
||||||
CallerDevaToolsManager.INSTANCE.showBadCaseManagerView(mActivity);
|
// CallerDevaToolsManager.INSTANCE.showBadCaseManagerView(mActivity);
|
||||||
|
// }
|
||||||
|
if(clickListener!=null){
|
||||||
|
clickListener.showBadCaseManagerView();
|
||||||
}
|
}
|
||||||
dismiss();
|
dismiss();
|
||||||
});
|
});
|
||||||
@@ -61,6 +66,10 @@ public class SpaceWarningDialog extends Dialog {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setClickListener(ClickListener clickListener){
|
||||||
|
this.clickListener = clickListener;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttachedToWindow() {
|
public void onAttachedToWindow() {
|
||||||
super.onAttachedToWindow();
|
super.onAttachedToWindow();
|
||||||
@@ -71,4 +80,8 @@ public class SpaceWarningDialog extends Dialog {
|
|||||||
super.onDetachedFromWindow();
|
super.onDetachedFromWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface ClickListener{
|
||||||
|
void showBadCaseManagerView();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,17 +80,4 @@
|
|||||||
android:progressDrawable="@drawable/space_warning_progress_bg"
|
android:progressDrawable="@drawable/space_warning_progress_bg"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
android:layout_marginTop="378px"
|
|
||||||
android:text="100G"
|
|
||||||
android:textColor="#FFFF6200"
|
|
||||||
android:textSize="43px"
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -64,13 +64,14 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvBagTime"
|
android:id="@+id/tvBagTime"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="110dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="#FFFFFFFF"
|
android:textColor="#FFFFFFFF"
|
||||||
android:textSize="26dp"
|
android:textSize="26dp"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintRight_toLeftOf="@id/ivBagAudio"
|
app:layout_constraintRight_toLeftOf="@id/ivBagAudio"
|
||||||
android:layout_marginEnd="30dp"
|
android:layout_marginEnd="30dp"
|
||||||
|
android:gravity="start"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|||||||
@@ -194,6 +194,9 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
|||||||
|
|
||||||
private var bagManagerEntity: BagManagerEntity = BagManagerEntity()
|
private var bagManagerEntity: BagManagerEntity = BagManagerEntity()
|
||||||
|
|
||||||
|
private var spaceWarningDialog: SpaceWarningDialog ?=null
|
||||||
|
private var isShowWarningDialog = false
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
}
|
}
|
||||||
@@ -407,13 +410,32 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
|||||||
super.onBagManagerResult(bagManager)
|
super.onBagManagerResult(bagManager)
|
||||||
//判断磁盘是否已满,展示预警弹窗
|
//判断磁盘是否已满,展示预警弹窗
|
||||||
UiThreadHandler.post{
|
UiThreadHandler.post{
|
||||||
if(bagManager.spaceInfoRespCount>0){
|
if(bagManager.reqType == 1){
|
||||||
for(spaceInfo in bagManager.spaceInfoRespList){
|
if(bagManager.spaceInfoRespCount>0){
|
||||||
for(bagSpaceInfo in spaceInfo.bagDirsSpaceInfoList){
|
for(spaceInfo in bagManager.spaceInfoRespList){
|
||||||
if(bagSpaceInfo.free == 0L){
|
for(bagSpaceInfo in spaceInfo.bagDirsSpaceInfoList){
|
||||||
//磁盘空间已满
|
if(bagSpaceInfo.free == 0L){
|
||||||
val spaceWarningDialog = SpaceWarningDialog(context as Activity)
|
//磁盘空间已满
|
||||||
spaceWarningDialog.show()
|
if(!isShowWarningDialog){
|
||||||
|
if(spaceWarningDialog == null){
|
||||||
|
spaceWarningDialog = SpaceWarningDialog(context as Activity)
|
||||||
|
spaceWarningDialog?.setClickListener(object:SpaceWarningDialog.ClickListener{
|
||||||
|
override fun showBadCaseManagerView() {
|
||||||
|
if(mBadCaseManagerView == null){
|
||||||
|
toggleBagManagerView()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
spaceWarningDialog?.let {
|
||||||
|
if(!it.isShowing){
|
||||||
|
it.show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
isShowWarningDialog = true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1729,6 +1751,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun showSmallFragment() {
|
override fun showSmallFragment() {
|
||||||
|
CallerLogger.d("$M_HMI$TAG", "showSmallFragment start!")
|
||||||
// 加载全览模式图层
|
// 加载全览模式图层
|
||||||
val fragmentOverview = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_OVERVIEW)
|
val fragmentOverview = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_OVERVIEW)
|
||||||
.navigation() as BaseFragment
|
.navigation() as BaseFragment
|
||||||
@@ -1745,9 +1768,11 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
|||||||
}.commitAllowingStateLoss()
|
}.commitAllowingStateLoss()
|
||||||
}
|
}
|
||||||
CallerDevaToolsManager.hideStatusBar()
|
CallerDevaToolsManager.hideStatusBar()
|
||||||
|
CallerLogger.d("$M_HMI$TAG", "showSmallFragment end!")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hideSmallFragment() {
|
override fun hideSmallFragment() {
|
||||||
|
CallerLogger.d("$M_HMI$TAG", "hideSmallFragment start!")
|
||||||
val fragmentOverview = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_OVERVIEW)
|
val fragmentOverview = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_OVERVIEW)
|
||||||
.navigation() as BaseFragment
|
.navigation() as BaseFragment
|
||||||
activity?.supportFragmentManager?.beginTransaction()
|
activity?.supportFragmentManager?.beginTransaction()
|
||||||
@@ -1757,6 +1782,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
?.commitAllowingStateLoss()
|
?.commitAllowingStateLoss()
|
||||||
|
CallerLogger.d("$M_HMI$TAG", "hideSmallFragment end!")
|
||||||
// context?.let { CallerDevaToolsManager.showStatusBar(it, statusBarContainer) }
|
// context?.let { CallerDevaToolsManager.showStatusBar(it, statusBarContainer) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,8 +63,8 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) {
|
|||||||
leftView?.setOnClickListener {
|
leftView?.setOnClickListener {
|
||||||
when {
|
when {
|
||||||
isConfirm -> {
|
isConfirm -> {
|
||||||
cacheHDOfflineData()
|
|
||||||
showNewContent(isLoading = true, false)
|
showNewContent(isLoading = true, false)
|
||||||
|
cacheHDOfflineData()
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
dismiss()
|
dismiss()
|
||||||
@@ -75,6 +75,7 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) {
|
|||||||
rightView?.setOnClickListener {
|
rightView?.setOnClickListener {
|
||||||
when {
|
when {
|
||||||
isRetry -> {
|
isRetry -> {
|
||||||
|
showNewContent(isLoading = true, false)
|
||||||
cacheHDOfflineData()
|
cacheHDOfflineData()
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
@@ -163,11 +164,14 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) {
|
|||||||
downloadResultImg?.background = ContextCompat.getDrawable(context, R.drawable.download_success_icon)
|
downloadResultImg?.background = ContextCompat.getDrawable(context, R.drawable.download_success_icon)
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
|
isRetry = true
|
||||||
|
isConfirm = false
|
||||||
offlineTitleView?.text = context.resources.getString(R.string.offline_download_failure)
|
offlineTitleView?.text = context.resources.getString(R.string.offline_download_failure)
|
||||||
okView?.visibility = View.GONE
|
okView?.visibility = View.GONE
|
||||||
progressBar?.visibility = View.GONE
|
progressBar?.visibility = View.GONE
|
||||||
downloadPercentView?.visibility = View.GONE
|
downloadPercentView?.visibility = View.GONE
|
||||||
leftView?.visibility = View.VISIBLE
|
leftView?.visibility = View.VISIBLE
|
||||||
|
leftView?.text = context.resources.getString(R.string.ok_tip)
|
||||||
rightView?.visibility = View.VISIBLE
|
rightView?.visibility = View.VISIBLE
|
||||||
vertLineView?.visibility = View.VISIBLE
|
vertLineView?.visibility = View.VISIBLE
|
||||||
rightView?.text = context.resources.getString(R.string.retry)
|
rightView?.text = context.resources.getString(R.string.retry)
|
||||||
|
|||||||
@@ -216,6 +216,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
|
|||||||
null,
|
null,
|
||||||
null
|
null
|
||||||
)
|
)
|
||||||
|
holder.tvOperationStatusSelect.text = "折叠"
|
||||||
holder.ivOperationImageNormal.visibility = View.GONE
|
holder.ivOperationImageNormal.visibility = View.GONE
|
||||||
holder.tvOperationTitleNormal.visibility = View.GONE
|
holder.tvOperationTitleNormal.visibility = View.GONE
|
||||||
holder.tvOperationContentNormal.visibility = View.GONE
|
holder.tvOperationContentNormal.visibility = View.GONE
|
||||||
@@ -230,6 +231,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
|
|||||||
null,
|
null,
|
||||||
null
|
null
|
||||||
)
|
)
|
||||||
|
holder.tvOperationStatusSelect.text = "展开"
|
||||||
holder.ivOperationImageNormal.visibility = View.VISIBLE
|
holder.ivOperationImageNormal.visibility = View.VISIBLE
|
||||||
holder.tvOperationTitleNormal.visibility = View.VISIBLE
|
holder.tvOperationTitleNormal.visibility = View.VISIBLE
|
||||||
holder.tvOperationContentNormal.visibility = View.VISIBLE
|
holder.tvOperationContentNormal.visibility = View.VISIBLE
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.mogo.eagle.core.function.hmi.ui.widget
|
|||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.util.Log
|
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||||
@@ -67,7 +66,6 @@ class VersionNameView @JvmOverloads constructor(
|
|||||||
if (!dockerVersion.isNullOrEmpty()) {
|
if (!dockerVersion.isNullOrEmpty()) {
|
||||||
it.text = " ; MAP:${dockerVersion}"
|
it.text = " ; MAP:${dockerVersion}"
|
||||||
}
|
}
|
||||||
Log.i(TAG,"tvMapVersionName text="+tvMapVersionName.text)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -90,7 +88,6 @@ class VersionNameView @JvmOverloads constructor(
|
|||||||
|
|
||||||
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
|
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
|
||||||
dockerVersion = autoPilotStatusInfo.dockVersion
|
dockerVersion = autoPilotStatusInfo.dockVersion
|
||||||
Log.i(TAG,"dockerVersion=$dockerVersion")
|
|
||||||
showCurrentMapVersion()
|
showCurrentMapVersion()
|
||||||
//将工控机版本赋值给BadCase配置常量
|
//将工控机版本赋值给BadCase配置常量
|
||||||
BadCaseConfig.dockerVersion = autoPilotStatusInfo.dockVersion
|
BadCaseConfig.dockerVersion = autoPilotStatusInfo.dockVersion
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
android:id="@+id/tvOperationStatusSelect"
|
android:id="@+id/tvOperationStatusSelect"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="折叠"
|
android:text="展开"
|
||||||
android:textColor="#FFFFFFFF"
|
android:textColor="#FFFFFFFF"
|
||||||
android:textSize="24dp"
|
android:textSize="24dp"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import android.util.*
|
|||||||
import androidx.localbroadcastmanager.content.*
|
import androidx.localbroadcastmanager.content.*
|
||||||
import com.mogo.cloud.passport.*
|
import com.mogo.cloud.passport.*
|
||||||
import com.mogo.commons.constants.HostConst
|
import com.mogo.commons.constants.HostConst
|
||||||
|
import com.mogo.commons.debug.DebugConfig
|
||||||
import com.mogo.commons.module.ServiceConst.CARD_TYPE_ROAD_CONDITION
|
import com.mogo.commons.module.ServiceConst.CARD_TYPE_ROAD_CONDITION
|
||||||
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
|
||||||
@@ -68,6 +69,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.*
|
|||||||
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.mogo.storage.*
|
import com.mogo.eagle.core.utilcode.mogo.storage.*
|
||||||
import com.mogo.eagle.core.utilcode.util.*
|
import com.mogo.eagle.core.utilcode.util.*
|
||||||
|
import com.mogo.eagle.core.utilcode.util.BuildConfig
|
||||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||||
import com.mogo.eagle.core.utilcode.util.Utils
|
import com.mogo.eagle.core.utilcode.util.Utils
|
||||||
import com.mogo.map.listener.*
|
import com.mogo.map.listener.*
|
||||||
@@ -112,7 +114,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
|
|||||||
V2XManager.init(V2XConfig.Builder().also {
|
V2XManager.init(V2XConfig.Builder().also {
|
||||||
it.aiCloudConfig(MoGoAiCloudClientConfig.getInstance())
|
it.aiCloudConfig(MoGoAiCloudClientConfig.getInstance())
|
||||||
it.context(context)
|
it.context(context)
|
||||||
it.loggable(true)
|
it.loggable(DebugConfig.isDebug())
|
||||||
it.distanceForTriggerRefresh(200f) //行驶超过200(包含)米,刷新道路周边信息(短链请求)
|
it.distanceForTriggerRefresh(200f) //行驶超过200(包含)米,刷新道路周边信息(短链请求)
|
||||||
it.durationForTriggerRefresh(
|
it.durationForTriggerRefresh(
|
||||||
60,
|
60,
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ public class V2XAlarmServer {
|
|||||||
CopyOnWriteArrayList<V2XRoadEventEntity> v2XRoadEventEntityList,
|
CopyOnWriteArrayList<V2XRoadEventEntity> v2XRoadEventEntityList,
|
||||||
MogoLocation currentLocation) {
|
MogoLocation currentLocation) {
|
||||||
try {
|
try {
|
||||||
Log.d("RWJ", "getDriveFrontAlarmEvent --- 1 ---" + currentLocation );
|
|
||||||
if (!showedEvents.isEmpty()) {
|
if (!showedEvents.isEmpty()) {
|
||||||
Iterator<V2XRoadEventEntity> iterator = showedEvents.iterator();
|
Iterator<V2XRoadEventEntity> iterator = showedEvents.iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
@@ -52,7 +51,6 @@ public class V2XAlarmServer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Log.d("RWJ", "getDriveFrontAlarmEvent --- 2 ---" + currentLocation);
|
|
||||||
if (currentLocation != null && v2XRoadEventEntityList != null) {
|
if (currentLocation != null && v2XRoadEventEntityList != null) {
|
||||||
// 因为集合是按照距离排序后的所以这里检索出来第一个就发出警告
|
// 因为集合是按照距离排序后的所以这里检索出来第一个就发出警告
|
||||||
for (V2XRoadEventEntity v2XRoadEventEntity : v2XRoadEventEntityList) {
|
for (V2XRoadEventEntity v2XRoadEventEntity : v2XRoadEventEntityList) {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.v2x.trafficlight.core
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
import android.util.Log
|
|
||||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
|
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
||||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuTrafficLightDisapperListener
|
import com.mogo.eagle.core.function.api.obu.IMoGoObuTrafficLightDisapperListener
|
||||||
@@ -61,8 +60,6 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
|
|||||||
* @param trafficLights 感知红绿灯
|
* @param trafficLights 感知红绿灯
|
||||||
*/
|
*/
|
||||||
override fun onAutopilotPerceptionTrafficLight(trafficLights: TrafficLightOuterClass.TrafficLights?) {
|
override fun onAutopilotPerceptionTrafficLight(trafficLights: TrafficLightOuterClass.TrafficLights?) {
|
||||||
Log.i(TAG,"hasObuLightStatus="+hasObuLightStatus + " hasAiLightStatus="+hasAiLightStatus)
|
|
||||||
Log.i(TAG,"时间:"+com.mogo.eagle.core.utilcode.util.TimeUtils.millis2String(System.currentTimeMillis()))
|
|
||||||
if (!hasObuLightStatus) {
|
if (!hasObuLightStatus) {
|
||||||
if (!hasAiLightStatus) {
|
if (!hasAiLightStatus) {
|
||||||
trafficLights?.let { it ->
|
trafficLights?.let { it ->
|
||||||
@@ -77,37 +74,30 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
|
|||||||
light = it.uTurn
|
light = it.uTurn
|
||||||
}
|
}
|
||||||
if (light == null) {
|
if (light == null) {
|
||||||
Log.i(TAG,"light为空")
|
|
||||||
//隐藏红绿灯显示
|
//隐藏红绿灯显示
|
||||||
TrafficLightHMIManager.INSTANCE.hideTrafficLight()
|
TrafficLightHMIManager.INSTANCE.hideTrafficLight()
|
||||||
} else {
|
} else {
|
||||||
Log.i(TAG,"light.state="+light.state)
|
|
||||||
when (light.state) {
|
when (light.state) {
|
||||||
TrafficLightOuterClass.LightState.STATE_RED -> {
|
TrafficLightOuterClass.LightState.STATE_RED -> {
|
||||||
Log.i(TAG,"显示红灯")
|
|
||||||
//红灯
|
//红灯
|
||||||
CallerHmiManager.showWarningTrafficLight(1, 2)
|
CallerHmiManager.showWarningTrafficLight(1, 2)
|
||||||
CallerHmiManager.changeCountdownGreen(0)
|
CallerHmiManager.changeCountdownGreen(0)
|
||||||
}
|
}
|
||||||
TrafficLightOuterClass.LightState.STATE_YELLOW -> {
|
TrafficLightOuterClass.LightState.STATE_YELLOW -> {
|
||||||
Log.i(TAG,"显示黄灯")
|
|
||||||
//黄灯
|
//黄灯
|
||||||
CallerHmiManager.showWarningTrafficLight(2, 2)
|
CallerHmiManager.showWarningTrafficLight(2, 2)
|
||||||
CallerHmiManager.changeCountdownGreen(0)
|
CallerHmiManager.changeCountdownGreen(0)
|
||||||
}
|
}
|
||||||
TrafficLightOuterClass.LightState.STATE_GREEN -> {
|
TrafficLightOuterClass.LightState.STATE_GREEN -> {
|
||||||
Log.i(TAG,"显示绿灯")
|
|
||||||
//绿灯
|
//绿灯
|
||||||
CallerHmiManager.showWarningTrafficLight(3, 2)
|
CallerHmiManager.showWarningTrafficLight(3, 2)
|
||||||
CallerHmiManager.changeCountdownGreen(0)
|
CallerHmiManager.changeCountdownGreen(0)
|
||||||
}
|
}
|
||||||
TrafficLightOuterClass.LightState.STATE_OFF -> {
|
TrafficLightOuterClass.LightState.STATE_OFF -> {
|
||||||
Log.i(TAG,"隐藏显示")
|
|
||||||
//黑灯,隐藏红绿灯显示
|
//黑灯,隐藏红绿灯显示
|
||||||
TrafficLightHMIManager.INSTANCE.hideTrafficLight()
|
TrafficLightHMIManager.INSTANCE.hideTrafficLight()
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
Log.i(TAG,"直接其他情况")
|
|
||||||
TrafficLightHMIManager.INSTANCE.hideTrafficLight()
|
TrafficLightHMIManager.INSTANCE.hideTrafficLight()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,10 +70,7 @@ public class AutopilotAbilityManager {
|
|||||||
String v = carConfig.getDockVersion();
|
String v = carConfig.getDockVersion();
|
||||||
int version = parseVersion(true, v);
|
int version = parseVersion(true, v);
|
||||||
if (version != -1) {
|
if (version != -1) {
|
||||||
if (startTimer != null) {
|
stopTimer();
|
||||||
startTimer.cancel();
|
|
||||||
startTimer = null;
|
|
||||||
}
|
|
||||||
dockerVersion = version;
|
dockerVersion = version;
|
||||||
Log.i("dddd", "工控机版本=" + dockerVersion);
|
Log.i("dddd", "工控机版本=" + dockerVersion);
|
||||||
initAutopilotAbility();
|
initAutopilotAbility();
|
||||||
@@ -161,6 +158,13 @@ public class AutopilotAbilityManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void stopTimer() {
|
||||||
|
if (startTimer != null) {
|
||||||
|
startTimer.cancel();
|
||||||
|
startTimer = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 连接工控机成功调用此函数,如果dockerVersion还未获取到将启动最低版本的启动自动驾驶能力检测
|
* 连接工控机成功调用此函数,如果dockerVersion还未获取到将启动最低版本的启动自动驾驶能力检测
|
||||||
* 此函数为保险措施 以防无法获取工控机版本时 也能 正常执行逻辑
|
* 此函数为保险措施 以防无法获取工控机版本时 也能 正常执行逻辑
|
||||||
@@ -182,6 +186,7 @@ public class AutopilotAbilityManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void stop() {
|
public synchronized void stop() {
|
||||||
|
stopTimer();
|
||||||
stop230();
|
stop230();
|
||||||
stop250();
|
stop250();
|
||||||
handler = null;
|
handler = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user