diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/constant/URLConst.kt b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/constant/URLConst.kt index a6a50f6c37..c0ef94ad99 100644 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/constant/URLConst.kt +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/constant/URLConst.kt @@ -3,38 +3,20 @@ package com.mogo.och.bus.passenger.constant import com.mogo.commons.debug.DebugConfig import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils +import com.mogo.och.common.module.biz.constant.OchCommonConst /** * Created on 2021/12/6 */ class URLConst { companion object { - // shettle 接驳车域名 - private const val Shettle_BASE_URL_OCH_DEV = "https://och-driver-dev.zhidaozhixing.com" - private const val Shettle_BASE_URL_OCH_QA = "https://och-driver-qa.zhidaozhixing.com" - private const val Shettle_BASE_URL_OCH_RELEASE = "https://och-driver.zhidaozhixing.com" - - private const val BASE_URL_OCH_DEV = "http://tech-dev.zhidaohulian.com" - private const val BASE_URL_OCH_QA = "https://tech-qa.zhidaohulian.com" - private const val BASE_URL_OCH_RELEASE = "https://tech.zhidaohulian.com" - @JvmStatic fun getBaseUrl(): String { return if(AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)){ - when (DebugConfig.getNetMode()) { - DebugConfig.NET_MODE_DEV, DebugConfig.NET_MODE_DEMO -> Shettle_BASE_URL_OCH_DEV - DebugConfig.NET_MODE_QA -> Shettle_BASE_URL_OCH_QA - DebugConfig.NET_MODE_RELEASE -> Shettle_BASE_URL_OCH_RELEASE - else -> Shettle_BASE_URL_OCH_RELEASE - } + OchCommonConst.getShuttleUrl() }else{ - when (DebugConfig.getNetMode()) { - DebugConfig.NET_MODE_DEV, DebugConfig.NET_MODE_DEMO -> BASE_URL_OCH_DEV - DebugConfig.NET_MODE_QA -> BASE_URL_OCH_QA - DebugConfig.NET_MODE_RELEASE -> BASE_URL_OCH_RELEASE - else -> BASE_URL_OCH_RELEASE - } + OchCommonConst.getBaseUrl() } } diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java index cccd2eb4c7..6a2ad73d02 100644 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java @@ -334,6 +334,11 @@ public class BusPassengerModel { private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener(){ + @Override + public void onAutopilotRouteLineId(long lineId) { + + } + @Override public void onAutopilotIpcConnectStatusChanged(int status, @Nullable String reason) { } diff --git a/OCH/mogo-och-bus-passenger/src/m1/java/com/mogo/och/bus/passenger/net/BusPassengerServiceManager.kt b/OCH/mogo-och-bus-passenger/src/m1/java/com/mogo/och/bus/passenger/net/BusPassengerServiceManager.kt index ccca599d8f..b6eaf49bce 100644 --- a/OCH/mogo-och-bus-passenger/src/m1/java/com/mogo/och/bus/passenger/net/BusPassengerServiceManager.kt +++ b/OCH/mogo-och-bus-passenger/src/m1/java/com/mogo/och/bus/passenger/net/BusPassengerServiceManager.kt @@ -5,10 +5,9 @@ import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager.getSer import com.mogo.och.bus.passenger.bean.response.BusPassengerRoutesResponse import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.eagle.core.network.MoGoRetrofitFactory -import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.och.bus.passenger.bean.request.BusPassengerQueryLineRequest import com.mogo.och.bus.passenger.bean.response.BusPassengerOperationStatusResponse -import com.mogo.och.common.module.biz.constant.OchCommonConst.Companion.getBaseUrl +import com.mogo.och.common.module.biz.constant.OchCommonConst import com.mogo.och.common.module.biz.network.OchCommonServiceCallback import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl import com.mogo.och.common.module.biz.network.interceptor.transformTry @@ -19,7 +18,7 @@ import com.mogo.och.common.module.biz.network.interceptor.transformTry object BusPassengerServiceManager { private var mBusPassengerServiceApi = - MoGoRetrofitFactory.getInstance(getBaseUrl()).create(PassengerServiceApi::class.java) + MoGoRetrofitFactory.getInstance(OchCommonConst.getBaseUrl()).create(PassengerServiceApi::class.java) /** * 获取Bus司机端的sn diff --git a/OCH/mogo-och-bus-passenger/src/m2/assets/m2_map_style.data b/OCH/mogo-och-bus-passenger/src/m2/assets/m2_map_style.data new file mode 100644 index 0000000000..4e4bb6709d Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/m2/assets/m2_map_style.data differ diff --git a/OCH/mogo-och-bus-passenger/src/m2/assets/m2_map_style_extra.data b/OCH/mogo-och-bus-passenger/src/m2/assets/m2_map_style_extra.data new file mode 100644 index 0000000000..3ce2c92d11 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/m2/assets/m2_map_style_extra.data differ diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/constant/URLConst.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/constant/URLConst.kt index 5e4200edc5..fb143e1bda 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/constant/URLConst.kt +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/constant/URLConst.kt @@ -9,20 +9,6 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils */ class URLConst { companion object { - // shettle 接驳车域名 - private const val Shettle_BASE_URL_OCH_DEV = "https://och-driver-dev.zhidaozhixing.com" - private const val Shettle_BASE_URL_OCH_QA = "https://och-driver-qa.zhidaozhixing.com" - private const val Shettle_BASE_URL_OCH_RELEASE = "https://och-driver.zhidaozhixing.com" - - @JvmStatic - fun getBaseUrl(): String { - return when (DebugConfig.getNetMode()) { - DebugConfig.NET_MODE_DEV, DebugConfig.NET_MODE_DEMO -> Shettle_BASE_URL_OCH_DEV - DebugConfig.NET_MODE_QA -> Shettle_BASE_URL_OCH_QA - DebugConfig.NET_MODE_RELEASE -> Shettle_BASE_URL_OCH_RELEASE - else -> Shettle_BASE_URL_OCH_RELEASE - } - } } } \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt index 3b05d79aa0..7f354e74be 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt @@ -6,13 +6,17 @@ import com.mogo.cloud.commons.utils.CoordinateUtils import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.map.MogoLocation +import com.mogo.eagle.core.data.telematic.TelematicConstant 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.telematic.IReceivedMsgListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager +import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d 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.util.GsonUtils import com.mogo.eagle.core.utilcode.util.NetworkUtils import com.mogo.eagle.core.utilcode.util.ToastUtils import com.mogo.och.bus.passenger.R @@ -24,8 +28,10 @@ import com.mogo.och.bus.passenger.callback.AutoPilotStatusCallback import com.mogo.och.bus.passenger.callback.DrivingInfoCallback import com.mogo.och.bus.passenger.constant.BusPassengerConst import com.mogo.och.bus.passenger.network.PM2ModelLoopManager +import com.mogo.och.common.module.bean.AppConnectMsg import com.mogo.och.common.module.biz.network.OchCommonServiceCallback import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil +import com.mogo.och.common.module.voice.VoiceNotice.showNotice import mogo.telematics.pad.MessagePad import kotlin.math.abs @@ -82,6 +88,8 @@ class PM2DrivingModel private constructor() { // 定位监听 CallerChassisLocationGCJ02ListenerManager.addListener(TAG, mMapLocationListener) CallerChassisLocationGCJ02ListenerManager.setListenerHz(TAG,5)//设置5hz, 1s返回一次 + + CallerTelematicListenerManager.addListener(TAG,mReceivedMsgListener) } fun releaseListener(){ @@ -100,6 +108,21 @@ class PM2DrivingModel private constructor() { mAutoStatusCallback = autoPilotStatusCallback } + private val mReceivedMsgListener: IReceivedMsgListener = + object : IReceivedMsgListener{ + override fun onReceivedMsg(type: Int, byteArray: ByteArray) {//接收司机端发来的信息 + if (TelematicConstant.BUSINESS_STRING == type){ + val msg = GsonUtils.fromJson(byteArray.toString(),AppConnectMsg::class.java) as AppConnectMsg + if (msg.isPlay){ //播报 + showNotice(msg.msg) + } + if (msg.isViewShow){//显示 + } + + } + } + } + private val mMapLocationListener: IMoGoChassisLocationGCJ02Listener = object : IMoGoChassisLocationGCJ02Listener{ override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) { @@ -159,7 +182,7 @@ class PM2DrivingModel private constructor() { object : OchCommonServiceCallback { override fun onSuccess(data: PM2OperationStatusResponse?) { if (data?.data == null) return - mDrivingInfoCallback?.changeOperationStatus(data.data.driverStatus === 1) + mDrivingInfoCallback?.changeOperationStatus(data.data.driverStatus == 1) mDrivingInfoCallback?.updatePlateNumber(data.data.plateNumber) } diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2ServiceManager.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2ServiceManager.kt index 9195d8b19f..4cabbcd805 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2ServiceManager.kt +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2ServiceManager.kt @@ -7,8 +7,8 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory import com.mogo.och.bus.passenger.bean.PM2OperationStatusResponse import com.mogo.och.bus.passenger.bean.PM2QueryLineRequest import com.mogo.och.bus.passenger.bean.PM2RoutesResponse -import com.mogo.och.bus.passenger.constant.URLConst.Companion.getBaseUrl import com.mogo.och.bus.passenger.network.PM2ServiceApi +import com.mogo.och.common.module.biz.constant.OchCommonConst import com.mogo.och.common.module.biz.network.OchCommonServiceCallback import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl import com.mogo.och.common.module.biz.network.interceptor.transformTry @@ -19,7 +19,7 @@ import com.mogo.och.common.module.biz.network.interceptor.transformTry object PM2ServiceManager { private var mBusPassengerServiceApi = - MoGoRetrofitFactory.getInstance(getBaseUrl()).create(PM2ServiceApi::class.java) + MoGoRetrofitFactory.getInstance(OchCommonConst.getShuttleUrl()).create(PM2ServiceApi::class.java) /** * 获取Bus司机端的sn diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/presenter/PM2DrivingPresenter.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/presenter/PM2DrivingPresenter.kt index 825ee65c8d..1c9f06a422 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/presenter/PM2DrivingPresenter.kt +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/presenter/PM2DrivingPresenter.kt @@ -54,11 +54,15 @@ class PM2DrivingPresenter(view: PM2DrivingInfoFragment?) : } override fun changeOperationStatus(loginStatus: Boolean) { - TODO("Not yet implemented") + UiThreadHandler.post { + mView?.changeOperationStatus(loginStatus) + } } override fun showNoTaskView(isTrue: Boolean) { - TODO("Not yet implemented") + UiThreadHandler.post { + mView?.showNoTaskView(!isTrue) + } } override fun updateAutoStatus(isOpen: Boolean) { diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/provider/M2StatusViewManager.java b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/provider/M2StatusViewManager.java new file mode 100644 index 0000000000..8966090d91 --- /dev/null +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/provider/M2StatusViewManager.java @@ -0,0 +1,33 @@ +package com.mogo.och.bus.passenger.provider; + +import android.content.Context; +import android.view.View; + +import com.mogo.och.bus.passenger.ui.widget.M2StatusBarView; +import androidx.annotation.NonNull; + +import com.alibaba.android.arouter.facade.annotation.Route; +import com.mogo.eagle.core.data.constants.MogoServicePaths; +import com.mogo.eagle.core.function.api.hmi.view.IStatusViewLayout; + +/** + * @author congtaowang + * @since 2020-01-06 + *

+ * 根据优先级控制显示 window view. + */ +@Route( path = MogoServicePaths.PATH_STATUS_VIEW_MANAGER ) +public class M2StatusViewManager implements IStatusViewLayout { + + + @NonNull + @Override + public View getStatusView(Context context) { + return new M2StatusBarView(context); + } + + @Override + public void init(Context context) { + + } +} diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2DrivingInfoFragment.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2DrivingInfoFragment.kt index d7dcdd3041..afe9ab272b 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2DrivingInfoFragment.kt +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2DrivingInfoFragment.kt @@ -1,12 +1,12 @@ package com.mogo.och.bus.passenger.ui import android.os.Bundle +import android.view.View import androidx.core.content.ContextCompat import com.mogo.commons.mvp.MvpFragment import com.mogo.eagle.core.utilcode.util.DateTimeUtils import com.mogo.och.bus.passenger.R import com.mogo.och.bus.passenger.presenter.PM2DrivingPresenter -import com.mogo.och.common.module.utils.DateTimeUtil import com.mogo.och.common.module.utils.DateTimeUtil.* import kotlinx.android.synthetic.m2.p_m2_driving_info_fragment.* @@ -30,6 +30,7 @@ class PM2DrivingInfoFragment : } override fun initViews() { + updateCurrentTime() } override fun initViews(savedInstanceState: Bundle?) { @@ -61,14 +62,14 @@ class PM2DrivingInfoFragment : } fun updateTaskName(name: String){ - task_name_tv.text = name + line_name_tv.text = name } fun updateTaskDuringTime(time : String){ - task_during_tv.text = time + line_during_tv.text = time } - fun updateCurrentTime(){ + private fun updateCurrentTime(){ current_time_tv.text = formatCalendarToString( DateTimeUtils.getCurrentDateTime(),HH_mm) @@ -76,15 +77,27 @@ class PM2DrivingInfoFragment : DateTimeUtils.getCurrentDateTime(), yyyy_MM_dd) val weekDay = DateTimeUtils.getWeekDayFromCalendar1(DateTimeUtils.getCurrentDateTime()) current_weekday_tv.text = "$date $weekDay" - + } fun changeOperationStatus(status:Boolean){ - if (!status){ //暂无路线 + setLineInfoView(status) + } + fun showNoTaskView(haveTask: Boolean){ + setLineInfoView(haveTask) + } + + private fun setLineInfoView(isShow: Boolean){ + if (isShow){ + line_name_tv.visibility = View.VISIBLE + line_during_tv.visibility = View.VISIBLE + no_line_tv.visibility = View.GONE }else{ - + line_name_tv.visibility = View.GONE + line_during_tv.visibility = View.GONE + no_line_tv.visibility = View.VISIBLE } } @@ -98,7 +111,7 @@ class PM2DrivingInfoFragment : context?.let { auto_tv.background = ContextCompat.getDrawable(it,R.drawable.auto_button_bg) } }else{ context?.let { auto_tv.setTextColor(ContextCompat.getColor(it,R.color.m2_button_auto_tv_color)) } - context?.let { auto_tv.background = ContextCompat.getDrawable(it,R.drawable.bg_p_m2_auto_bg) } + context?.let { auto_tv.background = ContextCompat.getDrawable(it,R.drawable.bg_p_m2_auto) } } } diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/video/PM2VideoFragment.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/video/PM2VideoFragment.kt index a45b56dc64..722370ee9e 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/video/PM2VideoFragment.kt +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/video/PM2VideoFragment.kt @@ -51,34 +51,82 @@ class PM2VideoFragment : arrayListOf.clear() arrayListOf.add( RotationItem( - "https://img.zhidaohulian.com/fileServer/online_car_hailing/1656558672856/小宝宝.mp4", - 1, - "https://img.zhidaohulian.com/fileServer/online_car_hailing/1656559345882/1.png", - "小宝宝" - ) - ) - arrayListOf.add( - RotationItem( - "https://img.zhidaohulian.com/fileServer/online_car_hailing/1656559367261/2.png", + "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357256102/1.jpg", 0, "", - "小猫" + "1" ) ) arrayListOf.add( RotationItem( - "https://img.zhidaohulian.com/fileServer/online_car_hailing/1656558730074/星空.mp4", - 1, - "https://img.zhidaohulian.com/fileServer/online_car_hailing/1656559406169/4.png", - "星空" - ) - ) - arrayListOf.add( - RotationItem( - "https://img.zhidaohulian.com/fileServer/online_car_hailing/1656559384635/3.png", + "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357382357/2.png", 0, "", - "大海" + "2" + ) + ) + arrayListOf.add( + RotationItem( + "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357557335/3.mp4", + 1, + "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357382357/2.png", + "3" + ) + ) + arrayListOf.add( + RotationItem( + "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg", + 0, + "", + "4" + ) + ) + arrayListOf.add( + RotationItem( + "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357834634/5.m4v", + 1, + "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg", + "5" + ) + ) + arrayListOf.add( + RotationItem( + "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676358660379/6.m4v", + 1, + "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg", + "6" + ) + ) + arrayListOf.add( + RotationItem( + "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360154589/7.jpg", + 1, + "", + "7" + ) + ) + arrayListOf.add( + RotationItem( + "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360185500/8.jpg", + 0, + "", + "8" + ) + ) + arrayListOf.add( + RotationItem( + "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360224773/9.png", + 0, + "", + "9" + ) + ) + arrayListOf.add( + RotationItem( + "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360274126/10.mp4", + 1, + "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360224773/9.png", + "10" ) ) } diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2BlueToothView.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2BlueToothView.kt new file mode 100644 index 0000000000..2916611b3e --- /dev/null +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2BlueToothView.kt @@ -0,0 +1,34 @@ +package com.mogo.och.bus.passenger.ui.widget + +import android.content.Context +import android.util.AttributeSet +import android.view.LayoutInflater +import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener +import com.mogo.eagle.core.function.hmi.ui.widget.BlueToothView +import com.mogo.och.bus.passenger.R +import kotlinx.android.synthetic.m2.p_m2_view_blue_tooth.view.* + +/** + * 魔戒蓝牙控件 + * 放置于StatusBar右侧位置 + * todo arrow + */ +class M2BlueToothView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0 +) : BlueToothView(context, attrs, defStyleAttr),IMoGoDevaToolsListener { + + init { + LayoutInflater.from(context).inflate(R.layout.p_m2_view_blue_tooth, this, true) + } + + override fun mofangStatus(status: Boolean) { + if (status) { + blueView.setImageResource(R.drawable.m2_blue_tooth_close) + } else { + blueView.setImageResource(R.drawable.m2_blue_tooth_open) + } + } + +} \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2PTrafficLightView.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2PTrafficLightView.kt new file mode 100644 index 0000000000..44bf647750 --- /dev/null +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2PTrafficLightView.kt @@ -0,0 +1,179 @@ +package com.mogo.och.bus.passenger.ui.widget + +import android.content.Context +import android.util.AttributeSet +import android.view.LayoutInflater +import android.widget.LinearLayout +import com.mogo.eagle.core.data.enums.DataSourceType +import com.mogo.eagle.core.data.enums.TrafficLightEnum +import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener +import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager +import com.mogo.eagle.core.utilcode.util.UiThreadHandler +import com.mogo.och.bus.passenger.R +import kotlinx.android.synthetic.m2.m2_p_traffic_light_view.view.* + +/** + * bus乘客端:红绿灯view + * + * Created on 2022/3/14 + */ +class M2PTrafficLightView @JvmOverloads constructor( + context: Context?, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0 +) : LinearLayout(context, attrs, defStyleAttr), IMoGoTrafficLightListener { + + companion object { + private const val TAG = "M2PTrafficLightView" + } + + private var mCurrentLightId = TrafficLightEnum.BLACK + + init { + init(context) + } + + private fun init(context: Context?) { + LayoutInflater.from(context).inflate(R.layout.m2_p_traffic_light_view, this, true) + } + + override fun onAttachedToWindow() { + super.onAttachedToWindow() + CallerTrafficLightListenerManager.addListener(TAG, this) + } + + override fun onDetachedFromWindow() { + super.onDetachedFromWindow() + CallerTrafficLightListenerManager.removeListener(TAG) + } + + /** + * 展示红绿灯预警 + * + * @param checkLightId 0-都是默认,1-红,2-黄,3-绿 + * @param lightSource 1:云端下发;2:自车感知 + */ + override fun showTrafficLight(checkLightId: TrafficLightEnum, lightSource: DataSourceType) { + super.showTrafficLight(checkLightId, lightSource) + mCurrentLightId = checkLightId + updateTrafficLightIcon(checkLightId) + } + + /** + * 关闭红绿灯预警展示,并重制灯态 + */ + override fun disableTrafficLight() { + super.disableTrafficLight() + UiThreadHandler.post { + mCurrentLightId = TrafficLightEnum.BLACK + this@M2PTrafficLightView.visibility = GONE + } + } + + /** + * @param redNum 红灯倒计时 + * @param yellowNum 黄灯倒计时 + * @param greenNum 绿灯倒计时 + */ + override fun changeCountdownTrafficLightNum(redNum: Int, yellowNum: Int, greenNum: Int) { + super.changeCountdownTrafficLightNum(redNum, yellowNum, greenNum) + resetView() + when (mCurrentLightId) { + TrafficLightEnum.RED -> changeCountdownRed(redNum) + TrafficLightEnum.YELLOW -> changeCountdownYellow(yellowNum) + TrafficLightEnum.GREEN -> changeCountdownGreen(greenNum) + else -> UiThreadHandler.post { m2_p_traffic_light_time_tv.text = "" } + } + } + + override fun changeCountdownRed(redNum: Int) { + super.changeCountdownRed(redNum) + UiThreadHandler.post { + if (redNum > 0) { + resetView() + m2_p_traffic_light_time_tv.text = redNum.toString() + } else { + disableTrafficLightCountDown() + m2_p_traffic_light_time_tv.text = "" + } + } + } + + override fun changeCountdownGreen(greenNum: Int) { + super.changeCountdownGreen(greenNum) + UiThreadHandler.post { + if (greenNum > 0) { + resetView() + m2_p_traffic_light_time_tv.text = greenNum.toString() + } else { + disableTrafficLightCountDown() + m2_p_traffic_light_time_tv.text = "" + } + } + } + + override fun changeCountdownYellow(yellowNum: Int) { + super.changeCountdownYellow(yellowNum) + UiThreadHandler.post { + if (yellowNum > 0) { + resetView() + m2_p_traffic_light_time_tv.text = yellowNum.toString() + } else { + disableTrafficLightCountDown() + m2_p_traffic_light_time_tv.text = "" + } + } + } + + /** + * 更新红绿灯icon + * + * @param lightId 0-都是默认,1-红,2-黄,3-绿 + */ + private fun updateTrafficLightIcon(lightId: TrafficLightEnum) { + UiThreadHandler.post { + when (lightId) { + TrafficLightEnum.RED -> { + m2_p_traffic_light_iv.setBackgroundResource(R.drawable.m2_light_red_nor) + this@M2PTrafficLightView.visibility = VISIBLE + } + TrafficLightEnum.YELLOW -> { + m2_p_traffic_light_iv.setBackgroundResource(R.drawable.m2_light_yellow_nor) + this@M2PTrafficLightView.visibility = VISIBLE + } + TrafficLightEnum.GREEN -> { + m2_p_traffic_light_iv.setBackgroundResource(R.drawable.m2_light_green_nor) + this@M2PTrafficLightView.visibility = VISIBLE + } + else -> this@M2PTrafficLightView.visibility = GONE + } + } + } + + override fun disableTrafficLightCountDown() { + super.disableTrafficLightCountDown() + UiThreadHandler.post { + val layoutParams = layoutParams + if (layoutParams is MarginLayoutParams) { + val lp = layoutParams + lp.width = resources.getDimension(R.dimen.dp_40).toInt() + setLayoutParams(lp) + m2_p_traffic_light_time_tv.visibility = GONE + m2_p_traffic_light_bg.layoutParams.width = + resources.getDimension(R.dimen.dp_40).toInt() + } + } + } + + private fun resetView() { + val layoutParams = layoutParams + if (layoutParams is MarginLayoutParams) { + val lp = layoutParams + lp.width = resources.getDimension(R.dimen.m2_p_light_width).toInt() + setLayoutParams(lp) + m2_p_traffic_light_time_tv.visibility = VISIBLE + m2_p_traffic_light_bg.layoutParams.width = + resources.getDimension(R.dimen.m2_p_light_width).toInt() + } + } +} \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2StatusBarView.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2StatusBarView.kt new file mode 100644 index 0000000000..d1a8e6a1ff --- /dev/null +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2StatusBarView.kt @@ -0,0 +1,86 @@ +package com.mogo.och.bus.passenger.ui.widget + +import android.content.Context +import android.graphics.Color +import android.util.AttributeSet +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.constraintlayout.widget.ConstraintLayout +import chassis.ChassisStatesOuterClass +import com.mogo.eagle.core.data.config.FunctionBuildConfig +import com.mogo.eagle.core.function.api.autopilot.IMoGoBatteryManagementSystemListener +import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener +import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener +import com.mogo.eagle.core.function.call.autopilot.CallerBatteryManagementSystemListenerManager +import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager +import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager +import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager +import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView +import com.mogo.och.bus.passenger.R +import kotlinx.android.synthetic.m2.p_m2_view_status_bar.view.* +import me.jessyan.autosize.utils.AutoSizeUtils + +/** + * @author: wangmingjun + * @date: 2023/2/14 + */ +class M2StatusBarView @JvmOverloads constructor( + context: Context, attrs: AttributeSet? = null +) : ConstraintLayout(context, attrs), IViewControlListener, IMoGoSkinModeChangeListener, + IMoGoBatteryManagementSystemListener { + + companion object { + const val TAG = "M2StatusBarView" + } + + init { + LayoutInflater.from(context).inflate(R.layout.p_m2_view_status_bar, this, true) + setBackgroundColor(Color.TRANSPARENT) + } + + override fun onAttachedToWindow() { + super.onAttachedToWindow() + post { + val params: ViewGroup.LayoutParams = getLayoutParams() + params.height = AutoSizeUtils.dp2px(context,47f) + layoutParams = params + } + //添加view控制 + CallerHmiViewControlListenerManager.addListener(TAG,this) + // 添加换肤监听 + CallerSkinModeListenerManager.addListener(TAG, this) + //电量 + CallerBatteryManagementSystemListenerManager.addListener(TAG,this) + + progress.progress = 50 + tv_power_cos.text = "50%" + } + + override fun onSkinModeChange(skinMode: Int) { + when (skinMode) { + 0 -> setStatusBarDarkOrLight(false) + 1 -> setStatusBarDarkOrLight(true) + } + } + + override fun onDetachedFromWindow() { + super.onDetachedFromWindow() + CallerHmiViewControlListenerManager.removeListener(TAG) + CallerSkinModeListenerManager.removeListener(TAG) + CallerDevaToolsManager.hideStatusBar() + } + + override fun onBatteryManagementSystemStates(states: ChassisStatesOuterClass.BMSSystemStates) { + val bmsSoc = states.bmsSoc + if(bmsSoc >1){ + progress.progress = bmsSoc.toInt() + tv_power_cos.text = "${bmsSoc.toInt()}%" + }else{ + val currenPower = (bmsSoc * 100).toInt() + progress.progress = currenPower + tv_power_cos.text = "$currenPower%" + } + } + + +} \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2TurnLightView.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2TurnLightView.kt new file mode 100644 index 0000000000..ffaa7b1d14 --- /dev/null +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2TurnLightView.kt @@ -0,0 +1,15 @@ +package com.mogo.och.bus.passenger.ui.widget + +import android.content.Context +import android.util.AttributeSet +import android.view.LayoutInflater +import com.mogo.eagle.core.function.hmi.ui.vehicle.TurnLightViewStatus + +/** + * @author: wangmingjun + * @date: 2023/2/13 + */ +class M2TurnLightView @JvmOverloads constructor( + context: Context, attrs: AttributeSet? = null +) { +} \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_blue_tooth_close.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_blue_tooth_close.png new file mode 100644 index 0000000000..0c292d2cf3 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_blue_tooth_close.png differ diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_blue_tooth_open.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_blue_tooth_open.png new file mode 100644 index 0000000000..cccf9e10fa Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_blue_tooth_open.png differ diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_light_green_nor.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_light_green_nor.png new file mode 100644 index 0000000000..3135524a79 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_light_green_nor.png differ diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_light_red_nor.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_light_red_nor.png new file mode 100644 index 0000000000..e873c2b85e Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_light_red_nor.png differ diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_light_yellow_nor.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_light_yellow_nor.png new file mode 100644 index 0000000000..8046782601 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_light_yellow_nor.png differ diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_status_bar_logo.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_status_bar_logo.png new file mode 100644 index 0000000000..ad3bd7fda7 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_status_bar_logo.png differ diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_p_m2_auto_bg.xml b/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_p_m2_auto.xml similarity index 100% rename from OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_p_m2_auto_bg.xml rename to OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_p_m2_auto.xml diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_p_m2_traffic_light_background.xml b/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_p_m2_traffic_light.xml similarity index 100% rename from OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_p_m2_traffic_light_background.xml rename to OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_p_m2_traffic_light.xml diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_pnc.xml b/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_pnc.xml new file mode 100644 index 0000000000..0357ebb192 --- /dev/null +++ b/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_pnc.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/m2_power_seekbar_style.xml b/OCH/mogo-och-bus-passenger/src/m2/res/drawable/m2_power_seekbar_style.xml new file mode 100644 index 0000000000..3ac0c761ba --- /dev/null +++ b/OCH/mogo-och-bus-passenger/src/m2/res/drawable/m2_power_seekbar_style.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/layout/m2_p_traffic_light_view.xml b/OCH/mogo-och-bus-passenger/src/m2/res/layout/m2_p_traffic_light_view.xml new file mode 100644 index 0000000000..b9dcb334f0 --- /dev/null +++ b/OCH/mogo-och-bus-passenger/src/m2/res/layout/m2_p_traffic_light_view.xml @@ -0,0 +1,37 @@ + + + + + + + + + + \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_driving_info_fragment.xml b/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_driving_info_fragment.xml index 6120ab8f89..36c702c121 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_driving_info_fragment.xml +++ b/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_driving_info_fragment.xml @@ -5,11 +5,19 @@ android:layout_width="match_parent" android:layout_height="@dimen/dp_556"> + + + @@ -34,8 +43,8 @@ android:layout_height="wrap_content" android:layout_marginLeft="@dimen/dp_8" android:textSize="@dimen/dp_18" - android:text="KM/H" - android:layout_marginBottom="@dimen/dp_16" + android:text="@string/m2_p_speed_unit_txt" + android:layout_marginBottom="@dimen/dp_12" app:layout_constraintBottom_toBottomOf="@+id/speed_tv" app:layout_constraintLeft_toRightOf="@+id/speed_tv" /> @@ -43,9 +52,9 @@ android:id="@+id/auto_tv" android:layout_width="@dimen/dp_66" android:layout_height="@dimen/dp_38" - android:background="@drawable/bg_p_m2_auto_bg" + android:background="@drawable/bg_p_m2_auto" android:layout_marginTop="@dimen/dp_12" - android:text="Auto" + android:text="@string/m2_p_auto_tv" android:textSize="@dimen/dp_18" android:gravity="center" android:textColor="@color/m2_button_auto_tv_color" @@ -62,10 +71,9 @@ app:layout_constraintTop_toTopOf="@+id/auto_tv" /> - @@ -90,7 +98,7 @@ android:src="@drawable/m2_line_location_bg"/> + + @@ -151,12 +172,4 @@ android:text="--" android:textColor="@color/m2_line_during_tv_color"/> - - - \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_fragment.xml b/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_fragment.xml index db67764a84..d0b80d16f4 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_fragment.xml +++ b/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_fragment.xml @@ -8,7 +8,7 @@ @@ -16,7 +16,7 @@ @@ -26,7 +26,7 @@ diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_hpmap_fragment.xml b/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_hpmap_fragment.xml index fec8fd6cd4..96a4bb5148 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_hpmap_fragment.xml +++ b/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_hpmap_fragment.xml @@ -2,7 +2,7 @@ + android:layout_height="@dimen/dp_800"> @@ -23,9 +23,10 @@ + app:layout_constraintRight_toRightOf="parent" + app:background_resource="@drawable/bg_pnc" /> \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_view_blue_tooth.xml b/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_view_blue_tooth.xml new file mode 100644 index 0000000000..69ae14c394 --- /dev/null +++ b/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_view_blue_tooth.xml @@ -0,0 +1,15 @@ + + + + + + \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_view_status_bar.xml b/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_view_status_bar.xml new file mode 100644 index 0000000000..15a1c12b4f --- /dev/null +++ b/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_view_status_bar.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/values/colors.xml b/OCH/mogo-och-bus-passenger/src/m2/res/values/colors.xml index e17de7a855..13bd4aff12 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/res/values/colors.xml +++ b/OCH/mogo-och-bus-passenger/src/m2/res/values/colors.xml @@ -7,6 +7,10 @@ #0B1E38 #5D7199 #0B1E38 + #6B7EA6 + #2D3E5F + #A5D8FF + #1B2546 #FFFFA28B #FFDA1100 diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/values/dimens.xml b/OCH/mogo-och-bus-passenger/src/m2/res/values/dimens.xml index e738022b0d..ca8e0dcfc1 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/res/values/dimens.xml +++ b/OCH/mogo-och-bus-passenger/src/m2/res/values/dimens.xml @@ -1,61 +1,5 @@ - 700dp - 40dp - 40dp - 40dp - 40dp - 110dp - 224dp - 510dp - 3dp - - 158dp - 90dp - 45dp - 158dp - 90dp - 45dp - 90dp - 90dp - 3dp - - 224dp - 50dp - 50dp - 44dp - 130dp - 38dp - - 36dp - - 110dp - 42dp - - 4dp - 10dp - 20dp - 60dp - 30dp - 20dp - 50dp - 6dp - 50dp - 36dp - 80dp - 100dp - 80dp - 60dp - 6dp - - 685dp - 309dp - 50dp - 10dp - 44dp - 55dp - 40dp - - 584dp - 550dp + 60dp + 40dp \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/values/strings.xml b/OCH/mogo-och-bus-passenger/src/m2/res/values/strings.xml index e98feed5f5..47672a2416 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/res/values/strings.xml +++ b/OCH/mogo-och-bus-passenger/src/m2/res/values/strings.xml @@ -1,8 +1,8 @@ - KM/H + KM/H 您已收车 - 暂无班次 + 暂无路线 到达站: @@ -10,4 +10,9 @@ 始发站: 请携带好随身物品下车。 欢迎乘坐蘑菇车联自动驾驶车。 + + src/m2/assets/m2_map_style.data + src/m2/assets/m2_map_style_extra.data + Auto + \ No newline at end of file diff --git a/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/constant/URLConst.kt b/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/constant/URLConst.kt index 47ee5af7a4..fe41ef967a 100644 --- a/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/constant/URLConst.kt +++ b/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/constant/URLConst.kt @@ -7,19 +7,6 @@ import com.mogo.commons.debug.DebugConfig */ class URLConst { companion object { - - private const val BASE_URL_OCH_DEV = "https://tech-dev.zhidaohulian.com" - private const val BASE_URL_OCH_QA = "https://tech-qa.zhidaohulian.com" - private const val BASE_URL_OCH_RELEASE = "https://tech.zhidaohulian.com" - - @JvmStatic - fun getBaseUrl(): String { - return when (DebugConfig.getNetMode()) { - DebugConfig.NET_MODE_DEV, DebugConfig.NET_MODE_DEMO -> BASE_URL_OCH_DEV - DebugConfig.NET_MODE_QA -> BASE_URL_OCH_QA - DebugConfig.NET_MODE_RELEASE -> BASE_URL_OCH_RELEASE - else -> BASE_URL_OCH_RELEASE - } - } + } } \ No newline at end of file diff --git a/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/net/OrderServiceManager.kt b/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/net/OrderServiceManager.kt index 7790409ac5..9002603bb5 100644 --- a/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/net/OrderServiceManager.kt +++ b/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/net/OrderServiceManager.kt @@ -5,7 +5,7 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.eagle.core.data.BaseData import com.mogo.eagle.core.network.MoGoRetrofitFactory import com.mogo.och.bus.bean.* -import com.mogo.och.bus.constant.URLConst.Companion.getBaseUrl +import com.mogo.och.common.module.biz.constant.OchCommonConst import com.mogo.och.common.module.biz.network.OchCommonServiceCallback import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl import com.mogo.och.common.module.biz.network.interceptor.transformTry @@ -16,7 +16,7 @@ import com.mogo.och.common.module.biz.network.interceptor.transformTry */ object OrderServiceManager { - private val M_SERVICE: IBascApiService = MoGoRetrofitFactory.getInstance(getBaseUrl()).create( + private val M_SERVICE: IBascApiService = MoGoRetrofitFactory.getInstance(OchCommonConst.getBaseUrl()).create( IBascApiService::class.java ) diff --git a/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/net/login/OchCommonServiceManager.kt b/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/net/login/OchCommonServiceManager.kt index fcd24dd8d6..83f8dec4ee 100644 --- a/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/net/login/OchCommonServiceManager.kt +++ b/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/net/login/OchCommonServiceManager.kt @@ -11,7 +11,6 @@ import com.mogo.och.common.module.biz.constant.OchCommonConst import com.mogo.cloud.passport.MoGoAiCloudClient import com.mogo.eagle.core.data.BaseData import com.mogo.eagle.core.network.MoGoRetrofitFactory -import com.mogo.och.bus.constant.URLConst.Companion.getBaseUrl import com.mogo.och.common.module.biz.network.OchCommonServiceCallback import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl import com.mogo.och.common.module.biz.network.interceptor.transformTry @@ -24,7 +23,7 @@ object OchCommonServiceManager { private const val TAG = "OchCommonServiceManager" private val mLoginServiceApi: OchLoginServiceApi = - MoGoRetrofitFactory.getInstance(getBaseUrl()).create( + MoGoRetrofitFactory.getInstance(OchCommonConst.getBaseUrl()).create( OchLoginServiceApi::class.java ) diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java index effad11c8c..650893f452 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java @@ -267,6 +267,11 @@ public class BusPresenter extends Presenter onAutopilotStatusResponse(info); } + @Override + public void onAutopilotRouteLineId(long lineId) { + + } + @Override public void onAutopilotGuardian(MogoReportMsg.MogoReportMessage guardianInfo) { BusTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo); @@ -306,9 +311,11 @@ public class BusPresenter extends Presenter int passengerNum = passenger.passengerSize; if (passengerNum > 1){ //多人播报 "x人" ---》x人核验通过 VoiceNotice.showNotice(passengerNum+"人核验通过", AIAssist.LEVEL3); + OrderModel.getInstance().sendWriteOffNumToClient(passengerNum+"人核验通过"); }else { //是 1 播放 "滴" 2022.11.09 改为: "核验通过" // mView.playDI(); VoiceNotice.showNotice("核验通过", AIAssist.LEVEL3); + OrderModel.getInstance().sendWriteOffNumToClient("核验通过"); } } diff --git a/OCH/mogo-och-bus/src/main/res/values/strings.xml b/OCH/mogo-och-bus/src/main/res/values/strings.xml index a7829fce0a..737487ec70 100644 --- a/OCH/mogo-och-bus/src/main/res/values/strings.xml +++ b/OCH/mogo-och-bus/src/main/res/values/strings.xml @@ -42,7 +42,7 @@ - 已到达%1$s,带好随身物品,下车请注意。 + 已到达%1$s,带好随身物品,下车请注意安全。 车辆起步,请扶稳坐好,前方到站是%1$s,请下车的乘客做好准备。 感谢您体验\'蘑菇车联\'自动驾驶小巴车,我们下次再见。 diff --git a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/constant/URLConst.kt b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/constant/URLConst.kt index 5937447191..dce7719222 100644 --- a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/constant/URLConst.kt +++ b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/constant/URLConst.kt @@ -8,18 +8,5 @@ import com.mogo.commons.debug.DebugConfig class URLConst { companion object { - private const val BASE_URL_OCH_DEV = "https://och-driver-dev.zhidaozhixing.com" - private const val BASE_URL_OCH_QA = "https://och-driver-qa.zhidaozhixing.com" - private const val BASE_URL_OCH_RELEASE = "https://och-driver.zhidaozhixing.com" - - @JvmStatic - fun getBaseUrl(): String { - return when (DebugConfig.getNetMode()) { - DebugConfig.NET_MODE_DEV, DebugConfig.NET_MODE_DEMO -> BASE_URL_OCH_DEV - DebugConfig.NET_MODE_QA -> BASE_URL_OCH_QA - DebugConfig.NET_MODE_RELEASE -> BASE_URL_OCH_RELEASE - else -> BASE_URL_OCH_RELEASE - } - } } } \ No newline at end of file diff --git a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java index 60d51e5d2a..cf7b3000b2 100644 --- a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java +++ b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java @@ -24,6 +24,7 @@ import com.mogo.commons.module.status.StatusDescriptor; import com.mogo.eagle.core.data.BaseData; import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters; import com.mogo.eagle.core.data.config.FunctionBuildConfig; +import com.mogo.eagle.core.data.telematic.TelematicConstant; 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.IMoGoPlanningRottingListener; @@ -32,7 +33,9 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener 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.map.CallerMapLocationListenerManager; +import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; +import com.mogo.eagle.core.utilcode.util.GsonUtils; import com.mogo.eagle.core.utilcode.util.NetworkUtils; import com.mogo.eagle.core.utilcode.util.ToastUtils; import com.mogo.eagle.core.utilcode.util.UiThreadHandler; @@ -52,6 +55,7 @@ import com.mogo.och.bus.net.OrderServiceManager; import com.mogo.och.bus.util.BusAnalyticsManager; import com.mogo.och.bus.util.BusSendTripInfoManager; import com.mogo.och.bus.util.BusTrajectoryManager; +import com.mogo.och.common.module.bean.AppConnectMsg; import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager; import com.mogo.och.common.module.biz.common.socketmessage.data.OCHOperationalMessage; import com.mogo.och.common.module.biz.constant.OchCommonConst; @@ -554,6 +558,8 @@ public class OrderModel { leaveTTSTips(nextStation); + sendStartStationToClient(nextStation); + if (busRoutesResult != null) { boolean isLastStop = false; if (leaveIndex + 1 == stationList.size() - 1) { @@ -685,6 +691,41 @@ public class OrderModel { VoiceNotice.showNotice(String.format(mContext .getString(R.string.bus_arrived_station_tip), arriveStation)); + + sendArrivedStationToClient(arriveStation); + } + + private void sendArrivedStationToClient(String arriveStation) { + AppConnectMsg arrivedMsg = new AppConnectMsg(false,true,String.format(mContext + .getString(R.string.bus_arrived_station_tip), + arriveStation)); + CallerTelematicManager.INSTANCE.sendMsgToAllClients(TelematicConstant.BUSINESS_STRING, + GsonUtils.toJson(arrivedMsg).getBytes()); + } + + private void sendStartStationToClient(String nextStation) { + AppConnectMsg arrivedMsg = new AppConnectMsg(false,true,String.format(mContext + .getString(R.string.bus_leave_station_tip), + nextStation)); + UiThreadHandler.postDelayed(()->{ + CallerTelematicManager.INSTANCE.sendMsgToAllClients(TelematicConstant.BUSINESS_STRING, + GsonUtils.toJson(arrivedMsg).getBytes()); + },DELAY_10S); + } + + private void sendEndTaskToClient() { + AppConnectMsg arrivedMsg = new AppConnectMsg(false,true,mContext + .getString(R.string.bus_end_task_tip)); + + CallerTelematicManager.INSTANCE.sendMsgToAllClients(TelematicConstant.BUSINESS_STRING, + GsonUtils.toJson(arrivedMsg).getBytes()); + } + + public void sendWriteOffNumToClient(String msg){ + AppConnectMsg arrivedMsg = new AppConnectMsg(false,true,msg); + + CallerTelematicManager.INSTANCE.sendMsgToAllClients(TelematicConstant.BUSINESS_STRING, + GsonUtils.toJson(arrivedMsg).getBytes()); } /** @@ -983,6 +1024,7 @@ public class OrderModel { removeTipRunnables(); // startOrStopQueryPassengerWriteOff(false); VoiceNotice.showNotice(mContext.getString(R.string.bus_end_task_tip)); + sendEndTaskToClient(); } } diff --git a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/net/OrderServiceManager.kt b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/net/OrderServiceManager.kt index f37f93a6d5..a239420e1a 100644 --- a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/net/OrderServiceManager.kt +++ b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/net/OrderServiceManager.kt @@ -5,7 +5,7 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.eagle.core.data.BaseData import com.mogo.eagle.core.network.MoGoRetrofitFactory import com.mogo.och.bus.bean.* -import com.mogo.och.bus.constant.URLConst.Companion.getBaseUrl +import com.mogo.och.common.module.biz.constant.OchCommonConst import com.mogo.och.common.module.biz.network.OchCommonServiceCallback import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl import com.mogo.och.common.module.biz.network.interceptor.transformTry @@ -16,7 +16,7 @@ import com.mogo.och.common.module.biz.network.interceptor.transformTry */ object OrderServiceManager { - private val mService: IBascApiService = MoGoRetrofitFactory.getInstance(getBaseUrl()).create( + private val mService: IBascApiService = MoGoRetrofitFactory.getInstance(OchCommonConst.getShuttleUrl()).create( IBascApiService::class.java ) diff --git a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/net/login/OchCommonServiceManager.kt b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/net/login/OchCommonServiceManager.kt index fcd24dd8d6..d331b69633 100644 --- a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/net/login/OchCommonServiceManager.kt +++ b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/net/login/OchCommonServiceManager.kt @@ -11,7 +11,6 @@ import com.mogo.och.common.module.biz.constant.OchCommonConst import com.mogo.cloud.passport.MoGoAiCloudClient import com.mogo.eagle.core.data.BaseData import com.mogo.eagle.core.network.MoGoRetrofitFactory -import com.mogo.och.bus.constant.URLConst.Companion.getBaseUrl import com.mogo.och.common.module.biz.network.OchCommonServiceCallback import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl import com.mogo.och.common.module.biz.network.interceptor.transformTry @@ -24,7 +23,7 @@ object OchCommonServiceManager { private const val TAG = "OchCommonServiceManager" private val mLoginServiceApi: OchLoginServiceApi = - MoGoRetrofitFactory.getInstance(getBaseUrl()).create( + MoGoRetrofitFactory.getInstance(OchCommonConst.getShuttleUrl()).create( OchLoginServiceApi::class.java ) diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/bean/AppConnectMsg.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/bean/AppConnectMsg.kt new file mode 100644 index 0000000000..402557066e --- /dev/null +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/bean/AppConnectMsg.kt @@ -0,0 +1,7 @@ +package com.mogo.och.common.module.bean + +/** + * @author: wangmingjun + * @date: 2023/2/14 + */ +data class AppConnectMsg(var isViewShow: Boolean,var isPlay: Boolean,var msg: String) diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/constant/OchCommonConst.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/constant/OchCommonConst.kt index 6e1891710e..2a200b6a86 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/constant/OchCommonConst.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/constant/OchCommonConst.kt @@ -1,25 +1,19 @@ package com.mogo.och.common.module.biz.constant -import com.mogo.commons.debug.DebugConfig +import com.mogo.eagle.core.data.config.FunctionBuildConfig /** * Created on 2021/12/6 */ class OchCommonConst { companion object { - - private const val BASE_URL_OCH_DEV = "http://tech-dev.zhidaohulian.com" - private const val BASE_URL_OCH_QA = "https://tech-qa.zhidaohulian.com" - private const val BASE_URL_OCH_RELEASE = "https://tech.zhidaohulian.com" - @JvmStatic fun getBaseUrl(): String { - return when (DebugConfig.getNetMode()) { - DebugConfig.NET_MODE_DEV, DebugConfig.NET_MODE_DEMO -> BASE_URL_OCH_DEV - DebugConfig.NET_MODE_QA -> BASE_URL_OCH_QA - DebugConfig.NET_MODE_RELEASE -> BASE_URL_OCH_RELEASE - else -> BASE_URL_OCH_RELEASE - } + return FunctionBuildConfig.urlJson.ochUrl + } + @JvmStatic + fun getShuttleUrl(): String { + return FunctionBuildConfig.urlJson.ochUrl } // token 失效 重新获取token const val WAIT_TAKEN = 100046 diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/constant/SweeperConst.kt b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/constant/SweeperConst.kt index 8397cddf95..bd7be321eb 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/constant/SweeperConst.kt +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/constant/SweeperConst.kt @@ -8,20 +8,6 @@ import com.mogo.commons.debug.DebugConfig class SweeperConst { companion object { - private const val BASE_URL_OCH_DEV = "http://tech-dev.zhidaohulian.com" - private const val BASE_URL_OCH_QA = "https://tech-qa.zhidaohulian.com" - private const val BASE_URL_OCH_RELEASE = "https://tech.zhidaohulian.com" - - @JvmStatic - fun getBaseUrl(): String { - return when (DebugConfig.getNetMode()) { - DebugConfig.NET_MODE_DEV, DebugConfig.NET_MODE_DEMO -> BASE_URL_OCH_DEV - DebugConfig.NET_MODE_QA -> BASE_URL_OCH_QA - DebugConfig.NET_MODE_RELEASE -> BASE_URL_OCH_RELEASE - else -> BASE_URL_OCH_RELEASE - } - } - // OCH arouter 路由path const val PATH = "/driver/api" diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/net/SweeperServiceManager.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/net/SweeperServiceManager.java index f6cd975dbd..ca1bc2552f 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/net/SweeperServiceManager.java +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/net/SweeperServiceManager.java @@ -9,6 +9,7 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory; import com.mogo.eagle.core.network.RequestOptions; import com.mogo.eagle.core.network.SubscribeImpl; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; +import com.mogo.och.common.module.biz.constant.OchCommonConst; import com.mogo.och.sweeper.bean.SweeperQueryLinesResponse; import com.mogo.och.sweeper.bean.SweeperRoutePlanningUpdateReqBean; import com.mogo.och.sweeper.bean.SweeperRoutesResponse; @@ -18,7 +19,6 @@ import com.mogo.och.sweeper.bean.SweeperOperationStatusResponse; import com.mogo.och.sweeper.bean.SweeperQueryLineStationsRequest; import com.mogo.och.sweeper.bean.SweeperResetDrivingLineRequest; import com.mogo.och.sweeper.bean.SweeperUpdateSiteStatusRequest; -import com.mogo.och.sweeper.constant.SweeperConst; import com.mogo.och.sweeper.model.SweeperOrderModel; import java.util.List; @@ -45,7 +45,7 @@ public class SweeperServiceManager { } private SweeperServiceManager(){ - mService = MoGoRetrofitFactory.getInstance(SweeperConst.getBaseUrl()).create(ISweeperApiService.class); + mService = MoGoRetrofitFactory.getInstance(OchCommonConst.getBaseUrl()).create(ISweeperApiService.class); } /** diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/presenter/SweeperPresenter.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/presenter/SweeperPresenter.java index e0534eaf5e..8ce4713150 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/presenter/SweeperPresenter.java +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/presenter/SweeperPresenter.java @@ -161,6 +161,11 @@ public class SweeperPresenter extends Presenter } + @Override + public void onAutopilotRouteLineId(long lineId) { + + } + @Override public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autopilotStatusInfo) { if (autopilotStatusInfo == null) return; diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/constant/TaxiPassengerConst.kt b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/constant/TaxiPassengerConst.kt index 06557a70d4..729835b85f 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/constant/TaxiPassengerConst.kt +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/constant/TaxiPassengerConst.kt @@ -8,20 +8,6 @@ import com.mogo.commons.debug.DebugConfig class TaxiPassengerConst { companion object { - private const val BASE_URL_OCH_DEV = "http://tech-dev.zhidaohulian.com" - private const val BASE_URL_OCH_QA = "https://tech-qa.zhidaohulian.com" - private const val BASE_URL_OCH_RELEASE = "https://tech.zhidaohulian.com" - - @JvmStatic - fun getBaseUrl(): String { - return when (DebugConfig.getNetMode()) { - DebugConfig.NET_MODE_DEV, DebugConfig.NET_MODE_DEMO -> BASE_URL_OCH_DEV - DebugConfig.NET_MODE_QA -> BASE_URL_OCH_QA - DebugConfig.NET_MODE_RELEASE -> BASE_URL_OCH_RELEASE - else -> BASE_URL_OCH_RELEASE - } - } - // OCH arouter 路由path const val PATH = "/passenger/api" diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java index 74ec039d91..9a7964d873 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java @@ -499,6 +499,10 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener(){ + @Override + public void onAutopilotRouteLineId(long lineId) { + + } @Override public void onAutopilotIpcConnectStatusChanged(int status, @Nullable String reason) { diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/network/TaxiPassengerServiceManager.kt b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/network/TaxiPassengerServiceManager.kt index 37e0bc2b39..abd2453751 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/network/TaxiPassengerServiceManager.kt +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/network/TaxiPassengerServiceManager.kt @@ -1,7 +1,6 @@ package com.mogo.och.taxi.passenger.network import android.content.Context -import com.mogo.och.taxi.passenger.constant.TaxiPassengerConst.Companion.getBaseUrl import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager.getServerToken import com.mogo.och.taxi.passenger.bean.TaxiPassengerOrdersInServiceQueryRespBean import com.mogo.cloud.passport.MoGoAiCloudClientConfig @@ -15,6 +14,7 @@ import com.mogo.och.taxi.passenger.bean.TaxiPassengerScoreUpdateOrderReqBean import com.mogo.och.taxi.passenger.bean.TaxiPassengerAllStarWorld import com.mogo.och.taxi.passenger.bean.TaxiPassengerStartReqBean import com.mogo.eagle.core.network.MoGoRetrofitFactory +import com.mogo.och.common.module.biz.constant.OchCommonConst import com.mogo.och.common.module.biz.network.OchCommonServiceCallback import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl import com.mogo.och.common.module.biz.network.interceptor.transformTry @@ -24,7 +24,7 @@ import com.mogo.och.common.module.biz.network.interceptor.transformTry */ object TaxiPassengerServiceManager { - private val mOCHTaxiServiceApi: TaxiPassengerServiceApi = MoGoRetrofitFactory.getInstance(getBaseUrl()).create( + private val mOCHTaxiServiceApi: TaxiPassengerServiceApi = MoGoRetrofitFactory.getInstance(OchCommonConst.getBaseUrl()).create( TaxiPassengerServiceApi::class.java ) diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/constant/TaxiConst.kt b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/constant/TaxiConst.kt index 1cfb1ffa69..9fb2851746 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/constant/TaxiConst.kt +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/constant/TaxiConst.kt @@ -8,20 +8,6 @@ import com.mogo.commons.debug.DebugConfig class TaxiConst { companion object { - private const val BASE_URL_OCH_DEV = "http://tech-dev.zhidaohulian.com" - private const val BASE_URL_OCH_QA = "https://tech-qa.zhidaohulian.com" - private const val BASE_URL_OCH_RELEASE = "https://tech.zhidaohulian.com" - - @JvmStatic - fun getBaseUrl(): String { - return when (DebugConfig.getNetMode()) { - DebugConfig.NET_MODE_DEV, DebugConfig.NET_MODE_DEMO -> BASE_URL_OCH_DEV - DebugConfig.NET_MODE_QA -> BASE_URL_OCH_QA - DebugConfig.NET_MODE_RELEASE -> BASE_URL_OCH_RELEASE - else -> BASE_URL_OCH_RELEASE - } - } - // OCH arouter 路由path const val PATH = "/driver/api" diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java index 2b7db7e77d..188faf6027 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java @@ -1144,6 +1144,11 @@ public class TaxiModel { private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener() { + @Override + public void onAutopilotRouteLineId(long lineId) { + + } + @Override public void onAutopilotIpcConnectStatusChanged(int status, @Nullable String reason) { } diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/network/TaxiServiceManager.kt b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/network/TaxiServiceManager.kt index 6d85432699..63b5cfa751 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/network/TaxiServiceManager.kt +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/network/TaxiServiceManager.kt @@ -1,10 +1,10 @@ package com.mogo.och.taxi.network import android.content.Context -import com.mogo.och.taxi.constant.TaxiConst.Companion.getBaseUrl import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.eagle.core.data.BaseData import com.mogo.eagle.core.network.MoGoRetrofitFactory +import com.mogo.och.common.module.biz.constant.OchCommonConst import com.mogo.och.common.module.biz.network.OchCommonServiceCallback import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl import com.mogo.och.common.module.biz.network.interceptor.transformTry @@ -18,7 +18,7 @@ object TaxiServiceManager { private var mOCHTaxiServiceApi: TaxiServiceApiNew = - MoGoRetrofitFactory.getInstance(getBaseUrl()).create( + MoGoRetrofitFactory.getInstance(OchCommonConst.getBaseUrl()).create( TaxiServiceApiNew::class.java ) diff --git a/app/config.json b/app/config.json deleted file mode 100644 index 892a7a5ede..0000000000 --- a/app/config.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "mogo": { - "qa": { - "och_url": "https://tech-qa.zhidaohulian.com" - }, - "online": { - "och_url": "https://tech-qa.zhidaohulian.com" - }, - "demo": { - "och_url": "https://tech-qa.zhidaohulian.com" - } - }, - "dali": { - "qa": { - "och_url": "https://tech-qa.zhidaohulian.com" - }, - "online": { - "och_url": "https://tech-qa.zhidaohulian.com" - }, - "demo": { - "och_url": "https://tech-qa.zhidaohulian.com" - } - } -} diff --git a/app/productFlavors/urlConfig.gradle b/app/productFlavors/urlConfig.gradle index 0a8e1052d1..36b03ccdb7 100644 --- a/app/productFlavors/urlConfig.gradle +++ b/app/productFlavors/urlConfig.gradle @@ -28,7 +28,7 @@ project.android.applicationVariants.all { variant -> Object readFileToJson(project, env) { try { // 加载config.json 文件 - File file = new File("${rootDir}/app/config.json") + File file = new File("${rootDir}/app/urlConfig.json") def jsonSlurper = new JsonSlurper() // 解析json def config = jsonSlurper.parse(file) diff --git a/app/urlConfig.json b/app/urlConfig.json new file mode 100644 index 0000000000..b61bbc5e97 --- /dev/null +++ b/app/urlConfig.json @@ -0,0 +1,48 @@ +{ + "mogo": { + "qa": { + "och_url": "https://tech-qa.zhidaohulian.com", + "shuttle_url": "https://och-driver-qa.zhidaozhixing.com", + "passport_url": "", + "socket_base_url": "", + "socket_tech_url": "" + }, + "online": { + "och_url": "http://tech-dev.zhidaohulian.com", + "shuttle_url": "https://och-driver.zhidaozhixing.com", + "passport_url": "", + "socket_base_url": "", + "socket_tech_url": "" + }, + "demo": { + "och_url": "http://tech-dev.zhidaohulian.com", + "shuttle_url": "https://och-driver-dev.zhidaozhixing.com", + "passport_url": "", + "socket_base_url": "", + "socket_tech_url": "" + } + }, + "dali": { + "qa": { + "och_url": "https://tech-qa.zhidaohulian.com", + "shuttle_url": "https://och-driver-qa.zhidaozhixing.com", + "passport_url": "https://och-a.zhidaozhixing.com/arch/passport/", + "socket_base_url": "https://och-a.zhidaozhixing.com/arch/push/", + "socket_tech_url": "https://och-a.zhidaozhixing.com/arch/" + }, + "online": { + "och_url": "https://tech-qa.zhidaohulian.com", + "shuttle_url": "https://och-driver.zhidaozhixing.com", + "passport_url": "https://och-a.zhidaozhixing.com/arch/passport/", + "socket_base_url": "https://och-a.zhidaozhixing.com/arch/push/", + "socket_tech_url": "https://och-a.zhidaozhixing.com/arch/" + }, + "demo": { + "och_url": "https://tech-qa.zhidaohulian.com", + "shuttle_url": "https://och-driver-dev.zhidaozhixing.com", + "passport_url": "https://och-a.zhidaozhixing.com/arch/passport/", + "socket_base_url": "https://och-a.zhidaozhixing.com/arch/push/", + "socket_tech_url": "https://och-a.zhidaozhixing.com/arch/" + } + } +} diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/FuncBizProvider.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/FuncBizProvider.kt index 86a2933f6e..c820952fa3 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/FuncBizProvider.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/FuncBizProvider.kt @@ -4,15 +4,18 @@ import android.content.Context import com.alibaba.android.arouter.facade.annotation.Route import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.eagle.core.data.camera.CameraEntity +import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.constants.MogoServicePaths import com.mogo.eagle.core.function.api.biz.IMoGoFuncBizProvider import com.mogo.eagle.core.function.api.biz.IMoGoNoticeNetCallBack +import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.eagle.function.biz.dispatch.DispatchAutoPilotManager.Companion.dispatchAutoPilotManager 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.network.NoticeNetWorkManager import com.mogo.eagle.function.biz.v2x.overview.OverViewDataManager import com.mogo.eagle.function.biz.v2x.overview.db.OverviewDb +import com.mogo.eagle.function.biz.v2x.road.LineUploadManager import com.mogo.eagle.function.biz.v2x.trafficlight.core.MogoTrafficLightManager import com.mogo.eagle.function.biz.v2x.vip.VipCarManager @@ -22,13 +25,19 @@ class FuncBizProvider : IMoGoFuncBizProvider { override val functionName: String get() = "FuncBiz" + private var mContext:Context? = null + override fun init(context: Context) { + mContext = context noticeSocketManager.init(context) dispatchAutoPilotManager.init(context) cronTaskManager.startCronTask() OverviewDb.getDb(context) MogoTrafficLightManager.INSTANCE.initServer(context) VipCarManager.INSTANCE.initServer(context) + if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){ + LineUploadManager.getInstance(context)?.init() + } // RedLightWarningManager.INSTANCE.listenTrafficLight() } @@ -81,6 +90,11 @@ class FuncBizProvider : IMoGoFuncBizProvider { cronTaskManager.release() VipCarManager.INSTANCE.destroy() + if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){ + mContext?.let { + LineUploadManager.getInstance(it)?.onDestroy() + } + } // RedLightWarningManager.INSTANCE.onDestroy() } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/road/ILineUploadApi.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/road/ILineUploadApi.kt new file mode 100644 index 0000000000..aed87f69b2 --- /dev/null +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/road/ILineUploadApi.kt @@ -0,0 +1,16 @@ +package com.mogo.eagle.function.biz.v2x.road + +import com.mogo.eagle.core.data.BaseData +import com.mogo.eagle.core.data.v2x.LineUploadData +import io.reactivex.Observable +import retrofit2.http.Body +import retrofit2.http.Headers +import retrofit2.http.POST + +interface ILineUploadApi { + + @Headers("Content-type:application/json;charset=UTF-8" ) + @POST( "" ) + fun uploadLineId(@Body lineId: LineUploadData): Observable + +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/road/LineUploadManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/road/LineUploadManager.kt new file mode 100644 index 0000000000..790ca44ab0 --- /dev/null +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/road/LineUploadManager.kt @@ -0,0 +1,75 @@ +package com.mogo.eagle.function.biz.v2x.road + +import android.content.Context +import com.mogo.cloud.passport.MoGoAiCloudClientConfig +import com.mogo.commons.constants.HostConst.DATA_CENTER_HOST +import com.mogo.eagle.core.data.v2x.LineUploadData +import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager +import com.mogo.eagle.core.network.MoGoRetrofitFactory +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import io.reactivex.android.schedulers.AndroidSchedulers +import io.reactivex.disposables.Disposable +import io.reactivex.schedulers.Schedulers + +class LineUploadManager private constructor(context: Context) : IMoGoAutopilotStatusListener { + + companion object { + + private const val TAG = "LineUploadManager" + + @Volatile + private var lineUploadManager: LineUploadManager? = null + + @Synchronized + fun getInstance(context: Context): LineUploadManager? { + if (lineUploadManager == null) { + synchronized(LineUploadManager::class.java) { + if (lineUploadManager == null) { + lineUploadManager = LineUploadManager(context) + } + } + } + return lineUploadManager + } + } + + private var mContext: Context? = null + private var disposable: Disposable? = null + + init { + mContext = context + } + + fun init() { + CallerAutoPilotStatusListenerManager.addListener(TAG, this) + } + + override fun onAutopilotRouteLineId(lineId: Long) { + super.onAutopilotRouteLineId(lineId) + if (lineId > 0) { + uploadLine(lineId) + } + } + + private fun uploadLine(lineId: Long) { + val lineUploadData = LineUploadData(lineId, MoGoAiCloudClientConfig.getInstance().sn) + disposable = MoGoRetrofitFactory.getInstance(DATA_CENTER_HOST) + .create(ILineUploadApi::class.java) + .uploadLineId(lineUploadData) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe({ data -> + CallerLogger.d(TAG, " uploadLine : $data") + }, { + CallerLogger.d(TAG, "e : ${it.message}") + }) + } + + fun onDestroy() { + mContext = null + disposable?.dispose() + CallerAutoPilotStatusListenerManager.removeListener(TAG) + } + +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/trafficlight/core/MogoTrafficLightManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/trafficlight/core/MogoTrafficLightManager.kt index 98f7915b94..72b537691f 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/trafficlight/core/MogoTrafficLightManager.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/trafficlight/core/MogoTrafficLightManager.kt @@ -137,13 +137,6 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener { } } - fun getTrafficLightCurrentState(): TrafficLightDetail? { - trafficLightResult?.let { - return it.laneList - } - return null - } - fun getRoadResult(): RoadIDResult? { return roadIDResult } diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/AndroidManifest.xml b/core/function-impl/mogo-core-function-datacenter/src/main/AndroidManifest.xml index e641d09ce5..63dc07bcfc 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/AndroidManifest.xml +++ b/core/function-impl/mogo-core-function-datacenter/src/main/AndroidManifest.xml @@ -3,13 +3,7 @@ package="com.mogo.eagle.core.function.datacenter"> - - - - - - @@ -18,13 +12,6 @@ - - - - - - - diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoTelematicProvider.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoTelematicProvider.kt index b1f0fd6a96..12eeedf1da 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoTelematicProvider.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoTelematicProvider.kt @@ -4,6 +4,7 @@ import android.content.Context import com.alibaba.android.arouter.facade.annotation.Route import com.mogo.eagle.core.data.constants.MogoServicePaths import com.mogo.eagle.core.function.api.telematic.IMogoTelematicProvider +import com.mogo.telematic.MogoProtocolMsg import com.mogo.telematic.NSDNettyManager @Route(path = MogoServicePaths.PATH_TELEMATIC_PROVIDER) @@ -26,4 +27,16 @@ class MoGoTelematicProvider: IMogoTelematicProvider { override fun getServerToken(): String { return NSDNettyManager.getInstance().serverSn } + + override fun sendMsgToAllClients(type: Int, byteArray: ByteArray) { + NSDNettyManager.getInstance().sendMsgToAllClients( + MogoProtocolMsg(type, byteArray.size, byteArray) + ) + } + + override fun sendMsgToServer(type: Int, byteArray: ByteArray) { + NSDNettyManager.getInstance().sendMogoProtocolMsgToServer( + MogoProtocolMsg(type, byteArray.size, byteArray), + null) + } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/telematic/TeleMsgHandler.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/telematic/TeleMsgHandler.kt index 17471344ec..5144d53600 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/telematic/TeleMsgHandler.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/telematic/TeleMsgHandler.kt @@ -8,10 +8,12 @@ import com.mogo.eagle.core.data.app.AppConfigInfo import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.deva.chain.ChainConstant import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS +import com.mogo.eagle.core.data.telematic.TelematicConstant import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setDemoMode import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setIgnoreConditionDraw import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager +import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager import com.mogo.eagle.core.utilcode.mogo.logger.* import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant import com.mogo.eagle.core.utilcode.util.ToastUtils @@ -122,6 +124,9 @@ class TeleMsgHandler : IMsgHandler { } } } + TelematicConstant.BUSINESS_STRING -> { + CallerTelematicListenerManager.invokeReceivedMsg(TelematicConstant.BUSINESS_STRING, it.body) + } else -> { } } @@ -166,6 +171,9 @@ class TeleMsgHandler : IMsgHandler { invokeNettyConnResult("司机屏SN未获取到,不发送给乘客屏") } } + TelematicConstant.BUSINESS_STRING -> { + CallerTelematicListenerManager.invokeReceivedMsg(TelematicConstant.BUSINESS_STRING, it.body) + } else -> { } } diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/MoGoLocationDispatcher.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/MoGoLocationDispatcher.kt index c66bdb3f4c..4c43812fbe 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/MoGoLocationDispatcher.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/MoGoLocationDispatcher.kt @@ -223,14 +223,14 @@ object MoGoLocationDispatcher : /** * OBU定位回调监听 */ - override fun onObuLocationWGS84(data: MogoObuHvBasicsData) { + override fun onObuLocationWGS84(data: MessagePad.GnssInfo) { // 更新GNSS 信息 - lastOBULocation.longitude = data.vehBasicsMsg.longitude - lastOBULocation.latitude = data.vehBasicsMsg.latitude - lastOBULocation.heading = data.vehBasicsMsg.heading - lastOBULocation.gnssSpeed = data.vehBasicsMsg.speed.toFloat() - lastOBULocation.altitude = data.vehBasicsMsg.elevation - lastOBULocation.satelliteTime = data.vehBasicsMsg.secMark + lastOBULocation.longitude = data.longitude + lastOBULocation.latitude = data.latitude + lastOBULocation.heading = data.heading + lastOBULocation.gnssSpeed = data.gnssSpeed.toFloat() + lastOBULocation.altitude = data.altitude + lastOBULocation.satelliteTime = (data.satelliteTime * 1000).toLong() lastOBULocation.lastReceiveTime = TimeUtils.getNowMills() // 将高德中的一些用于业务的数据进行融合,例如:CityCode、address等 diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt index 39f0cd00a1..f76929ab06 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt @@ -256,24 +256,8 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener when (status) { // 添加 MogoObuConstants.STATUS.ADD -> { - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.V2X, - V2XMsg( - appId, - alertContent, - ttsContent - ) - ).apply { - sourceType = DataSourceType.TELEMATIC - } - ) - CallerHmiManager.warningV2X( - appId, - alertContent, - ttsContent, null, direction - ) - + saveObuToDcData(appId, alertContent, ttsContent) + showWarning(appId, alertContent, ttsContent, direction) // 更新数据,是否需要 // TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(rsiWarningData)?.let { // CallerMapUIServiceManager.getMarkerService() @@ -342,25 +326,8 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener when (rsmWarningData.warningMsg.warningDataList[0].status) { MogoObuConstants.STATUS.ADD -> { // 添加 - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.V2X, - V2XMsg( - v2xType, - alertContent, - ttsContent, - ) - ).apply { - sourceType = DataSourceType.TELEMATIC - } - ) - CallerHmiManager.warningV2X( - v2xType, - alertContent, - ttsContent, - null, - direction - ) + saveObuToDcData(v2xType, alertContent, ttsContent) + showWarning(v2xType, alertContent, ttsContent, direction) // 更新数据 TODO // TrafficDataConvertUtils.cvxPtcThreatIndInfo2TrafficData(rsmWarningData)?.let { @@ -459,27 +426,19 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener return when (targetClassification) { MogoObuConstants.VEH_TARGET_POSITION.AHEAD_IN_LANE, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_TOP //正前方 - MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_BOTTOM //正后方 - MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_RIGHT -> WarningDirectionEnum.ALERT_WARNING_RIGHT //正右方 - MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_LEFT -> WarningDirectionEnum.ALERT_WARNING_LEFT //正左方 - MogoObuConstants.VEH_TARGET_POSITION.AHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_LEFT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_LEFT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAR_LEFT -> WarningDirectionEnum.ALERT_WARNING_TOP_LEFT //左前方 - MogoObuConstants.VEH_TARGET_POSITION.AHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAT_RIGHT -> WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT //右前方 - MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_LEFT, -> WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT //左后方 - MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_RIGHT, -> WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT //右后方 - MogoObuConstants.VEH_TARGET_POSITION.UNCLASSIFIED -> WarningDirectionEnum.ALERT_WARNING_NON //未知 else -> WarningDirectionEnum.ALERT_WARNING_ALL } @@ -552,24 +511,8 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener "${M_OBU}${TAG}", "MogoObuDcCombineManager changeTrafficLightStatus 闯红灯 --------> ttsContent = $ttsContent ---alertContent = $alertContent " ) - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.V2X, - V2XMsg( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, - alertContent, - ttsContent - ) - ).apply { - sourceType = DataSourceType.TELEMATIC - } - ) - - CallerHmiManager.warningV2X( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, - alertContent, - ttsContent// 只有第一次才tts,防止更新的时候不断的提醒 - ) + saveObuToDcData(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent) + showWarning(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent, WarningDirectionEnum.ALERT_WARNING_NON) } } @@ -605,23 +548,8 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener ) val maxSpeed = currentLight.suggestMaxSpeed * 3.6 if (maxSpeed > 0) { - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.V2X, - V2XMsg( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, - alertContent, - ttsContent - ) - ).apply { - sourceType = DataSourceType.TELEMATIC - } - ) - CallerHmiManager.warningV2X( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, - alertContent, - ttsContent// 只有第一次才tts,防止更新的时候不断的提醒 - ) + saveObuToDcData(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, ttsContent) + showWarning(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, ttsContent, WarningDirectionEnum.ALERT_WARNING_NON) } } } @@ -666,4 +594,35 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener } } + /** + * 保存obu通过工控机传输的数据到消息盒子 + */ + private fun saveObuToDcData(type: String, content: String, tts: String) { + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.V2X, + V2XMsg( + type, + content, + tts + ) + ).apply { + sourceType = DataSourceType.TELEMATIC + } + ) + } + + /** + * 消息盒子对应消息的语音播报 + */ + private fun showWarning(type: String, content: String, tts: String, direction: WarningDirectionEnum) { + CallerHmiManager.warningV2X( + type, + content, + tts, + null, + direction + ) + } + } diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt index 448913e959..cade324693 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt @@ -29,7 +29,6 @@ import com.mogo.support.obu.constants.MogoObuComType import com.mogo.support.obu.constants.MogoObuConstants import com.mogo.support.obu.constants.MogoObuTopicId import com.mogo.support.obu.model.* -import com.mogo.support.obu.model.advance.SpatLight import com.mogo.support.obu.option.MogoObuCom import com.mogo.support.obu.option.MogoObuOptions import com.zhidao.support.obu.ObuManager @@ -72,7 +71,7 @@ class MogoPrivateObuNewManager private constructor() { .registerTopic(MogoObuTopicId.MAP_MATCH) .build() - //每次连接的时候如果连接连接了,先断开 + //每次连接的时候如果连接连接了,先断开,防止ip改变等导致的连接失败 if (ObuManager.getInstance().connectStatus == 1) { try { ObuManager.getInstance().disconnect() @@ -80,7 +79,6 @@ class MogoPrivateObuNewManager private constructor() { e.printStackTrace() } } - ObuManager.getInstance().connect(options) } @@ -92,7 +90,6 @@ class MogoPrivateObuNewManager private constructor() { ObuManager.getInstance().disconnect() } - private val mogoObuListener: OnObuListener = object : OnObuListener { /** * 连接状态的改变 @@ -111,15 +108,15 @@ class MogoPrivateObuNewManager private constructor() { * HV车辆基础信息 gnssInfo */ override fun onGnssInfo(gnssInfo: MessagePad.GnssInfo?) { - if (gnssInfo != null ) { + if (gnssInfo != null) { CallerLogger.d( "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onGnssInfo lon = ${gnssInfo.longitude} --- lat = ${gnssInfo.latitude} ---speed = ${gnssInfo.gnssSpeed} ---heading = ${gnssInfo.heading} --acceleration = ${gnssInfo.acceleration} --yawRate = ${gnssInfo.yawRate}" ) // 使用与渠道配置一样的gps提供者提供的数据,app/productFlavors/fPadLenovo.gradle GPS_PROVIDER 0-Android系统,1-工控机,2-OBU if (2 == FunctionBuildConfig.gpsProvider) { - // 同步给MAP地图 TODO -// CallerObuLocationWGS84ListenerManager.invokeObuLocationWGS84(gnssInfo) + // 同步给MAP地图 + CallerObuLocationWGS84ListenerManager.invokeObuLocationWGS84(gnssInfo) // 同步更新经纬度和系统时间至 AutoPilotStatusListener CallerAutoPilotStatusListenerManager.updateAutoPilotLatLon( System.currentTimeMillis() / 1000.0, @@ -244,9 +241,6 @@ class MogoPrivateObuNewManager private constructor() { //车内标牌 MogoObuConstants.RSI_SCENE_TYPE.IVS.toString() -> { when (data.warningMsgList[0].signSerialNum) { -// MogoObuConstants.RTS.RTI_TYPE_INTERSECTION -> { //十字路口 -// appId = EventTypeEnumNew.TYPE_ID_NTERSECTION.poiType -// } MogoObuConstants.RTS.RTI_TYPE_SHAPR_TURNS -> { //急转弯 appId = EventTypeEnumNew.TYPE_ID_SHAPR_TURNS.poiType } @@ -296,11 +290,6 @@ class MogoPrivateObuNewManager private constructor() { // appId = // EventTypeEnumNew.TYPE_USECASE_ID_ROAD_SPEED_LIMIT.poiType // } - -// MogoObuConstants.RTS.RTI_TYPE_GO_STRAIGHT_TURN_RIGHT -> { //直行或右转 -// appId = -// EventTypeEnumNew.TYPE_USECASE_ID_GO_STRAIGHT_TURN_RIGHT.poiType -// } MogoObuConstants.RTS.RTI_TYPE_BUS_WARNING -> { //公交提醒 appId = EventTypeEnumNew.TYPE_USECASE_ID_BUS_WARNING.poiType } @@ -371,24 +360,8 @@ class MogoPrivateObuNewManager private constructor() { if (alertContent.isEmpty() || ttsContent.isEmpty()) { return } - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.V2X, - V2XMsg( - appId, - alertContent, - ttsContent - ) - ).apply { - sourceType = DataSourceType.OBU - } - ) - CallerHmiManager.warningV2X( - appId, - alertContent, - ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - null, direction - ) + saveObuData(appId, alertContent, ttsContent) + showWarning(appId, alertContent, ttsContent, direction) // 更新数据 TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(data)?.let { @@ -472,19 +445,6 @@ class MogoPrivateObuNewManager private constructor() { } MogoObuConstants.STATUS.UPDATE -> { // 更新 - //处理删除逻辑, -// if (rsmPtcIdMap.containsKey(data.participant.ptcId.toString())) { -// var oldTime = rsmPtcIdMap[data.participant.ptcId.toString()] -// var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000 -// if (timeDiff > 3) { //超过3秒,删除对应弱势交通元素 -// CallerMapUIServiceManager.getMarkerService() -// ?.removeCvxRvInfoIndInfo(data.participant.ptcId.toString()) -// } -// rsmPtcIdMap.remove(data.participant.ptcId.toString()) -// rsmPtcIdMap[data.participant.ptcId.toString()] = System.currentTimeMillis() -// } else { -// rsmPtcIdMap[data.participant.ptcId.toString()] = System.currentTimeMillis() -// } } MogoObuConstants.STATUS.DELETE -> { // 删除 @@ -522,25 +482,8 @@ class MogoPrivateObuNewManager private constructor() { if (alertContent.isEmpty() || ttsContent.isEmpty()) { return } - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.V2X, - V2XMsg( - v2xType, - alertContent, - ttsContent - ) - ).apply { - sourceType = DataSourceType.OBU - } - ) - - CallerHmiManager.warningV2X( - v2xType, - alertContent, - ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - null, direction - ) + saveObuData(v2xType, alertContent, ttsContent) + showWarning(v2xType, alertContent, ttsContent, direction) } MogoObuConstants.STATUS.UPDATE -> {// 更新 @@ -593,9 +536,8 @@ class MogoPrivateObuNewManager private constructor() { } } } - } - } - } + } + } /** * 获取消息的方位 车辆相关 @@ -605,27 +547,19 @@ class MogoPrivateObuNewManager private constructor() { return when (targetClassification) { MogoObuConstants.VEH_TARGET_POSITION.AHEAD_IN_LANE, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_TOP //正前方 - MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_BOTTOM //正后方 - MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_RIGHT -> WarningDirectionEnum.ALERT_WARNING_RIGHT //正右方 - MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_LEFT -> WarningDirectionEnum.ALERT_WARNING_LEFT //正左方 - MogoObuConstants.VEH_TARGET_POSITION.AHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_LEFT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_LEFT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAR_LEFT -> WarningDirectionEnum.ALERT_WARNING_TOP_LEFT //左前方 - MogoObuConstants.VEH_TARGET_POSITION.AHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAT_RIGHT -> WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT //右前方 - MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_LEFT, -> WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT //左后方 - MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_RIGHT, -> WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT //右后方 - MogoObuConstants.VEH_TARGET_POSITION.UNCLASSIFIED -> WarningDirectionEnum.ALERT_WARNING_NON //未知 else -> WarningDirectionEnum.ALERT_WARNING_ALL } @@ -633,10 +567,9 @@ class MogoPrivateObuNewManager private constructor() { /** * 构造对应展示数据和场景 根据obu的场景,add change delete确定是否展示 - * * @param appId 使用WarningTypeEnum获取icon、提示内容、tts内容 TODO 添加事件频繁播报拦截 - * - * @see com.mogo.module.common.enums.EventTypeEnum + * @see com.mogo.module.common.enums.EventTypeEnumNew + * EventTypeEnumNew在定义的id为了防止重复,和原始数据是不一样的,有对应关系 */ private fun handleSdkObu( appId: String, @@ -766,9 +699,9 @@ class MogoPrivateObuNewManager private constructor() { } // 这里处理固定的提示信息,包括了<紧急车辆提醒> - else -> { //TODO - // ttsContent = EventTypeEnumNew.getWarningTts(appId.toString()) - // alertContent = EventTypeEnumNew.getWarningContent(appId.toString()) + else -> { + // ttsContent = EventTypeEnumNew.getWarningTts(appId.toString()) + // alertContent = EventTypeEnumNew.getWarningContent(appId.toString()) } } @@ -782,18 +715,7 @@ class MogoPrivateObuNewManager private constructor() { ) if (level == 2 || level == 3) { //不显示弹框,其它保留 - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.V2X, - V2XMsg( - appId, - alertContent, - ttsContent - ) - ).apply { - sourceType = DataSourceType.OBU - } - ) + saveObuData(appId, alertContent, ttsContent) CallerHmiManager.warningV2X( appId, alertContent, @@ -837,7 +759,11 @@ class MogoPrivateObuNewManager private constructor() { /** * 处理红绿灯 */ - private fun handlerTrafficLight(appId: Int, status: Int, lights: MutableList) { + private fun handlerTrafficLight( + appId: Int, + status: Int, + lights: MutableList + ) { CallerLogger.d( "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "handlerTrafficLight --- status = $status ---lights.size = ${lights.size} ---lights = $lights ---appId = $appId" @@ -845,8 +771,7 @@ class MogoPrivateObuNewManager private constructor() { when (status) { // 添加 MogoObuConstants.STATUS.ADD, - MogoObuConstants.STATUS.UPDATE - -> { + MogoObuConstants.STATUS.UPDATE -> { if (lights != null && lights.isNotEmpty()) { changeTrafficLightStatus(appId, lights) } @@ -857,9 +782,6 @@ class MogoPrivateObuNewManager private constructor() { CallerTrafficLightListenerManager.disableTrafficLight() isShowGreenWave = false isShowRunRedLight = false - // lightCountDownRed = 1 - // lightCountDownGreen = 1 - // lightCountDownYellow = 1 } } } @@ -867,7 +789,6 @@ class MogoPrivateObuNewManager private constructor() { private var isShowGreenWave = false private var isShowRunRedLight = false - /** * 修改红绿灯 */ @@ -893,31 +814,13 @@ 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) - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.V2X, - V2XMsg( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, - alertContent, - ttsContent - ) - ).apply { - sourceType = DataSourceType.OBU - } - ) - - CallerHmiManager.warningV2X( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, - alertContent, - ttsContent// 只有第一次才tts,防止更新的时候不断的提醒 - ) + saveObuData(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent) + showWarning(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent, WarningDirectionEnum.ALERT_WARNING_NON) } } @@ -935,33 +838,16 @@ 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) { - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.V2X, - V2XMsg( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, - alertContent, - ttsContent - ) - ).apply { - sourceType = DataSourceType.OBU - } - ) - CallerHmiManager.warningV2X( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, - alertContent, - ttsContent// 只有第一次才tts,防止更新的时候不断的提醒 - ) + saveObuData(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, ttsContent) + showWarning(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, ttsContent, WarningDirectionEnum.ALERT_WARNING_NON) } } } @@ -1004,4 +890,39 @@ class MogoPrivateObuNewManager private constructor() { ) } } - } + } + + /** + * 保存obu直连数据到消息盒子 + */ + private fun saveObuData(type: String, content: String, tts: String) { + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.V2X, + V2XMsg( + type, + content, + tts + ) + ).apply { + sourceType = DataSourceType.OBU + } + ) + } + + /** + * 消息盒子对应消息的语音播报 + */ + private fun showWarning(type: String, content: String, tts: String, direction: WarningDirectionEnum) { + CallerHmiManager.warningV2X( + type, + content, + tts, + null, + direction + ) + } + +} + + diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/adapter/MoGoObuListenerImpl.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/adapter/MoGoObuListenerImpl.kt index 2ca1b43239..17e01071e0 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/adapter/MoGoObuListenerImpl.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/adapter/MoGoObuListenerImpl.kt @@ -1,15 +1,17 @@ package com.mogo.eagle.core.function.datacenter.obu.adapter import com.mogo.eagle.core.function.call.obu.* -import com.mogo.support.obu.OnMogoObuListener +import com.mogo.support.obu.ObuScene import com.mogo.support.obu.constants.Define.ConnectStatus import com.mogo.support.obu.model.* +import com.zhidao.support.obu.OnObuListener +import mogo.telematics.pad.MessagePad /** * 适配 OBU 回调监听分发,这里不做业务,只做数据包装及分发处理 * @author dong hong yu */ -object MoGoObuListenerImpl : OnMogoObuListener() { +object MoGoObuListenerImpl : OnObuListener { /** * 连接状态 @@ -36,8 +38,10 @@ object MoGoObuListenerImpl : OnMogoObuListener() { * @param data 数据 * @since 1.0.0 */ - override fun onMogoObuHvBasics(data: MogoObuHvBasicsData) { - CallerObuLocationWGS84ListenerManager.invokeObuLocationWGS84(data) + override fun onGnssInfo(gnssInfo: MessagePad.GnssInfo?) { + if (gnssInfo != null) { + CallerObuLocationWGS84ListenerManager.invokeObuLocationWGS84(gnssInfo) + } } /** @@ -46,8 +50,7 @@ object MoGoObuListenerImpl : OnMogoObuListener() { * @param data 数据 * @since 1.0.0 */ - override fun onMogoObuRvWarning(data: MogoObuRvWarningData) { - CallerObuWarningRvListenerManager.invokeObuRvWarning(data) + override fun onObuRvWarning(rvWarningData: ObuScene.RvWarningData?) { } /** @@ -56,8 +59,7 @@ object MoGoObuListenerImpl : OnMogoObuListener() { * @param data 数据 * @since 1.0.0 */ - override fun onMogoObuSpatWarning(data: MogoObuSpatWarningData) { - + override fun onObuSpatWarning(spatWarningData: ObuScene.SpatWarningData?) { } /** @@ -66,8 +68,7 @@ object MoGoObuListenerImpl : OnMogoObuListener() { * @param data 数据 * @since 1.0.0 */ - override fun onMogoObuRsiWarning(data: MogoObuRsiWarningData) { - + override fun onObuRsiWarning(rsiWarningData: ObuScene.RsiWarningData?) { } /** @@ -76,7 +77,7 @@ object MoGoObuListenerImpl : OnMogoObuListener() { * @param data 数据 * @since 1.0.0 */ - override fun onMogoObuRsmWarning(data: MogoObuRsmWarningData) { + override fun onObuRsmWarning(rsmWarningData: ObuScene.RsmWarningData?) { } /** @@ -85,6 +86,8 @@ object MoGoObuListenerImpl : OnMogoObuListener() { * @param data 数据 * @since 1.0.0 */ - override fun onMogoObuMapMath(data: MogoObuMapMathData) { + override fun onObuMapMath(mapMatchData: ObuScene.MapMatchData?) { + } + } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuRsuTestTriggerReceiver.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuRsuTestTriggerReceiver.kt deleted file mode 100644 index d79a247af1..0000000000 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuRsuTestTriggerReceiver.kt +++ /dev/null @@ -1,120 +0,0 @@ -package com.mogo.eagle.core.function.datacenter.obu.receiver - -import android.content.BroadcastReceiver -import android.content.Context -import android.content.Intent -//import com.mogo.eagle.core.function.obu.mogo.MogoObuConst -//import com.mogo.eagle.core.function.datacenter.obu.MogoPrivateObuManager -//import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger -//import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU -//import com.zhidao.support.obu.constants.ObuConstants -//import com.zhidao.support.obu.model.CvxIvpThreatIndInfo -//import com.zhidao.support.obu.model.CvxPtcThreatIndInfo -//import com.zhidao.support.obu.model.CvxRtiThreatIndInfo -//import com.zhidao.support.obu.model.CvxSlwThreatIndInfo -//import com.zhidao.support.obu.model.advance.* - -/** - * @author lixiaopeng - * @date 2021/8/18 - * - * OBU 测试使用 - * 红绿灯 - */ -class ObuRsuTestTriggerReceiver : BroadcastReceiver() { - private var mContext: Context? = null - - companion object { - private const val TAG = "ObuRsuTestTriggerReceiver" - } - - override fun onReceive(context: Context, intent: Intent) { - mContext = context - -// val obuType = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_TYPE_EXTRA_KEY, 0) -// val obuStatus = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_STATES_EXTRA_KEY, 0) -// val obuLevel = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_LEVEL_EXTRA_KEY, 3) -// val indicator = intent.getIntExtra(MogoObuConst.BROADCAST_LIGHT_LEVEL_EXTRA_KEY, 0) -// val pctType = intent.getIntExtra(MogoObuConst.BROADCAST_PTC_INFO_EXTRA_KEY, 0) -// val rtiType = intent.getIntExtra(MogoObuConst.BROADCAST_RTI_TYPE_EXTRA_KEY, 0) -// -// CallerLogger.d( -// "$M_OBU$TAG", "obuStatus:$obuStatus phase:$indicator obuType:$obuType obuLevel:$obuLevel" -// ) -// -// when (obuType) { -// ObuConstants.USE_CASE_ID.IVP -> { //构建红绿灯数据 -// val cvxIvpThreatIndInfo = CvxIvpThreatIndInfo(1, 1, 1L) -// -// val ivpThreat = IvpThreat(1, obuType, null, 1000, obuLevel, 100) -// -// cvxIvpThreatIndInfo.threat_info = ivpThreat -// -// val lightList = listOf( -// Light(1, 0x0, 1000, 3000, 6000, 3000, 100, 1000), -// Light(1, 0x1, 1000, 3000, 6000, 3000, 100, 1000), -// Light(1, 0x2, 1000, 3000, 6000, 3000, 100, 1000), -// Light(1, 0x3, 1000, 3000, 6000, 3000, 100, 1000) -// ) -// val ivpThreatExt = IvpThreatExt(1, 1000, 1000, 0, indicator, lightList) -// cvxIvpThreatIndInfo.ext_info = ivpThreatExt -// cvxIvpThreatIndInfo.status = obuStatus -// cvxIvpThreatIndInfo.link_id = "1" -// -// MogoPrivateObuManager.INSTANCE.getMogoObuListener() -// .onCvxIvpThreatIndInfo(cvxIvpThreatIndInfo) -// } -// -// ObuConstants.USE_CASE_ID.SLW -> { //限速预警 -// val cvxSlwThreatIndInfo = CvxSlwThreatIndInfo(1, 1, 1L) -// val slwThreatExt = SlwThreatExt(1, 2, 6000, 2000) -// -// cvxSlwThreatIndInfo.ext_info = slwThreatExt -// cvxSlwThreatIndInfo.status = obuStatus -// -// MogoPrivateObuManager.INSTANCE.getMogoObuListener() -// .onCvxSlwThreatIndInfo(cvxSlwThreatIndInfo) -// } -// -// //弱势交通参与者碰撞预警,行人/摩托车碰撞预警 -// ObuConstants.USE_CASE_ID.VRUCW -> { -// val cvxPtcIndInfo = CvxPtcThreatIndInfo(1, 1, 1) -// val position = Position(1, 399739429, 1164115207, 20) -// cvxPtcIndInfo.ptc_pos = position -// cvxPtcIndInfo.ptc_id = "111" -// cvxPtcIndInfo.ptc_type = pctType -// cvxPtcIndInfo.status = obuStatus -// -// val v2vThreat = V2vThreat(1, obuType, null, 1000, obuLevel, 100) -// cvxPtcIndInfo.threat_info = v2vThreat -// -// MogoPrivateObuManager.INSTANCE.getMogoObuListener() -// .onCvxPtcThreatIndInfo(cvxPtcIndInfo) -// } -// -// //道路危险情况, 车内标牌, 前方拥堵提醒 -// ObuConstants.USE_CASE_ID.HLW, ObuConstants.USE_CASE_ID.IVS, ObuConstants.USE_CASE_ID.TJW -> { -// val cvxRtiThreatIndInfo = CvxRtiThreatIndInfo(1, 1, 1L) -// val dateTime = DateTime(1, 1, 1, 1, 1, 1, 1, 1) -// val rtiThread = RtiThreat(1, obuType, dateTime, 100000, obuLevel, 100) -// val extInfo = RtiThreatExt(1, rtiType, 0x02, 100000, 100000) -// val position = Position(1, 399739429, 1164115207, 20) -// -// // 位置围栏 -// val zonesInfo = listOf( -// ZoneInfo(1, 2000, 2000, listOf(position)) -// ) -// -// cvxRtiThreatIndInfo.rti_id = "123123" -// cvxRtiThreatIndInfo.zones_info = zonesInfo -// cvxRtiThreatIndInfo.threat_info = rtiThread -// cvxRtiThreatIndInfo.ext_info = extInfo -// cvxRtiThreatIndInfo.status = obuStatus -// -// MogoPrivateObuManager.INSTANCE.getMogoObuListener() -// .onCvxRtiThreatIndInfo(cvxRtiThreatIndInfo) -// } -// } - } - -} diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestNewObuReceiver.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestNewObuReceiver.kt index 8a6eb1f7c0..4e9dc56327 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestNewObuReceiver.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestNewObuReceiver.kt @@ -14,7 +14,7 @@ import com.mogo.support.obu.model.advance.WarningData * @author lixiaopeng * @date 2022/9/8 10:50 上午 * - * 自研OBU 模拟场景 + * 自研OBU 模拟场景 HV */ class ObuTestNewObuReceiver : BroadcastReceiver() { private var mContext: Context? = null @@ -49,6 +49,8 @@ class ObuTestNewObuReceiver : BroadcastReceiver() { // val cvxHvInfoIndInfo = MogoRvWarningData(0, vehBasicsMsg, warningMsg) +// val gnssInfo = MessagePad.GnssInfo() + // MogoPrivateObuNewManager.INSTANCE // .getMogoObuListener() // .onGnssInfo(cvxHvInfoIndInfo) diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestTriggerReceiver.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestTriggerReceiver.kt deleted file mode 100644 index 052107741e..0000000000 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestTriggerReceiver.kt +++ /dev/null @@ -1,89 +0,0 @@ -package com.mogo.eagle.core.function.datacenter.obu.receiver - -import android.content.BroadcastReceiver -import android.content.Context -import android.content.Intent -//import com.mogo.eagle.core.function.obu.mogo.MogoObuConst -//import com.mogo.eagle.core.function.datacenter.obu.MogoPrivateObuManager -//import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger -//import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU -//import com.zhidao.support.obu.constants.ObuConstants -//import com.zhidao.support.obu.model.CvxV2vThreatIndInfo -//import com.zhidao.support.obu.model.advance.MovingObjectInfo -//import com.zhidao.support.obu.model.advance.Position -//import com.zhidao.support.obu.model.advance.V2vThreat -//import com.zhidao.support.obu.model.advance.V2vThreatExt -//import kotlin.random.Random - -/** - * @author xiaoyuzhou - * @date 2021/8/11 10:50 上午 - * - * OBU 测试使用 - */ -class ObuTestTriggerReceiver : BroadcastReceiver() { - private var mContext: Context? = null - - companion object { - private const val TAG = "ObuTestTriggerReceiver" - } - - override fun onReceive(context: Context, intent: Intent) { -// mContext = context -// /** -// * OBU 场景类型 -// * @see com.zhidao.support.obu.constants.ObuConstants.USE_CASE_ID -// */ -// val obuType = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_TYPE_EXTRA_KEY, 0) -// val obuStatus = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_STATES_EXTRA_KEY, 0) -// val obuLevel = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_LEVEL_EXTRA_KEY, 3) -// val obuDirection = -// intent.getIntExtra(MogoObuConst.BROADCAST_OBU_EVENT_DIRECTION_EXTRA_KEY, 0x11) -// CallerLogger.d( -// "$M_OBU$TAG", "obuType:$obuType obuStatus:$obuStatus obuDirection$obuDirection" -// ) -// -// when (obuType) { -// ObuConstants.USE_CASE_ID.EBW, ObuConstants.USE_CASE_ID.FCW, ObuConstants.USE_CASE_ID.ICW, -// ObuConstants.USE_CASE_ID.CLW, ObuConstants.USE_CASE_ID.DNPW, ObuConstants.USE_CASE_ID.AVW, -// ObuConstants.USE_CASE_ID.BSW, ObuConstants.USE_CASE_ID.LCW, ObuConstants.USE_CASE_ID.EVW, ObuConstants.USE_CASE_ID.VRUCW, -// ObuConstants.USE_CASE_ID.SLW, ObuConstants.USE_CASE_ID.LTA, ObuConstants.USE_CASE_ID.HLW, ObuConstants.USE_CASE_ID.IVS, -// ObuConstants.USE_CASE_ID.TJW, ObuConstants.USE_CASE_ID.IVP, ObuConstants.USE_CASE_ID.COC -> { -// -// // 构建测试数据 -// val cvxV2vThreatIndInfo = CvxV2vThreatIndInfo(1, 1, 1L) -// -// val v2vThreat = V2vThreat(1, obuType, null, 1000, obuLevel, 100) -// cvxV2vThreatIndInfo.threat_info = v2vThreat -// -// val v2vThreatExt = -// V2vThreatExt( -// 1, 1, obuDirection, 1, 1 -// ) -// cvxV2vThreatIndInfo.ext_info = v2vThreatExt -// cvxV2vThreatIndInfo.status = obuStatus -// cvxV2vThreatIndInfo.vehicle_id = "123321" -// -// -// // 设置位置 -// val randomLocation = Random.nextInt(100, 2000) -// -// val position = Position( -// 0, (399739429 + randomLocation).toLong(), -// (1164115207 + randomLocation).toLong(), 20 -// ) -// val movingObjectInfo = MovingObjectInfo( -// 0, -// position, -// 1800 +randomLocation, -// 6000 +randomLocation -// ) -// cvxV2vThreatIndInfo.basic_info = movingObjectInfo -// -// MogoPrivateObuManager.INSTANCE.getMogoObuListener() -// .onCvxV2vThreatIndInfo(cvxV2vThreatIndInfo) -// } -// } - } - -} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/PncActionsView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/PncActionsView.kt index 67c43f6f1f..66a1a68404 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/PncActionsView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/PncActionsView.kt @@ -2,7 +2,9 @@ package com.mogo.eagle.core.function.hmi.ui.vehicle import android.content.Context import android.util.AttributeSet +import android.util.TypedValue.COMPLEX_UNIT_PX import android.view.LayoutInflater +import android.view.ViewGroup import androidx.appcompat.content.res.AppCompatResources import androidx.constraintlayout.widget.ConstraintLayout import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo @@ -23,6 +25,8 @@ import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.util.UiThreadHandler import com.zhjt.service_biz.BizConfig import kotlinx.android.synthetic.main.view_pnc_actions.view.* +import me.jessyan.autosize.AutoSize +import me.jessyan.autosize.utils.AutoSizeUtils import mogo.telematics.pad.MessagePad class PncActionsView @JvmOverloads constructor( @@ -41,12 +45,24 @@ class PncActionsView @JvmOverloads constructor( private var mAutoPilotStatusInfo: AutopilotStatusInfo? = null + private val bgResources: Int + private val topMargin: Int + private val txtSize: Int + init { LayoutInflater.from(context).inflate(R.layout.view_pnc_actions, this, true) + val a = context.obtainStyledAttributes(attrs, R.styleable.PncActionsView, defStyleAttr, 0) + bgResources = a.getResourceId(R.styleable.PncActionsView_background_resource, R.drawable.pnc_actions_bg) + topMargin = a.getResourceId(R.styleable.PncActionsView_pnc_top_margin,resources.getDimension(R.dimen.dp_30).toInt()) + txtSize = a.getResourceId(R.styleable.PncActionsView_pnc_size,resources.getDimension(R.dimen.dp_34).toInt()) + a.recycle() } override fun onAttachedToWindow() { super.onAttachedToWindow() + (tvHmiPncActions.layoutParams as MarginLayoutParams).topMargin = topMargin + tvHmiPncActions.setTextSize(COMPLEX_UNIT_PX,txtSize.toFloat()) + CallerAutoPilotStatusListenerManager.addListener(TAG, this) CallerPlanningActionsListenerManager.addListener(TAG, this) CallerTrafficLightListenerManager.addListener(TAG, this) @@ -78,14 +94,21 @@ class PncActionsView @JvmOverloads constructor( var actions: String? = null planningActionMsg.actionMsg?.let { it -> try { - actions = PncActionsHelper.getAction(it.drivingState.number, it.drivingAction.number) - } catch (e:Exception){ + actions = PncActionsHelper.getAction( + it.drivingState.number, + it.drivingAction.number + ) + } catch (e: Exception) { e.printStackTrace() } //如果是存在云端红绿灯数据条件下,设置云端数据 - if (PncActionsHelper.isWaitingTrafficlight(it.drivingState.number, it.drivingAction.number) + if (PncActionsHelper.isWaitingTrafficlight( + it.drivingState.number, + it.drivingAction.number + ) && mTrafficLightResult != null - && getWaitTrafficLightTime().isNotBlank()) { + && getWaitTrafficLightTime().isNotBlank() + ) { actions += ",预计${getWaitTrafficLightTime()}秒后通过" } else { mTrafficLightResult = null @@ -96,7 +119,8 @@ class PncActionsView @JvmOverloads constructor( this.background = null tvHmiPncActions.text = "" } else { - this.background = AppCompatResources.getDrawable(context, R.drawable.pnc_actions_bg) + this.background = + AppCompatResources.getDrawable(context, bgResources) tvHmiPncActions.text = actions } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java index b32cfeeab4..f21e6f73e2 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java @@ -104,6 +104,11 @@ public class SteeringWheelView extends ConstraintLayout implements private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener() { + @Override + public void onAutopilotRouteLineId(long lineId) { + + } + @Override public void onAutopilotIpcConnectStatusChanged(int status, @Nullable String reason) { } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_pnc_actions.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_pnc_actions.xml index 81747337ad..7314ec144c 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_pnc_actions.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_pnc_actions.xml @@ -9,10 +9,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" - android:paddingStart="@dimen/dp_68" - android:paddingEnd="@dimen/dp_68" android:textColor="#FFFFFF" - android:textSize="@dimen/dp_34" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml index 638b1ca53c..4f2048218d 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml @@ -71,6 +71,13 @@ + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/angle/MoGoVisualAngleChangeProvider.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/angle/MoGoVisualAngleChangeProvider.kt index 52216f9c14..d07c857bf1 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/angle/MoGoVisualAngleChangeProvider.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/angle/MoGoVisualAngleChangeProvider.kt @@ -28,11 +28,8 @@ import java.util.concurrent.atomic.* @Route(path = MogoServicePaths.PATH_VISUAL_ANGLE) class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider { - override val functionName: String - get() = "VisualAngleChange" - companion object { - const val TAG = "VisualAngleChange" + private const val TAG = "VisualAngleChange" } private val triggerLocation = AtomicReference() @@ -147,11 +144,6 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider { return CoroutineScope(Handler(Looper.getMainLooper()).asCoroutineDispatcher("change-visual-angle") + SupervisorJob()) } - - override fun onDestroy() { - CallerMapRoadListenerManager.unRegisterRoadListener("VisualAngleChange") - } - @Volatile private var mLevel:Boolean = false diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/MogoRouteOverlayManager.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/MogoRouteOverlayManager.java index 9809818667..eeb872d6d3 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/MogoRouteOverlayManager.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/MogoRouteOverlayManager.java @@ -126,4 +126,9 @@ public class MogoRouteOverlayManager implements @Override public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) { } + + @Override + public void onAutopilotRouteLineId(long lineId) { + + } } diff --git a/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt index cf2c47b420..063358e94f 100644 --- a/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt +++ b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt @@ -1,21 +1,16 @@ package com.mogo.eagle.core.function.startup.stageone import android.content.Context -import com.mogo.aicloud.services.httpdns.HttpDnsConst -import com.mogo.aicloud.services.httpdns.IMogoHttpDns -import com.mogo.aicloud.services.httpdns.MogoHttpDnsHandler import com.mogo.aicloud.services.locationinfo.MogoLocationInfoServices import com.mogo.aicloud.services.socket.IMogoLifecycleListener import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager import com.mogo.cloud.httpdns.MogoHttpDnsConfig import com.mogo.cloud.httpdns.bean.HttpDnsSimpleLocation import com.mogo.cloud.httpdns.listener.IHttpDnsCurrentLocation -import com.mogo.cloud.httpdns.listener.OnAddressChangedListener import com.mogo.cloud.passport.IMoGoTokenCallback import com.mogo.cloud.passport.MoGoAiCloudClient import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.commons.AbsMogoApplication -import com.mogo.commons.constants.HostConst import com.mogo.commons.constants.SharedPrefsConstants import com.mogo.commons.debug.DebugConfig import com.mogo.commons.module.status.MogoStatusManager @@ -25,7 +20,6 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_CONNECT_FAIL import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_CONNECT_LOST import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_CONNECT_SUCCESS -import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_HTTP_DNS_CHANGED import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CLOUD import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS import com.mogo.eagle.core.data.map.MogoLocation @@ -58,8 +52,6 @@ class HttpDnsStartUp : AndroidStartup() { // 缓存IP地址 private var cacheIp: String? = null - private lateinit var mogoHttpDns: IMogoHttpDns - private var context: Context? = null private var gotToken = false @@ -77,7 +69,7 @@ class HttpDnsStartUp : AndroidStartup() { override fun create(context: Context): Boolean { this.context = context initGDLoc() - initHttpDns() + preparePassportEnvironment() return true } @@ -85,15 +77,6 @@ class HttpDnsStartUp : AndroidStartup() { CallerMapUIServiceManager.getGDLocationServer(context!!)?.start() } - /** - * 初始化 HttpDNS ,这里会通过一个接口获取所有鹰眼中使用的微服务域名以及端口号 - * 后续的网络请求会通过 HttpDnsInterceptor 进行拦截替换 - */ - private fun initHttpDns() { - mogoHttpDns = MogoHttpDnsHandler.getHttpDnsApi() - preparePassportEnvironment() - } - private fun preparePassportEnvironment() { // 设置网络环境:HTTP_DNS_ENV_QA、HTTP_DNS_ENV_RELEASE、HTTP_DNS_ENV_DEV when (DebugConfig.getNetMode()) { @@ -111,9 +94,9 @@ class HttpDnsStartUp : AndroidStartup() { clientConfig.isUseOriginSocket = true // 设置是否输出网络日志 clientConfig.isShowNetDebugLog = false -// clientConfig.passportUrl //todo yakun -// clientConfig.socketBaseUrl -// clientConfig.socketTechUrl + clientConfig.passportUrl = FunctionBuildConfig.urlJson.passportUrl + clientConfig.socketBaseUrl = FunctionBuildConfig.urlJson.socketBaseUrl + clientConfig.socketTechUrl = FunctionBuildConfig.urlJson.socketTechUrl // 设置是否是直播推流的主播 clientConfig.isAnchor = true when (DebugConfig.getCarMachineType()) { @@ -145,7 +128,8 @@ class HttpDnsStartUp : AndroidStartup() { return HttpDnsSimpleLocation(envConfig.cityCode, envConfig.lat, envConfig.lon) } var mogoLocation: MogoLocation? = null - val locationClient = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02() + val locationClient = + CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02() if (locationClient != null) { mogoLocation = locationClient } @@ -213,8 +197,6 @@ class HttpDnsStartUp : AndroidStartup() { CallerCloudListenerManager.invokeCloudTokenGot(token, sn) // 异步初始化NetConfig asyncInit() - // HttpDns ttl回调 --- socketTTL -// registerSocketHttpDnsTTL() startSocketService() // 开启每5s/次定位上报 uploadLocPerFiveSecond() @@ -251,35 +233,6 @@ class HttpDnsStartUp : AndroidStartup() { } } - /** - * 请求获取最新的 DNS 微服务 域名信息 - */ - private fun registerSocketHttpDnsTTL() { - mogoHttpDns.addressChangedListener(object : OnAddressChangedListener { - @ChainLog( - linkChainLog = CHAIN_LINK_LOG_CONNECT_STATUS, - linkCode = CHAIN_LINK_CLOUD, - endpoint = PAD, - nodeAliasCode = CHAIN_ALIAS_CODE_HTTP_DNS_CHANGED, - paramIndexes = [0, 1], - clientPkFileName = "sn" - ) - override fun onAddressChanged(cityCode: String, address: Map?) { - val dnsCacheIp = mogoHttpDns.getCachedHttpDnsIps( - HostConst.SOCKET_CENTER_DOMAIN, - HttpDnsConst.HTTP_DNS_ADDRESS_TYPE_HTTP - ) ?: return - if (dnsCacheIp != cacheIp) { - CallerLogger.d( - SceneConstant.M_MAIN + TAG, - "获取缓存Dns IP : $dnsCacheIp , 原缓存 IP : $cacheIp" - ) - cacheIp = dnsCacheIp - } - } - }) - } - /** * 上传自车位置信息到云端 */ diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/net/UrlConfig.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/net/UrlConfig.kt index 31269b7552..a6eb7af2cb 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/net/UrlConfig.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/net/UrlConfig.kt @@ -4,5 +4,13 @@ import com.google.gson.annotations.SerializedName data class UrlConfig( @SerializedName("och_url") - val ochUrl: String + val ochUrl: String, + @SerializedName("shuttle_url") + val shuttleUrl: String, + @SerializedName("passport_url") + val passportUrl: String, + @SerializedName("socket_base_url") + val socketBaseUrl: String, + @SerializedName("socket_tech_url") + val socketTechUrl: String ) \ No newline at end of file diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/telematic/TelematicConstant.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/telematic/TelematicConstant.kt new file mode 100644 index 0000000000..6c02b811db --- /dev/null +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/telematic/TelematicConstant.kt @@ -0,0 +1,7 @@ +package com.mogo.eagle.core.data.telematic + +class TelematicConstant { + companion object { + const val BUSINESS_STRING = 100 + } +} \ No newline at end of file diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/trafficlight/TrafficLightResult.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/trafficlight/TrafficLightResult.kt index bea0fc16be..8c9ecfb629 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/trafficlight/TrafficLightResult.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/trafficlight/TrafficLightResult.kt @@ -15,15 +15,17 @@ fun TrafficLightResult.toTrafficLightDetail():MessagePad.TrafficLightDetail{ val left = trafficLightBuilder.leftBuilder val mid = trafficLightBuilder.midBuilder val right = trafficLightBuilder.rightBuilder - left.phaseNo = this.laneList.left.phaseNo - left.color = this.laneList.left.color - left.remain = this.laneList.left.remain - mid.phaseNo = this.laneList.mid.phaseNo - mid.color = this.laneList.mid.color - mid.remain = this.laneList.mid.remain - right.phaseNo = this.laneList.right.phaseNo - right.color = this.laneList.right.color - right.remain = this.laneList.right.remain + if(this.laneList != null){ + left.phaseNo = this.laneList.left.phaseNo + left.color = this.laneList.left.color + left.remain = this.laneList.left.remain + mid.phaseNo = this.laneList.mid.phaseNo + mid.color = this.laneList.mid.color + mid.remain = this.laneList.mid.remain + right.phaseNo = this.laneList.right.phaseNo + right.color = this.laneList.right.color + right.remain = this.laneList.right.remain + } return trafficLightBuilder.build() } @@ -39,7 +41,7 @@ data class TrafficLightResult( val lightId: Int, //红绿灯ID val laneNo: Int, //车道号 val arrowNo: Int, //当前车道对应地面要素转向 - val laneList: TrafficLightDetail, //灯态具体信息 + val laneList: TrafficLightDetail?, //灯态具体信息 val flashYellow: Int,// 黄灯总时间 val timeStamp: Long //当前卫星时间,单位:ms ) { diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/trafficlight/TrafficLightStatusHelper.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/trafficlight/TrafficLightStatusHelper.kt index 3b6f9ac6ef..1ab8483128 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/trafficlight/TrafficLightStatusHelper.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/trafficlight/TrafficLightStatusHelper.kt @@ -4,6 +4,9 @@ object TrafficLightStatusHelper { fun getCurrentRoadTrafficLight(trafficLightResult: TrafficLightResult): TrafficLightStatus? { val arrowNo = trafficLightResult.arrowNo + if(trafficLightResult.laneList == null){ + return null + } if (RoadArrow.isLeft(arrowNo) && trafficLightResult.laneNo == -1) { return trafficLightResult.laneList.left } diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/LineUploadData.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/LineUploadData.kt new file mode 100644 index 0000000000..8700029ed9 --- /dev/null +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/LineUploadData.kt @@ -0,0 +1,6 @@ +package com.mogo.eagle.core.data.v2x + +/** + * 路线上报 + */ +data class LineUploadData(val lineId:Long,val sn:String) \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatusListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatusListener.kt index 86208cc151..87d4452fb7 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatusListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatusListener.kt @@ -44,7 +44,12 @@ interface IMoGoAutopilotStatusListener { /** * 工控机主动查询 AdasManager#sendStatusQueryReq(),后会收到如下回调 */ - fun onAutopilotStatusRespByQuery(status: SystemStatusInfo.StatusInfo) { } + fun onAutopilotStatusRespByQuery(status: SystemStatusInfo.StatusInfo) {} + + /** + * 自动驾驶路线ID回调 + */ + fun onAutopilotRouteLineId(lineId: Long){} companion object { /** diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/angle/IMoGoVisualAngleChangeProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/angle/IMoGoVisualAngleChangeProvider.kt index a4c1ec1712..a91757137d 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/angle/IMoGoVisualAngleChangeProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/angle/IMoGoVisualAngleChangeProvider.kt @@ -1,8 +1,8 @@ package com.mogo.eagle.core.function.api.map.angle -import com.mogo.eagle.core.function.api.base.* +import com.alibaba.android.arouter.facade.template.IProvider -interface IMoGoVisualAngleChangeProvider: IMoGoFunctionServerProvider { +interface IMoGoVisualAngleChangeProvider: IProvider { fun updateLongSightLevel(level: Boolean) diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuLocationWGS84Listener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuLocationWGS84Listener.kt index 16c5fd57b3..8c4eeac160 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuLocationWGS84Listener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuLocationWGS84Listener.kt @@ -1,6 +1,6 @@ package com.mogo.eagle.core.function.api.obu -import com.mogo.support.obu.model.MogoObuHvBasicsData +import mogo.telematics.pad.MessagePad /** * OBU HV 自车车辆基础信息数据,自车定位数据 WGS84 坐标系 @@ -15,6 +15,6 @@ interface IMoGoObuLocationWGS84Listener { * @param data 数据 * @since 1.0.0 */ - fun onObuLocationWGS84(data: MogoObuHvBasicsData) + fun onObuLocationWGS84(data: MessagePad.GnssInfo) } \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/telematic/IMogoTelematicProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/telematic/IMogoTelematicProvider.kt index 70303c7b99..39ff7d0f62 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/telematic/IMogoTelematicProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/telematic/IMogoTelematicProvider.kt @@ -10,4 +10,8 @@ interface IMogoTelematicProvider: IProvider { fun getServerIp(): String fun getServerToken(): String + + fun sendMsgToAllClients(type: Int, byteArray: ByteArray) + + fun sendMsgToServer(type: Int, byteArray: ByteArray) } \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/telematic/IReceivedMsgListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/telematic/IReceivedMsgListener.kt new file mode 100644 index 0000000000..c64b114963 --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/telematic/IReceivedMsgListener.kt @@ -0,0 +1,5 @@ +package com.mogo.eagle.core.function.api.telematic + +interface IReceivedMsgListener { + fun onReceivedMsg(type: Int, byteArray: ByteArray) +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt index e158d6bced..a8e8131ab8 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt @@ -7,6 +7,9 @@ import com.mogo.eagle.core.function.call.base.CallerBase import com.mogo.eagle.core.utilcode.util.GsonUtils import mogo.telematics.pad.MessagePad import mogo_msg.MogoReportMsg +import system_master.* +import java.util.concurrent.ConcurrentHashMap +import kotlin.properties.Delegates import system_master.SystemStatusInfo /** @@ -20,6 +23,20 @@ object CallerAutoPilotStatusListenerManager : CallerBase + if(newValue == null){ + return@observable + } + M_AUTOPILOT_STATUS_LISTENERS.forEach { + val listener = it.value + listener.onAutopilotRouteLineId(newValue) + } + } + + // 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步 + private val M_AUTOPILOT_STATUS_LISTENERS: ConcurrentHashMap = + ConcurrentHashMap() + @Volatile private var autoPilotMessageCode: String = "" @@ -167,6 +184,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase() { - fun invokeObuLocationWGS84(data: MogoObuHvBasicsData) { + fun invokeObuLocationWGS84(data: MessagePad.GnssInfo) { M_LISTENERS.forEach { val tag = it.key val listener = it.value diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/telematic/CallerTelematicListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/telematic/CallerTelematicListenerManager.kt new file mode 100644 index 0000000000..54201e9325 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/telematic/CallerTelematicListenerManager.kt @@ -0,0 +1,14 @@ +package com.mogo.eagle.core.function.call.telematic + +import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener +import com.mogo.eagle.core.function.call.base.CallerBase + +object CallerTelematicListenerManager: CallerBase() { + + fun invokeReceivedMsg(type: Int, byteArray: ByteArray) { + M_LISTENERS.forEach { + val listener = it.value + listener.onReceivedMsg(type, byteArray) + } + } +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/telematic/CallerTelematicManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/telematic/CallerTelematicManager.kt index 34bf5ea141..c164e12b15 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/telematic/CallerTelematicManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/telematic/CallerTelematicManager.kt @@ -34,4 +34,20 @@ object CallerTelematicManager { fun getServerToken(): String { return providerApi?.getServerToken() ?: "" } + + /** + * 发送数据给所有客户端 + * type:保存在TelematicConstant中 + */ + fun sendMsgToAllClients(type: Int, byteArray: ByteArray) { + providerApi?.sendMsgToAllClients(type, byteArray) + } + + /** + * 发送数据给服务端 + * type:保存在TelematicConstant中 + */ + fun sendMsgToServer(type: Int, byteArray: ByteArray) { + providerApi?.sendMsgToServer(type, byteArray) + } } \ No newline at end of file diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/constants/HostConst.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/constants/HostConst.java index 36ffa13fce..ff72401217 100644 --- a/foudations/mogo-commons/src/main/java/com/mogo/commons/constants/HostConst.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/constants/HostConst.java @@ -12,6 +12,7 @@ public class HostConst { public static final String CAMERA_STREAM_HOST = "http://dzt-smartTransportationAiCloud.zhidaozhixing.com"; public static final String OPEN_CAMERA_STREAM_HOST = "http://10.0.16.6:18080"; + public static final String DATA_CENTER_HOST = "http://dzt-data-center.zhidaozhixing.com"; public static final String CITY_HOST = "http://dzt-city.zhidaozhixing.com"; public static final String SOCKET_CENTER_DOMAIN = "socketRegion"; diff --git a/gradle.properties b/gradle.properties index a517dddfd6..37794b3bc5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ org.gradle.daemon=true org.gradle.configureondemand=true org.gradle.parallel=true -org.gradle.jvmargs=-Xmx3048m +org.gradle.jvmargs=-Xmx3072m #开启gradle缓存 org.gradle.caching=true android.enableBuildCache=true @@ -66,23 +66,23 @@ SERVICE_BIZ_VERSION=1.2.4 LOGLIB_VERSION=1.5.10 ######## MogoAiCloudSDK Version ######## # 网络请求LOGLIB_VERSION -MOGO_NETWORK_VERSION=1.4.4.1 +MOGO_NETWORK_VERSION=1.4.4.2 # 鉴权 -MOGO_PASSPORT_VERSION=1.4.4.1 +MOGO_PASSPORT_VERSION=1.4.4.2 # 常链接 -MOGO_SOCKET_VERSION=1.4.4.1 +MOGO_SOCKET_VERSION=1.4.4.2 # 数据采集 -MOGO_REALTIME_VERSION=1.4.4.1 +MOGO_REALTIME_VERSION=1.4.4.2 # 探路,道路事件发布,获取 -MOGO_TANLU_VERSION=1.4.4.1 +MOGO_TANLU_VERSION=1.4.4.2 # 直播推流 -MOGO_LIVE_VERSION=1.4.4.1 +MOGO_LIVE_VERSION=1.4.4.2 # 直播拉流 -MOGO_TRAFFICLIVE_VERSION=1.4.4.1 +MOGO_TRAFFICLIVE_VERSION=1.4.4.2 # 定位服务 -MOGO_LOCATION_VERSION=1.4.4.1 +MOGO_LOCATION_VERSION=1.4.4.2 # 远程通讯模块 -MOGO_TELEMATIC_VERSION=1.4.4.1 +MOGO_TELEMATIC_VERSION=1.4.4.2 ######## MogoAiCloudSDK Version ######## # 自研地图 MAP_SDK_VERSION=2.10.0.2_test_01 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 8c003a0a5f..e264f883ad 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 @@ -126,7 +126,7 @@ public class AMapViewWrapper implements IMogoMapView, private void initViews() { // 初始化首次地图进入的时候的样式, MapAutoApi.INSTANCE.init(context, mapParams);将影响这里的数据 int mapStyle = MapAutoApi.INSTANCE.getMapParams().getStyleMode(); - CallerLogger.INSTANCE.e(M_MAP + TAG, "默认配置地图模式:mapStyle=" + mapStyle); + CallerLogger.INSTANCE.d(M_MAP + TAG, "默认配置地图模式:mapStyle=" + mapStyle); switch (mapStyle) { case MapAutoApi.MAP_STYLE_DAY: mCurrentUI = EnumMapUI.MAP_STYLE_DAY; diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapView.java b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapView.java index 538db0e039..62f04538f1 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapView.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapView.java @@ -89,7 +89,6 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle { } public void setExtraGPSData(MogoLocation gnssInfo) { - getMap().getUIController().setExtraGPSData(gnssInfo); }