Merge branch 'dev_arch_opt_3.0' into dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0

This commit is contained in:
yangyakun
2023-02-16 14:14:13 +08:00
19 changed files with 267 additions and 63 deletions

View File

@@ -18,6 +18,7 @@ import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisGearStateListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisSteeringStateListenerManager;
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager;
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager;
import com.mogo.eagle.core.function.hmi.ui.widget.TapPositionView;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
@@ -88,15 +89,20 @@ public class SweeperTrafficDataView extends ConstraintLayout
*/
@Override
public void onAutopilotLightSwitchData(@org.jetbrains.annotations.Nullable Chassis.LightSwitch lightSwitch) {
//转向灯状态 0是正常 1是左转 2是右转
if (lightSwitch != null) {
CallerLogger.INSTANCE.d(TAG, "车辆转向灯:" + lightSwitch.toString());
if (lightSwitch.getNumber()==1){
sweeperTurnSignal.showLeftSignal();
}else if(lightSwitch.getNumber()==2){
sweeperTurnSignal.showRightSignal();
}else{
sweeperTurnSignal.showDirection();
ThreadUtils.runOnUiThread {
//转向灯状态 0是正常 1是左转 2是右转
if (lightSwitch != null) {
CallerLogger.INSTANCE.d(TAG, "车辆转向灯:" + lightSwitch.toString());
if (lightSwitch.getNumber()==1){
CallerVisualAngleManager.INSTANCE.showTurning(true);
sweeperTurnSignal.showLeftSignal();
}else if(lightSwitch.getNumber()==2){
CallerVisualAngleManager.INSTANCE.showTurning(true);
sweeperTurnSignal.showRightSignal();
}else{
CallerVisualAngleManager.INSTANCE.showTurning(false);
sweeperTurnSignal.showDirection();
}
}
}
}

View File

@@ -11,12 +11,14 @@ import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.api.map.angle.Default
import com.mogo.eagle.core.function.api.map.angle.TooClose
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
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.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.call.obu.CallerObuConnectListenerManager
import com.mogo.eagle.core.function.call.obu.CallerObuLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.obu.CallerObuWarningListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.datacenter.obu.utils.TrafficDataConvertUtilsNew
@@ -577,18 +579,24 @@ class MogoPrivateObuNewManager private constructor() {
info: ObuScene.RvWarningData
) {
// 这里排除需要特殊定制的语音及文案外,其余的都可以使用 EventTypeEnumNew 提供的
var alertContent: String = ""
var ttsContent: String = ""
var alertContent = ""
var ttsContent = ""
var v2xType = appId
var changeVisualAngle = false
when (appId) {
//前向碰撞预警
MogoObuConstants.V2X_WARNING_TYPE.FCW.toString() -> {
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
// ObuManager.getInstance().obuRvToTrackedObject(info) //todo emArrow
if (FunctionBuildConfig.isObuWarningFusionUnion) {
alertContent = "前车距离过近"
ttsContent = "前车距离过近"
CallerObuWarningListenerManager.invokeTrackerFusionData(ObuManager.getInstance().obuRvToTrackedObject(info))
} else {
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
}
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType
}
//交叉路口碰撞预警
@@ -597,6 +605,7 @@ class MogoPrivateObuNewManager private constructor() {
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType)
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType
}
//左转辅助预警
@@ -605,6 +614,7 @@ class MogoPrivateObuNewManager private constructor() {
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType)
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType
}
//盲区预警
@@ -613,6 +623,7 @@ class MogoPrivateObuNewManager private constructor() {
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType)
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType)
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType
if (
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
@@ -638,7 +649,8 @@ class MogoPrivateObuNewManager private constructor() {
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType)
if (
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType
if (
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
@@ -661,6 +673,7 @@ class MogoPrivateObuNewManager private constructor() {
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType)
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType
}
//紧急制动预警
@@ -669,6 +682,7 @@ class MogoPrivateObuNewManager private constructor() {
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType)
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType
}
//异常车辆提醒
@@ -687,6 +701,7 @@ class MogoPrivateObuNewManager private constructor() {
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType)
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType
alertContent = String.format(alertContent, direction.desc)
ttsContent = String.format(ttsContent, direction.desc)
}
@@ -696,6 +711,7 @@ class MogoPrivateObuNewManager private constructor() {
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType
}
// 这里处理固定的提示信息,包括了<紧急车辆提醒>
@@ -715,9 +731,9 @@ class MogoPrivateObuNewManager private constructor() {
)
if (level == 2 || level == 3) {
//不显示弹框,其它保留
saveObuData(appId, alertContent, ttsContent)
saveObuData(v2xType, alertContent, ttsContent)
CallerHmiManager.warningV2X(
appId,
v2xType,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
object : IMoGoWarningStatusListener {
@@ -736,10 +752,12 @@ class MogoPrivateObuNewManager private constructor() {
}, direction
)
}
//更新周边车辆进行预警颜色变换,车辆实时移动和变色 UUID不需要匹配了
TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let {
CallerMapUIServiceManager.getMarkerService()
?.updateITrafficThreatLevelInfo(it)
CallerObuWarningListenerManager.invokeTrackerWarningInfo(it)
}
}
// 删除
@@ -751,6 +769,7 @@ class MogoPrivateObuNewManager private constructor() {
it.threatLevel = 0x01
CallerMapUIServiceManager.getMarkerService()
?.updateITrafficThreatLevelInfo(it)
CallerObuWarningListenerManager.removeTrackerWarningInfo(it)
}
}
}
@@ -815,13 +834,24 @@ class MogoPrivateObuNewManager private constructor() {
if (!isShowRunRedLight) {
isShowRunRedLight = true
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "changeTrafficLightStatus 闯红灯 --------> ")
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"changeTrafficLightStatus 闯红灯 --------> "
)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
saveObuData(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent)
showWarning(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent, WarningDirectionEnum.ALERT_WARNING_NON)
saveObuData(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
alertContent,
ttsContent
)
showWarning(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
alertContent,
ttsContent,
WarningDirectionEnum.ALERT_WARNING_NON
)
}
}
@@ -839,16 +869,27 @@ class MogoPrivateObuNewManager private constructor() {
ttsContent =
String.format(
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
adviceSpeedTts)
adviceSpeedTts
)
alertContent =
String.format(
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
adviceSpeed)
adviceSpeed
)
val maxSpeed = currentLight.suggestMaxSpeed
if (maxSpeed > 0) {
saveObuData(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, ttsContent)
showWarning(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, ttsContent, WarningDirectionEnum.ALERT_WARNING_NON)
saveObuData(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
alertContent,
ttsContent
)
showWarning(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
alertContent,
ttsContent,
WarningDirectionEnum.ALERT_WARNING_NON
)
}
}
}
@@ -914,7 +955,12 @@ class MogoPrivateObuNewManager private constructor() {
/**
* 消息盒子对应消息的语音播报
*/
private fun showWarning(type: String, content: String, tts: String, direction: WarningDirectionEnum) {
private fun showWarning(
type: String,
content: String,
tts: String,
direction: WarningDirectionEnum
) {
CallerHmiManager.warningV2X(
type,
content,

View File

@@ -158,6 +158,10 @@ class DevaToolsProvider : IDevaToolsProvider {
upgradeManager.updateUpgradeProgress(mContext!!)
}
override fun updateObuUpgradeStatus() {
upgradeManager.updateObuUpgradeStatus(mContext!!)
}
override fun showStatusBar(ctx: Context, container: ViewGroup) {
StatusManager.init(ctx)
StatusManager.show(container)

View File

@@ -57,6 +57,9 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
if (carConfigResp != null && !TextUtils.isEmpty(carConfigResp.macAddress)) {
Log.d("Upgrade", "MoGoHandAdasMsgManager address = " + carConfigResp.macAddress)
getBindingCarInfo(carConfigResp.macAddress, MoGoAiCloudClientConfig.getInstance().sn)
//obu的升级,只需要司机屏连接
queryObuUpgrade(carConfigResp.macAddress)
}
}
@@ -162,11 +165,11 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
}
/**
* 司机屏 处理obu升级即可,乘客屏不需要处理 TODO OBU的角色
* 司机屏 处理obu升级即可,乘客屏不需要处理
*
*/
fun queryObuUpgrade() {
ObuUpgradeAppNetWorkManager.getInstance().getObuUpgradeInfo(mContext, mAddress, role.toString() + "")
private fun queryObuUpgrade(macAddress: String) {
ObuUpgradeAppNetWorkManager.getInstance().getObuUpgradeInfo(mContext, macAddress)
}
}

View File

@@ -7,6 +7,7 @@ import android.content.Context;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.constants.HostConst;
import com.mogo.eagle.core.data.bindingcar.UpgradeAppInfo;
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.network.MoGoRetrofitFactory;
import com.mogo.eagle.core.network.utils.GsonUtil;
@@ -48,17 +49,17 @@ public class ObuUpgradeAppNetWorkManager {
}
/**
* 获取obu升级信息
* 获取obu升级信息obu升级服务端使用app升级接口根据screenType区分类型
* mac 工控机mac地址
* screenType 类型
*/
public void getObuUpgradeInfo(Context context, String mac, String screenType) {
public void getObuUpgradeInfo(Context context, String mac) {
// String sn = "X20202203105S688HZ";
// String mac = "48:b0:2d:3a:bc:78";
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
int versionCode = AppUtils.getAppVersionCode();
CallerLogger.INSTANCE.d(M_BINDING + TAG, "getObuUpgradeInfo mac = " + mac + "---type = " + screenType + "---sn = " + sn + "---versionCode =" + versionCode);
UpgradeAppRequest request = new UpgradeAppRequest(sn, mac, screenType);
String obuVersionName = String.valueOf(AppUtils.getAppVersionCode()); // TODO 获取obu的版本号, string和int 服务端处理
CallerLogger.INSTANCE.d(M_BINDING + TAG, "getObuUpgradeInfo mac = " + mac + "---sn = " + sn + "---obuVersionName =" + obuVersionName);
UpgradeAppRequest request = new UpgradeAppRequest(sn, mac, "7");
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request));
mUpgradeApiService.getUpgradeInfo(requestBody)
.subscribeOn(Schedulers.io())
@@ -71,9 +72,10 @@ public class ObuUpgradeAppNetWorkManager {
@Override
public void onNext(@NonNull UpgradeAppInfo info) {
if (info != null && info.result != null) {
CallerLogger.INSTANCE.d(M_BINDING + TAG, "getObuUpgradeInfo url = " + info.result.getAppUrl() + "----code = " + info.result.getVersionCode() + "--versionCode =" + versionCode + "--info.result = " + info.result);
if (info.result.getVersionCode() > versionCode) {
CallerHmiManager.INSTANCE.showUpgradeDialog(info.result.getAppUrl().substring(info.result.getAppUrl().lastIndexOf("/")+1), info.result.getAppUrl(), info.result.getInstallTitle(), info.result.getInstallContent(), info.result.getInstallType());
CallerLogger.INSTANCE.d(M_BINDING + TAG, "getObuUpgradeInfo url = " + info.result.getAppUrl() + "----name = " + info.result.getVersionName() + "--obuVersionName =" + obuVersionName + "--info.result = " + info.result);
if (!String.valueOf(info.result.getVersionName()).equals(obuVersionName)) {
//下载 TAG和文件名 TODO
CallerDevaToolsManager.INSTANCE.downLoadPackage("OBU", info.result.getAppUrl());
}
} else {
CallerLogger.INSTANCE.d(M_BINDING + TAG, "getObuUpgradeInfo onNext info == null");

View File

@@ -14,6 +14,8 @@ import com.mogo.eagle.core.utilcode.breakpoint.utils.DownloadUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
import com.mogo.eagle.core.utilcode.util.AppUtils
import com.mogo.eagle.core.utilcode.util.ZipUtils
import java.io.IOException
class UpgradeManager : IDownload {
@@ -116,6 +118,9 @@ class UpgradeManager : IDownload {
}
}
/**
* 鹰眼app下载监听
*/
fun updateUpgradeProgress(context: Context) {
val builder = NotificationCompat.Builder(context)
// builder.setSmallIcon(R.mipmap.icon1001);//todo emArrow 更换图标,去除地图下载图标的依赖关系
@@ -147,4 +152,34 @@ class UpgradeManager : IDownload {
})
}
/**
* obu升级包下载监听
*/
fun updateObuUpgradeStatus(context: Context) {
CallerDevaToolsUpgradeListenerManager.addListener(
TAG,
object : IMogoDevaToolsUpgradeListener {
override fun onStart(url: String?) {}
override fun onPause(url: String?) {}
override fun onProgress(url: String?, length: Int) {
}
override fun onFinished(url: String?) {
//下载完成,解压文件 TODO
try {
val files = ZipUtils.unzipFile("", "")
//传给obu升级
} catch (e: IOException) {
//解压失败
e.printStackTrace()
}
}
override fun onError(url: String?, errorMsg: String?) {}
})
}
}

View File

@@ -12,6 +12,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.map.*
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
@@ -31,6 +32,7 @@ class SteeringBrakeView(context: Context, attrs: AttributeSet?) : ConstraintLayo
private const val TAG = "SteeringBrakeView"
}
@Volatile
private var isShowTurnLight = false
private var brakeLight = -1
@@ -60,11 +62,13 @@ class SteeringBrakeView(context: Context, attrs: AttributeSet?) : ConstraintLayo
"$M_HMI$TAG",
"---onAutopilotLightSwitchData ---Acceleration = " + gnssInfo.acceleration + "-- brakeLight = " + brakeLight
)
if (!isShowTurnLight) { //在不展示转向灯的情况下,展示车辆刹车的动效
brakeView.visibility = View.VISIBLE
brakeView.setBrakeLight(brakeLight)
} else {
brakeView.visibility = View.GONE
ThreadUtils.runOnUiThread {
if (!isShowTurnLight) { //在不展示转向灯的情况下,展示车辆刹车的动效
brakeView.visibility = View.VISIBLE
brakeView.setBrakeLight(brakeLight)
} else {
brakeView.visibility = View.GONE
}
}
}
}
@@ -77,9 +81,11 @@ class SteeringBrakeView(context: Context, attrs: AttributeSet?) : ConstraintLayo
ThreadUtils.runOnUiThread {
if (lightSwitch.number == 1 || lightSwitch.number == 2) {
isShowTurnLight = true
CallerVisualAngleManager.showTurning(true)
brakeView.visibility = View.VISIBLE
brakeView.setBrakeLight(0)
} else {
CallerVisualAngleManager.showTurning(false)
brakeView.visibility = View.GONE
isShowTurnLight = false
}

View File

@@ -90,7 +90,7 @@ open class TurnLightViewStatus @JvmOverloads constructor(
//根据左右进行显示和隐藏,实际要判断每个来的时间和频度
when (directionLight) {
Chassis.LightSwitch.LIGHT_LEFT -> { //左转向
CallerVisualAngleManager.changeAngle(Turning(true))
CallerVisualAngleManager.showTurning(true)
showNormalAnimation()
left_select_image.visibility = View.VISIBLE
right_select_image.visibility = View.GONE
@@ -98,7 +98,7 @@ open class TurnLightViewStatus @JvmOverloads constructor(
setAnimation(left_select_image)
}
Chassis.LightSwitch.LIGHT_RIGHT -> { //右转向
CallerVisualAngleManager.changeAngle(Turning(true))
CallerVisualAngleManager.showTurning(true)
showNormalAnimation()
left_select_image.visibility = View.GONE
right_select_image.visibility = View.VISIBLE
@@ -106,7 +106,7 @@ open class TurnLightViewStatus @JvmOverloads constructor(
setAnimation(right_select_image)
}
else -> { //消失
CallerVisualAngleManager.changeAngle(Turning(false))
CallerVisualAngleManager.showTurning(false)
animationDisappear()
}
}

View File

@@ -53,6 +53,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
CallerMsgBoxManager.INSTANCE.queryAllMessages(this);
}
CallerDevaToolsManager.INSTANCE.updateUpgradeProgress();
CallerDevaToolsManager.INSTANCE.updateObuUpgradeStatus();
}
@Override

View File

@@ -4,10 +4,13 @@ import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_IDENTIFY
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.api.base.IMoGoSubscriber
import com.mogo.eagle.core.function.api.map.marker.IMoGoIdentifyListener
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.eagle.core.function.call.obu.CallerObuWarningListenerManager
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import mogo.telematics.pad.MessagePad
import mogo.telematics.pad.MessagePad.TrackedObject
@@ -21,7 +24,7 @@ import mogo.yycp.api.proto.SocketDownData
*/
@Route(path = PATH_IDENTIFY)
class MapIdentifySubscriber private constructor() : IMoGoIdentifyListener, IMoGoSubscriber,
IMoGoAutopilotIdentifyListener {
IMoGoAutopilotIdentifyListener, IMoGoObuStatusListener {
private val TAG = "MapIdentifySubscriber"
@@ -37,11 +40,12 @@ class MapIdentifySubscriber private constructor() : IMoGoIdentifyListener, IMoGo
override fun onCrate() {
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
CallerObuWarningListenerManager.addListener(TAG, this)
}
override fun onDestroy() {
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
CallerObuWarningListenerManager.removeListener(TAG)
}
override fun onAutopilotIdentifyDataUpdate(trafficData: List<TrackedObject>?) {
@@ -62,7 +66,6 @@ class MapIdentifySubscriber private constructor() : IMoGoIdentifyListener, IMoGo
try {
if (FunctionBuildConfig.isDrawAiCloudFusion) {
ThreadUtils.getSinglePool().execute {
// aiCloudDataDrawer.renderAiCloudResult(cloudData)
IdentifyFactory.renderAiCloudResult(cloudData)
}
} else {
@@ -74,7 +77,6 @@ class MapIdentifySubscriber private constructor() : IMoGoIdentifyListener, IMoGo
}
fun clearAiCloudRoma() {
// aiCloudDataDrawer.clearAiMarker()
IdentifyFactory.clearAiMarker()
}
@@ -92,6 +94,47 @@ class MapIdentifySubscriber private constructor() : IMoGoIdentifyListener, IMoGo
}
}
override fun updateTrackerFusionData(trackObject: TrackedObject?) {
super.updateTrackerFusionData(trackObject)
try {
if (FunctionBuildConfig.isObuWarningFusionUnion) {
ThreadUtils.getSinglePool().execute {
//todo emArrow
}
} else {
}
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun updateTrackerWarningInfo(trafficData: TrafficData) {
super.updateTrackerWarningInfo(trafficData)
try {
if (FunctionBuildConfig.isObuWarningFusionUnion) {
ThreadUtils.getSinglePool().execute {
IdentifyFactory.renderOBUWarningObj(true, trafficData)
}
} else {
IdentifyFactory.renderOBUWarningObj(false, trafficData)
}
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun removeTrackerWarningInfo(trafficData: TrafficData) {
super.removeTrackerWarningInfo(trafficData)
try {
ThreadUtils.getSinglePool().execute {
IdentifyFactory.renderOBUWarningObj(false, trafficData)
}
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun getIdentifyObj(uuid: String): TrackedObject? {
return IdentifyFactory.getIdentifyObj(uuid)
}

View File

@@ -11,7 +11,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Liste
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.map.*
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
import com.mogo.map.MogoMapView
@@ -89,12 +89,15 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
lightSwitch?.let {
when (it.number) {
1 -> { //左转灯
CallerVisualAngleManager.showTurning(true)
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(4, 500)
}
2 -> { //右转灯
CallerVisualAngleManager.showTurning(true)
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500)
}
else -> {
CallerVisualAngleManager.showTurning(false)
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500)
}
}

View File

@@ -196,6 +196,20 @@ class OverMapView @JvmOverloads constructor(
}
}
/**
* 清空线路并隐藏起、终点
*/
fun clearCustomPolyline() {
if (mBottomPolyline != null) {
mBottomPolyline!!.remove()
}
if (mCoveredPolyline != null) {
mCoveredPolyline!!.remove()
}
mStartMarker?.isVisible = false
mEndMarker?.isVisible = false
}
private fun initView(context: Context) {
mContext = context
val smpView = LayoutInflater.from(context).inflate(R.layout.module_overview_map_view, this)
@@ -413,15 +427,6 @@ class OverMapView @JvmOverloads constructor(
return false
}
fun clearCustomPolyline() {
if (mBottomPolyline != null) {
mBottomPolyline!!.remove()
}
if (mCoveredPolyline != null) {
mCoveredPolyline!!.remove()
}
}
/**
* 绘制新基建Markers(比如:摄像头)
*
@@ -615,6 +620,7 @@ class OverMapView @JvmOverloads constructor(
mCoveredPolyline = mAMap!!.addPolyline(polylineOptions)
if (mBottomPolyline != null) {
mBottomPolyline!!.remove()
mBottomPolyline = null
}
}
}

View File

@@ -114,6 +114,11 @@ interface IDevaToolsProvider : IProvider {
*/
fun updateUpgradeProgress()
/**
* obu下载进度
*/
fun updateObuUpgradeStatus()
/**
* 展示状态栏
*/

View File

@@ -1,7 +1,7 @@
package com.mogo.eagle.core.function.api.obu
import com.mogo.eagle.core.data.obu.ObuStatusInfo
import com.mogo.eagle.core.data.traffic.TrafficData
import mogo.telematics.pad.MessagePad
/**
* @author xiaoyuzhou
@@ -17,6 +17,13 @@ interface IMoGoObuStatusListener {
}
/**
* obu Tracker data
*/
fun updateTrackerFusionData(trackObject: MessagePad.TrackedObject?){
}
/**
* 更新obu Tracker 预警信息
*/

View File

@@ -154,6 +154,13 @@ object CallerDevaToolsManager {
devaToolsProviderApi?.updateUpgradeProgress()
}
/**
* obu下载状态
*/
fun updateObuUpgradeStatus() {
devaToolsProviderApi?.updateObuUpgradeStatus()
}
/**
* 展示状态栏
*/

View File

@@ -14,6 +14,9 @@ object CallerVisualAngleManager {
.navigation() as? IMoGoVisualAngleChangeProvider
}
@Volatile
private var isVisualAngleChanged = false
fun changeAngle(scene: Scene) {
provider?.changeAngle(scene)
}
@@ -21,4 +24,18 @@ object CallerVisualAngleManager {
fun updateLongSightLevel(level: Boolean) {
provider?.updateLongSightLevel(level)
}
fun showTurning(open: Boolean) {
if (open) {
if (!isVisualAngleChanged) {
isVisualAngleChanged
changeAngle(Turning(true))
}
} else {
if (isVisualAngleChanged) {
isVisualAngleChanged = false
changeAngle(Turning(false))
}
}
}
}

View File

@@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.call.obu
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
import com.mogo.eagle.core.function.call.base.CallerBase
import mogo.telematics.pad.MessagePad
/**
* OBU 监听管理
@@ -19,6 +20,13 @@ object CallerObuWarningListenerManager : CallerBase<IMoGoObuStatusListener>() {
}
}
fun invokeTrackerFusionData(trackObject: MessagePad.TrackedObject?){
M_LISTENERS.forEach {
val listener = it.value
listener.updateTrackerFusionData(trackObject)
}
}
fun invokeTrackerWarningInfo(trafficData: TrafficData) {
M_LISTENERS.forEach {
val listener = it.value

View File

@@ -13,5 +13,8 @@ public class Config {
public final static String downLoadPath = Environment.getExternalStorageDirectory().getAbsolutePath()
+ "/downloads/";
public final static String downLoadObuPath = Environment.getExternalStorageDirectory().getAbsolutePath()
+ "/obu/";
public final static String DOWN_LOAD_TAG = "Package-DownLoad";
}

View File

@@ -618,6 +618,7 @@ public final class DeviceUtils {
// // 联想PAD 获取SN,2022-2023款PAD无法获取暂时不启用
// serial = (String) get.invoke(c, "ro.odm.lenovo.gsn");
// }
Log.d("getSerialNumber()", "serial = " + serial);
} catch (Exception e) {
e.printStackTrace();
}
@@ -702,7 +703,8 @@ public final class DeviceUtils {
* @return 当前的设备SN信息优先使用设备固定的sn
*/
public static String getDeviceSN() {
String devicesSN = SPUtils.getInstance().getString(KEY_DEVICE_ID);
// String devicesSN = SPUtils.getInstance().getString(KEY_DEVICE_ID);
String devicesSN = "";
if (TextUtils.isEmpty(devicesSN)) {
// 获取设备唯一SN
devicesSN = getSerialNumber();