diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt index ee5ab1683a..a95885137b 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt @@ -38,6 +38,7 @@ import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager import com.mogo.eagle.core.function.call.check.CallerCheckManager import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager +import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager import com.mogo.eagle.core.function.call.monitor.CallerMonitorManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.hmi.WaringConst @@ -68,7 +69,6 @@ import kotlinx.coroutines.* import mogo_msg.MogoReportMsg import record_cache.RecordPanelOuterClass import java.util.* -import kotlin.collections.ArrayList /** @@ -945,28 +945,68 @@ import kotlin.collections.ArrayList } } + private var isLeftLight :Boolean = false + private var isRightLight :Boolean = false + private var isDisappare :Boolean = false + /** * 显示转向灯效果 if (HmiBuildConfig.isShowBadCaseView) { */ override fun showTurnLight(light: Int) { if (HmiBuildConfig.isShowTurnLightView) { ThreadUtils.runOnUiThread { - turnLightView?.let { - turnLightView.setTurnLight(light) + if (light == 1) { + if (!isLeftLight) { + isLeftLight = true + isRightLight = false + isDisappare = false + //TODO + CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(4, 500) + } + } else if (light == 2) { + if (!isRightLight) { + isRightLight = true + isLeftLight = false + isDisappare = false + CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500) + } + } else { + if (!isDisappare) { + isDisappare = true + isLeftLight = false + isRightLight = false + CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500) + } } + +// turnLightView?.let { +// turnLightView.setTurnLight(light) +// } } } } + private var isBrake: Boolean = false + /** * 显示刹车效果 */ override fun showBrakeLight(light: Int) { if (HmiBuildConfig.isShowBrakeLightView) { ThreadUtils.runOnUiThread { - brakeView?.let { - brakeView.setBrakeLight(light) + if (light == 1) { //刹车灯亮 + if (!isBrake) { + isBrake = true + CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(0, 500) + } + } else { + isBrake = false + CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500) } + +// brakeView?.let { +// brakeView.setBrakeLight(light) +// } } } } diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java index 43e803d811..77bdbca240 100644 --- a/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java +++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java @@ -178,6 +178,12 @@ public interface IMogoMapUIController { */ void setCarCursorOption(@Nullable CarCursorOption option); + /** + * + * @param type :车尾灯类型 time: 闪烁时间 最小500ms 小于500ms 默认为500ms + */ + void setCarLightsType(int type, int time); + /** * 获取地图视图描述快照 * diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.java b/libraries/mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.java index 4f682ea3d5..4c55b760bd 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.java @@ -639,6 +639,17 @@ public class AMapViewWrapper implements IMogoMapView, mMapView.getMapAutoViewHelper().setMyLocationStyle(style); } + /** + * 设置转向灯和刹车灯 + * @param type :车尾灯类型 time: 闪烁时间 最小500ms 小于500ms 默认为500ms + * @param time + */ + @Override + public void setCarLightsType(int type, int time) { + Log.d("liyz", "AMapViewWrapper setCarLightsType type = " + type + "---time = " + time); + mMapView.getMapAutoViewHelper().setTailLightsType(type, time); + } + @Override public MapCameraPosition getMapCameraPosition() { if (checkAMapView()) { diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java index c68c1ffddf..905938de63 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java @@ -3,6 +3,7 @@ package com.mogo.map; import android.graphics.Point; import android.graphics.Rect; import android.location.Location; +import android.util.Log; import android.view.View; import com.mogo.eagle.core.data.map.CenterLine; @@ -252,6 +253,15 @@ public class MogoMapUIController implements IMogoMapUIController { } } + @Override + public void setCarLightsType(int type, int time) { + initDelegate(); + if (mDelegate != null) { + Log.d("liyz", "MogoMapUIController type = " + type + "---time = " + time); + mDelegate.setCarLightsType(type, time); + } + } + @Override public MapCameraPosition getMapCameraPosition() { initDelegate(); diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/uicontroller/AMapUIController.java b/libraries/mogo-map/src/main/java/com/mogo/map/uicontroller/AMapUIController.java index 3dc3bb8c22..e772d84e7b 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/uicontroller/AMapUIController.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/uicontroller/AMapUIController.java @@ -3,6 +3,7 @@ package com.mogo.map.uicontroller; import android.graphics.Point; import android.graphics.Rect; import android.location.Location; +import android.util.Log; import android.view.View; import com.mogo.eagle.core.data.map.CenterLine; @@ -220,6 +221,14 @@ public class AMapUIController implements IMogoMapUIController { } } + @Override + public void setCarLightsType(int type, int time) { + Log.d("liyz", "AMapUIController type = " + type + "---time = " + time); + if (mClient != null) { + mClient.setCarLightsType(type, time); + } + } + @Override public MapCameraPosition getMapCameraPosition() { if (mClient != null) {