Merge remote-tracking branch 'origin/dev_RoboBus_P_230213_1.0.2' into dev_RoboBus_P_230213_1.0.2
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
BIN
OCH/mogo-och-bus-passenger/src/m2/assets/m2_map_style.data
Normal file
BIN
OCH/mogo-och-bus-passenger/src/m2/assets/m2_map_style.data
Normal file
Binary file not shown.
BIN
OCH/mogo-och-bus-passenger/src/m2/assets/m2_map_style_extra.data
Normal file
BIN
OCH/mogo-och-bus-passenger/src/m2/assets/m2_map_style_extra.data
Normal file
Binary file not shown.
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<PM2OperationStatusResponse> {
|
||||
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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
* <p>
|
||||
* 根据优先级控制显示 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) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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%"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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
|
||||
) {
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 900 B |
Binary file not shown.
|
After Width: | Height: | Size: 838 B |
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient android:centerColor="@color/m2_pnc_bg_color"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<corners android:radius="5dp"/>
|
||||
<solid android:color="#A3BDF2" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:id="@android:id/secondaryProgress">
|
||||
<clip>
|
||||
<shape>
|
||||
<corners android:radius="5dp"/>
|
||||
<solid android:color="#66FFFFFF" />
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="5dp"/>
|
||||
<gradient android:startColor="#56C59C" android:endColor="#56EFA0"/>
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="@dimen/m2_p_light_width"
|
||||
android:layout_height="@dimen/m2_p_light_height"
|
||||
android:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/m2_p_traffic_light_bg"
|
||||
android:layout_width="@dimen/m2_p_light_width"
|
||||
android:layout_height="@dimen/m2_p_light_height"
|
||||
android:background="@drawable/bg_p_m2_auto"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/m2_p_traffic_light_iv"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:scaleType="fitXY"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/m2_p_traffic_light_time_tv"
|
||||
android:layout_width="@dimen/dp_12"
|
||||
android:layout_height="match_parent"
|
||||
android:textSize="@dimen/dp_22"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/m2_light_tv_color"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:gravity="center" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -5,11 +5,19 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_556">
|
||||
|
||||
<!-- 全览地图带站点-->
|
||||
<com.mogo.eagle.core.function.view.OverMapView
|
||||
android:id="@+id/overMapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:mapStyleExtraPath="@string/m2_over_map_style_extra_path"
|
||||
app:mapStylePath="@string/m2_over_map_style_path" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/img_drive_bg"
|
||||
android:layout_width="@dimen/dp_290"
|
||||
android:layout_height="@dimen/dp_140"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_66"
|
||||
android:layout_marginLeft="@dimen/dp_24"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
@@ -26,6 +34,7 @@
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/img_drive_bg"
|
||||
android:layout_marginLeft="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
app:layout_constraintTop_toTopOf="@+id/img_drive_bg"
|
||||
tools:ignore="SpUsage" />
|
||||
|
||||
@@ -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" />
|
||||
|
||||
<!-- 红绿灯-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
|
||||
android:id="@+id/traffic_light_view"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_38"
|
||||
<com.mogo.och.bus.passenger.ui.widget.M2PTrafficLightView android:id="@+id/traffic_light_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
app:layout_constraintLeft_toRightOf="@+id/turn_light_view"
|
||||
app:layout_constraintTop_toTopOf="@+id/auto_tv" />
|
||||
@@ -90,7 +98,7 @@
|
||||
android:src="@drawable/m2_line_location_bg"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/task_name_tv"
|
||||
android:id="@+id/line_name_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
@@ -101,14 +109,26 @@
|
||||
android:textColor="@color/m2_line_name_tv_color"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/task_during_tv"
|
||||
android:id="@+id/no_line_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/m2_p_no_line"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toTopOf="@+id/img_line_location_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/img_line_location_bg"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
|
||||
android:textColor="@color/m2_no_line_tv_color"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/line_during_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:textSize="@dimen/dp_18"
|
||||
android:text="--"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/task_name_tv"
|
||||
app:layout_constraintTop_toBottomOf="@+id/task_name_tv"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/line_name_tv"
|
||||
app:layout_constraintTop_toBottomOf="@+id/line_name_tv"
|
||||
android:textColor="@color/m2_line_during_tv_color"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
@@ -137,7 +157,8 @@
|
||||
android:textSize="@dimen/dp_42"
|
||||
android:textStyle="bold"
|
||||
android:text="--"
|
||||
app:layout_constraintTop_toTopOf="@+id/img_time_clock_bg"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
app:layout_constraintTop_toTopOf="@+id/img_time_bg"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
|
||||
android:textColor="@color/m2_current_time_tv_color"/>
|
||||
|
||||
@@ -151,12 +172,4 @@
|
||||
android:text="--"
|
||||
android:textColor="@color/m2_line_during_tv_color"/>
|
||||
|
||||
<!-- 全览地图带站点-->
|
||||
<com.mogo.eagle.core.function.view.OverMapView
|
||||
android:id="@+id/overMapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -8,7 +8,7 @@
|
||||
<FrameLayout
|
||||
android:id="@+id/driving_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_853"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<FrameLayout
|
||||
android:id="@+id/hd_map_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_853"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/driving_fragment"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<FrameLayout
|
||||
android:id="@+id/video_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_853"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/hd_map_fragment"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="@dimen/dp_800">
|
||||
|
||||
<!-- 高精地图 -->
|
||||
|
||||
@@ -23,9 +23,10 @@
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
||||
android:id="@+id/pnc_actions_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="@dimen/dp_231"
|
||||
android:layout_height="@dimen/dp_36"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:background_resource="@drawable/bg_pnc" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="@dimen/dp_18"
|
||||
android:layout_height="@dimen/dp_26">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/blueView"
|
||||
android:layout_width="@dimen/dp_18"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/m2_blue_tooth_open"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout"
|
||||
tools:ignore="MissingDefaultResource">
|
||||
|
||||
<!--Wifi状态-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.WifiStateView
|
||||
android:id="@+id/wifiStateView"
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_50" />
|
||||
|
||||
<!--魔方连接状态 蓝牙-->
|
||||
<com.mogo.och.bus.passenger.ui.widget.M2BlueToothView
|
||||
android:id="@+id/blueToothView"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/wifiStateView"
|
||||
android:layout_width="@dimen/dp_15"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
android:src="@drawable/m2_blue_tooth_open"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_32" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/progress"
|
||||
android:layout_width="@dimen/dp_115"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_40"
|
||||
android:layout_marginEnd="@dimen/dp_7"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/tv_power_cos"
|
||||
android:maxHeight="@dimen/dp_8"
|
||||
android:minHeight="@dimen/dp_8"
|
||||
android:layout_marginRight="4dp"
|
||||
android:splitTrack="false"
|
||||
android:progressDrawable="@drawable/m2_power_seekbar_style"
|
||||
android:thumb="@null" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_power_cos"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:textSize="@dimen/dp_18"
|
||||
android:textColor="@color/m2_power_tv_color"
|
||||
android:layout_marginRight="@dimen/dp_50"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<ImageView
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:src="@drawable/m2_status_bar_logo"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="@dimen/dp_96"
|
||||
android:layout_height="@dimen/dp_28"/>
|
||||
|
||||
|
||||
|
||||
</merge>
|
||||
@@ -7,6 +7,10 @@
|
||||
<color name="m2_line_name_tv_color">#0B1E38</color>
|
||||
<color name="m2_line_during_tv_color">#5D7199</color>
|
||||
<color name="m2_current_time_tv_color">#0B1E38</color>
|
||||
<color name="m2_no_line_tv_color">#6B7EA6</color>
|
||||
<color name="m2_light_tv_color">#2D3E5F</color>
|
||||
<color name="m2_pnc_bg_color">#A5D8FF</color>
|
||||
<color name="m2_power_tv_color">#1B2546</color>
|
||||
|
||||
<color name="bus_traffic_light_red_color_up">#FFFFA28B</color>
|
||||
<color name="bus_traffic_light_red_color_down">#FFDA1100</color>
|
||||
|
||||
@@ -1,61 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="bus_p_route_info_panel_width">700dp</dimen>
|
||||
<dimen name="bus_p_auto_icon_margin_top">40dp</dimen>
|
||||
<dimen name="bus_p_route_info_margin_right">40dp</dimen>
|
||||
<dimen name="bus_p_route_info_margin_left">40dp</dimen>
|
||||
<dimen name="bus_p_route_info_margin_bottom">40dp</dimen>
|
||||
<dimen name="bus_p_route_info_margin_top">110dp</dimen>
|
||||
<dimen name="bus_p_route_line_info_height">224dp</dimen>
|
||||
<dimen name="bus_p_route_line_map_view_height">510dp</dimen>
|
||||
<dimen name="bus_p_route_line_dividing_view_height">3dp</dimen>
|
||||
|
||||
<dimen name="bus_p_route_traffic_light_view_width">158dp</dimen>
|
||||
<dimen name="bus_p_route_traffic_light_view_height">90dp</dimen>
|
||||
<dimen name="bus_p_route_traffic_light_view_corner">45dp</dimen>
|
||||
<dimen name="bus_p_traffic_light_bg_width">158dp</dimen>
|
||||
<dimen name="bus_p_traffic_light_bg_height">90dp</dimen>
|
||||
<dimen name="bus_p_traffic_light_time_size">45dp</dimen>
|
||||
<dimen name="bus_p_traffic_light_time_view_width">90dp</dimen>
|
||||
<dimen name="bus_p_traffic_light_icon_size">90dp</dimen>
|
||||
<dimen name="bus_p_traffic_light_bg_stroke_width">3dp</dimen>
|
||||
|
||||
<dimen name="bus_p_route_dividing_line2_margin_top">224dp</dimen>
|
||||
<dimen name="bus_p_driver_number_plate_margin_top">50dp</dimen>
|
||||
<dimen name="bus_p_driver_number_plate_margin_bottom">50dp</dimen>
|
||||
<dimen name="bus_p_driver_number_plate_size">44dp</dimen>
|
||||
<dimen name="bus_p_line_operation_time_margin_top">130dp</dimen>
|
||||
<dimen name="bus_p_line_operation_time_size">38dp</dimen>
|
||||
|
||||
<dimen name="bus_p_no_data_size">36dp</dimen>
|
||||
|
||||
<dimen name="bus_p_speed_txt_size">110dp</dimen>
|
||||
<dimen name="bus_p_speed_unit_txt_size">42dp</dimen>
|
||||
|
||||
<dimen name="bus_p_station_circle_borner_size">4dp</dimen>
|
||||
<dimen name="bus_p_station_circle_radius_size">10dp</dimen>
|
||||
<dimen name="bus_p_station_circle_width_height">20dp</dimen>
|
||||
<dimen name="bus_p_station_tag_width_height">60dp</dimen>
|
||||
<dimen name="bus_p_station_tag_radius_size">30dp</dimen>
|
||||
<dimen name="bus_p_cur_station_circle_width">20dp</dimen>
|
||||
<dimen name="bus_p_cur_station_circle_height">50dp</dimen>
|
||||
<dimen name="bus_p_mid_station_circle_cor">6dp</dimen>
|
||||
<dimen name="bus_p_station_txt_size">50dp</dimen>
|
||||
<dimen name="bus_p_station_tag_txt_size">36dp</dimen>
|
||||
<dimen name="bus_p_station_item_height">80dp</dimen>
|
||||
<dimen name="bus_p_station_item_middle_height">100dp</dimen>
|
||||
<dimen name="bus_p_station_tag_line_height">80dp</dimen>
|
||||
<dimen name="bus_p_station_tag_line_height1">60dp</dimen>
|
||||
<dimen name="bus_p_station_tag_line_width">6dp</dimen>
|
||||
|
||||
<dimen name="bus_p_curent_station_panel_width">685dp</dimen>
|
||||
<dimen name="bus_p_curent_station_panel_height">309dp</dimen>
|
||||
<dimen name="bus_p_curent_station_panel_margin">50dp</dimen>
|
||||
<dimen name="bus_p_curent_station_panel_margin_left">10dp</dimen>
|
||||
<dimen name="bus_p_curent_station_txt_size">44dp</dimen>
|
||||
<dimen name="bus_p_curent_station_txt_size1">55dp</dimen>
|
||||
<dimen name="bus_p_curent_station_tip_size1">40dp</dimen>
|
||||
|
||||
<dimen name="bus_p_curent_station_txt_width">584dp</dimen>
|
||||
<dimen name="bus_p_station_txt_width">550dp</dimen>
|
||||
<dimen name="m2_p_light_width">60dp</dimen>
|
||||
<dimen name="m2_p_light_height">40dp</dimen>
|
||||
</resources>
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="bus_p_speed_unit_txt">KM/H</string>
|
||||
<string name="m2_p_speed_unit_txt">KM/H</string>
|
||||
<string name="bus_p_no_out">您已收车</string>
|
||||
<string name="bus_p_no_task">暂无班次</string>
|
||||
<string name="m2_p_no_line">暂无路线</string>
|
||||
<string name="bus_p_start_station_txt_tag">起</string>
|
||||
<string name="bus_p_end_station_txt_tag">终</string>
|
||||
<string name="bus_p_cur_station_title">到达站:</string>
|
||||
@@ -10,4 +10,9 @@
|
||||
<string name="bus_p_cur_station_title_init">始发站:</string>
|
||||
<string name="bus_p_cur_station_arrived_tip">请携带好随身物品下车。</string>
|
||||
<string name="bus_p_cur_station_arrived_tip_init">欢迎乘坐蘑菇车联自动驾驶车。</string>
|
||||
|
||||
<string name="m2_over_map_style_path">src/m2/assets/m2_map_style.data</string>
|
||||
<string name="m2_over_map_style_extra_path">src/m2/assets/m2_map_style_extra.data</string>
|
||||
<string name="m2_p_auto_tv">Auto</string>
|
||||
|
||||
</resources>
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
)
|
||||
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
|
||||
@@ -267,6 +267,11 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
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<BusFragment>
|
||||
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("核验通过");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
|
||||
<!-- region tts -->
|
||||
<string name="bus_arrived_station_tip">已到达%1$s,带好随身物品,下车请注意。</string>
|
||||
<string name="bus_arrived_station_tip">已到达%1$s,带好随身物品,下车请注意安全。</string>
|
||||
<string name="bus_leave_station_tip">车辆起步,请扶稳坐好,前方到站是%1$s,请下车的乘客做好准备。</string>
|
||||
<string name="bus_end_task_tip">感谢您体验\'蘑菇车联\'自动驾驶小巴车,我们下次再见。</string>
|
||||
<!-- endregion -->
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
|
||||
@@ -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)
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -161,6 +161,11 @@ public class SweeperPresenter extends Presenter<SweeperFragment>
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRouteLineId(long lineId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autopilotStatusInfo) {
|
||||
if (autopilotStatusInfo == null) return;
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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) {
|
||||
}
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
48
app/urlConfig.json
Normal file
48
app/urlConfig.json
Normal file
@@ -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/"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
@@ -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<BaseData>
|
||||
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -137,13 +137,6 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
|
||||
}
|
||||
}
|
||||
|
||||
fun getTrafficLightCurrentState(): TrafficLightDetail? {
|
||||
trafficLightResult?.let {
|
||||
return it.laneList
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
fun getRoadResult(): RoadIDResult? {
|
||||
return roadIDResult
|
||||
}
|
||||
|
||||
@@ -3,13 +3,7 @@
|
||||
package="com.mogo.eagle.core.function.datacenter">
|
||||
|
||||
<application>
|
||||
<receiver android:name=".obu.receiver.ObuTestTriggerReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.obu.test_trigger" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<receiver android:name=".obu.receiver.ObuTestTriggerRecognizedReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.obu.test_trigger_recognized" />
|
||||
@@ -18,13 +12,6 @@
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".obu.receiver.ObuRsuTestTriggerReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.obu.test_light_recognized" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".obu.receiver.ObuTestNewObuReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.obu.test_newobu" />
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -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 -> {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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等
|
||||
|
||||
@@ -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
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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<ObuBase.SpatLight>) {
|
||||
private fun handlerTrafficLight(
|
||||
appId: Int,
|
||||
status: Int,
|
||||
lights: MutableList<ObuBase.SpatLight>
|
||||
) {
|
||||
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
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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?) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -71,6 +71,13 @@
|
||||
|
||||
<declare-styleable name="SteeringBrakeView">
|
||||
<attr name="day_light_mode" format="boolean"/>
|
||||
<attr name="brakeView" format="boolean"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="PncActionsView">
|
||||
<attr name="background_resource" format="reference"/>
|
||||
<attr name="pnc_top_margin" format="reference"/>
|
||||
<attr name="pnc_size" format="reference"/>
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
||||
@@ -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<MogoLocation>()
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -126,4 +126,9 @@ public class MogoRouteOverlayManager implements
|
||||
@Override
|
||||
public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRouteLineId(long lineId) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<Boolean>() {
|
||||
// 缓存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<Boolean>() {
|
||||
override fun create(context: Context): Boolean {
|
||||
this.context = context
|
||||
initGDLoc()
|
||||
initHttpDns()
|
||||
preparePassportEnvironment()
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -85,15 +77,6 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
|
||||
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<Boolean>() {
|
||||
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<Boolean>() {
|
||||
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<Boolean>() {
|
||||
CallerCloudListenerManager.invokeCloudTokenGot(token, sn)
|
||||
// 异步初始化NetConfig
|
||||
asyncInit()
|
||||
// HttpDns ttl回调 --- socketTTL
|
||||
// registerSocketHttpDnsTTL()
|
||||
startSocketService()
|
||||
// 开启每5s/次定位上报
|
||||
uploadLocPerFiveSecond()
|
||||
@@ -251,35 +233,6 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求获取最新的 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<String, String>?) {
|
||||
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
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传自车位置信息到云端
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
)
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.mogo.eagle.core.data.telematic
|
||||
|
||||
class TelematicConstant {
|
||||
companion object {
|
||||
const val BUSINESS_STRING = 100
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
) {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.mogo.eagle.core.data.v2x
|
||||
|
||||
/**
|
||||
* 路线上报
|
||||
*/
|
||||
data class LineUploadData(val lineId:Long,val sn:String)
|
||||
@@ -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 {
|
||||
/**
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.mogo.eagle.core.function.api.telematic
|
||||
|
||||
interface IReceivedMsgListener {
|
||||
fun onReceivedMsg(type: Int, byteArray: ByteArray)
|
||||
}
|
||||
@@ -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<IMoGoAutopilotStatusLis
|
||||
@Volatile
|
||||
private var mAutopilotStatusInfo: AutopilotStatusInfo = AutopilotStatusInfo()
|
||||
|
||||
private var lineId: Long? by Delegates.observable(0) { _, _, newValue ->
|
||||
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<String, IMoGoAutopilotStatusListener> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
@Volatile
|
||||
private var autoPilotMessageCode: String = ""
|
||||
|
||||
@@ -167,6 +184,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
|
||||
*/
|
||||
fun updateAutopilotControlParameters(autopilotControlParameters: AutopilotControlParameters? = null) {
|
||||
mAutopilotStatusInfo.autopilotControlParameters = autopilotControlParameters
|
||||
lineId = autopilotControlParameters?.autoPilotLine?.lineId
|
||||
invokeAutoPilotStatus(mAutopilotStatusInfo)
|
||||
}
|
||||
}
|
||||
@@ -3,13 +3,14 @@ package com.mogo.eagle.core.function.call.obu
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.support.obu.model.MogoObuHvBasicsData
|
||||
import mogo.telematics.pad.MessagePad
|
||||
|
||||
/**
|
||||
* OBU HV 自车车辆基础信息数据,自车定位数据 WGS84 坐标系
|
||||
*/
|
||||
object CallerObuLocationWGS84ListenerManager : CallerBase<IMoGoObuLocationWGS84Listener>() {
|
||||
|
||||
fun invokeObuLocationWGS84(data: MogoObuHvBasicsData) {
|
||||
fun invokeObuLocationWGS84(data: MessagePad.GnssInfo) {
|
||||
M_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
|
||||
@@ -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<IReceivedMsgListener>() {
|
||||
|
||||
fun invokeReceivedMsg(type: Int, byteArray: ByteArray) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onReceivedMsg(type, byteArray)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -89,7 +89,6 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
|
||||
}
|
||||
|
||||
public void setExtraGPSData(MogoLocation gnssInfo) {
|
||||
|
||||
getMap().getUIController().setExtraGPSData(gnssInfo);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user